diff --git a/packages/harmony-account/src/account.ts b/packages/harmony-account/src/account.ts index 1308619..df1dc0f 100644 --- a/packages/harmony-account/src/account.ts +++ b/packages/harmony-account/src/account.ts @@ -162,7 +162,6 @@ class Account { async updateBalances(blockNumber: string = 'latest'): Promise { // this.messenger.setShardingProviders(); const shardProviders = this.messenger.shardProviders; - if (shardProviders.size > 1) { for (const [name, val] of shardProviders) { const balanceObject = await this.getShardBalance(val.shardID, blockNumber); @@ -248,12 +247,14 @@ class Account { this.messenger.chainPrefix, shardID, ); + const nonce = await this.messenger.send( RPCMethod.GetTransactionCount, [this.address, blockNumber], this.messenger.chainPrefix, shardID, ); + if (balance.isError()) { throw balance.error.message; } diff --git a/packages/harmony-network/src/messenger/messenger.ts b/packages/harmony-network/src/messenger/messenger.ts index 0aae817..61fccef 100644 --- a/packages/harmony-network/src/messenger/messenger.ts +++ b/packages/harmony-network/src/messenger/messenger.ts @@ -70,7 +70,7 @@ class Messenger extends HarmonyCore { // set shardingProviders this.shardProviders = new Map(); - this.setShardingProviders(); + // this.setShardingProviders(); } get currentShard(): number | undefined { return this.getCurrentShardID(); @@ -266,6 +266,7 @@ class Messenger extends HarmonyCore { } try { const response = await this.send(RPCMethod.GetShardingStructure, [], this.chainPrefix); + if (response.result) { const shardingStructures: ShardingItem[] = response.result; for (const shard of shardingStructures) {