From 7b7acd9f5ebe0b2b97e389fb3a68249dd72224ce Mon Sep 17 00:00:00 2001 From: Janek Date: Tue, 29 Nov 2022 18:58:17 +0100 Subject: [PATCH] fix: split getNonce interface --- __tests__/defaultProvider.test.ts | 2 +- src/account/default.ts | 2 +- src/provider/default.ts | 4 ++-- src/provider/interface.ts | 2 +- src/provider/rpc.ts | 2 +- src/provider/sequencer.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/__tests__/defaultProvider.test.ts b/__tests__/defaultProvider.test.ts index 4b051ba2d..3bbda0a17 100644 --- a/__tests__/defaultProvider.test.ts +++ b/__tests__/defaultProvider.test.ts @@ -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')); }); diff --git a/src/account/default.ts b/src/account/default.ts index 27e679815..aaf26d043 100644 --- a/src/account/default.ts +++ b/src/account/default.ts @@ -53,7 +53,7 @@ export class Account extends Provider implements AccountInterface { } public async getNonce(blockIdentifier?: BlockIdentifier): Promise { - return super.getNonce(this.address, blockIdentifier); + return super.getNonceForAddress(this.address, blockIdentifier); } public async estimateFee( diff --git a/src/provider/default.ts b/src/provider/default.ts index 2b85fc0c5..b38b1da99 100644 --- a/src/provider/default.ts +++ b/src/provider/default.ts @@ -104,11 +104,11 @@ export class Provider implements ProviderInterface { ); } - public async getNonce( + public async getNonceForAddress( contractAddress: string, blockIdentifier?: BlockIdentifier ): Promise { - return this.provider.getNonce(contractAddress, blockIdentifier); + return this.provider.getNonceForAddress(contractAddress, blockIdentifier); } public async getStorageAt( diff --git a/src/provider/interface.ts b/src/provider/interface.ts index e9b225c29..fd2cf7f08 100644 --- a/src/provider/interface.ts +++ b/src/provider/interface.ts @@ -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; diff --git a/src/provider/rpc.ts b/src/provider/rpc.ts index 9440b780a..b01068926 100644 --- a/src/provider/rpc.ts +++ b/src/provider/rpc.ts @@ -132,7 +132,7 @@ export class RpcProvider implements ProviderInterface { }); } - public async getNonce( + public async getNonceForAddress( contractAddress: string, blockIdentifier: BlockIdentifier = 'pending' ): Promise { diff --git a/src/provider/sequencer.ts b/src/provider/sequencer.ts index f416a2658..3395637b2 100644 --- a/src/provider/sequencer.ts +++ b/src/provider/sequencer.ts @@ -256,7 +256,7 @@ export class SequencerProvider implements ProviderInterface { ); } - public async getNonce( + public async getNonceForAddress( contractAddress: string, blockIdentifier: BlockIdentifier = 'pending' ): Promise {