Skip to content

Commit

Permalink
fix: split getNonce interface
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Nov 29, 2022
1 parent a91f623 commit 7b7acd9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion __tests__/defaultProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('defaultProvider', () => {
});

test('getNonce()', async () => {
const nonce = await testProvider.getNonce(erc20ContractAddress);
const nonce = await testProvider.getNonceForAddress(erc20ContractAddress);
return expect(toBN(nonce)).toEqual(toBN('0x0'));
});

Expand Down
2 changes: 1 addition & 1 deletion src/account/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class Account extends Provider implements AccountInterface {
}

public async getNonce(blockIdentifier?: BlockIdentifier): Promise<BigNumberish> {
return super.getNonce(this.address, blockIdentifier);
return super.getNonceForAddress(this.address, blockIdentifier);
}

public async estimateFee(
Expand Down
4 changes: 2 additions & 2 deletions src/provider/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ export class Provider implements ProviderInterface {
);
}

public async getNonce(
public async getNonceForAddress(
contractAddress: string,
blockIdentifier?: BlockIdentifier
): Promise<BigNumberish> {
return this.provider.getNonce(contractAddress, blockIdentifier);
return this.provider.getNonceForAddress(contractAddress, blockIdentifier);
}

public async getStorageAt(
Expand Down
2 changes: 1 addition & 1 deletion src/provider/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export abstract class ProviderInterface {
* @param contractAddress - contract address
* @returns the hex nonce
*/
public abstract getNonce(
public abstract getNonceForAddress(
contractAddress: string,
blockIdentifier?: BlockIdentifier
): Promise<BigNumberish>;
Expand Down
2 changes: 1 addition & 1 deletion src/provider/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class RpcProvider implements ProviderInterface {
});
}

public async getNonce(
public async getNonceForAddress(
contractAddress: string,
blockIdentifier: BlockIdentifier = 'pending'
): Promise<RPC.Nonce> {
Expand Down
2 changes: 1 addition & 1 deletion src/provider/sequencer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class SequencerProvider implements ProviderInterface {
);
}

public async getNonce(
public async getNonceForAddress(
contractAddress: string,
blockIdentifier: BlockIdentifier = 'pending'
): Promise<BigNumberish> {
Expand Down

0 comments on commit 7b7acd9

Please sign in to comment.