Skip to content

Commit

Permalink
refactor: use buffer imports where used for web type safety PE-6052
Browse files Browse the repository at this point in the history
  • Loading branch information
fedellen committed Oct 1, 2024
1 parent 426cca8 commit d8b51bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
import { AxiosInstance } from 'axios';
import { IAxiosRetryConfig } from 'axios-retry';
import { Buffer } from 'node:buffer';
import { Readable } from 'stream';
import { ReadableStream } from 'stream/web';

Expand Down
1 change: 1 addition & 0 deletions src/node/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
import { createReadStream, promises, statSync } from 'fs';
import { lookup } from 'mime-types';
import { Buffer } from 'node:buffer';
import { Readable } from 'node:stream';
import { join } from 'path';

Expand Down
5 changes: 4 additions & 1 deletion src/web/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ import {
ArweaveSigner,
EthereumSigner,
HexSolanaSigner,
InjectedEthereumSigner,
createData,
} from '@dha-team/arbundles';
import { Buffer } from 'node:buffer';

import { TurboDataItemAbstractSigner } from '../common/signer.js';
import {
Expand Down Expand Up @@ -47,7 +49,8 @@ export class TurboWebArweaveSigner extends TurboDataItemAbstractSigner {
// for arconnect, we need to make sure we have the public key before create data
if (
this.signer.publicKey === undefined &&
this.signer instanceof ArconnectSigner
(this.signer instanceof ArconnectSigner ||
this.signer instanceof InjectedEthereumSigner)

Check warning on line 53 in src/web/signer.ts

View check run for this annotation

Codecov / codecov/patch

src/web/signer.ts#L52-L53

Added lines #L52 - L53 were not covered by tests
) {
await this.signer.setPublicKey();
}
Expand Down

0 comments on commit d8b51bb

Please sign in to comment.