Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Oct 31, 2024
1 parent 8f206d3 commit a46f904
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions packages/eth-providers/src/base-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ export abstract class BaseProvider extends AbstractProvider {
).length;
}

const accountInfo = await this.queryAccountInfo(addressOrName, blockTag);
const minedNonce = accountInfo?.nonce?.toNumber?.() ?? 0;
const evmAccountInfo = await this.queryEvmAccountInfo(addressOrName, blockTag);
const minedNonce = evmAccountInfo?.nonce?.toNumber?.() ?? 0;

return minedNonce + pendingNonce;
};
Expand All @@ -716,8 +716,8 @@ export abstract class BaseProvider extends AbstractProvider {
const blockTag = await this._ensureSafeModeBlockTagFinalization(await parseBlockTag(_blockTag));
const blockHash = await this._getBlockHash(blockTag);

const accountInfo = await this.queryAccountInfo(addressOrName, blockHash);
const contractInfo = accountInfo?.contractInfo.unwrapOr(null);
const evmAccountInfo = await this.queryEvmAccountInfo(addressOrName, blockHash);
const contractInfo = evmAccountInfo?.contractInfo.unwrapOr(null);
if (!contractInfo) { return '0x'; }

const apiAt = await this.api.at(blockHash);
Expand Down Expand Up @@ -1118,7 +1118,7 @@ export abstract class BaseProvider extends AbstractProvider {
return getAddress(evmAddress.isEmpty ? computeDefaultEvmAddress(substrateAddress) : evmAddress.toString());
};

queryAccountInfo = async (
queryEvmAccountInfo = async (
addressOrName: string | Promise<string>,
_blockTag?: BlockTag | Promise<BlockTag> | Eip1898BlockTag
): Promise<ModuleEvmModuleAccountInfo | null> => {
Expand Down
4 changes: 1 addition & 3 deletions packages/eth-rpc-adapter/src/wrapped-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const TRACE_METHODS = [
'_onNewHead',
'_onNewFinalizedHead',
'_notifySubscribers',
'queryStorage',
'getNetwork',
'getBlockNumber',
'getBlockData',
Expand All @@ -26,8 +25,7 @@ const TRACE_METHODS = [
'estimateResources',
'getSubstrateAddress',
'getEvmAddress',
'queryAccountInfo',
'queryContractInfo',
'queryEvmAccountInfo',
'prepareTransaction',
'sendRawTransaction',
'sendTransaction',
Expand Down

0 comments on commit a46f904

Please sign in to comment.