Skip to content

Commit cae9a50

Browse files
committed
chore(contact-manager) Fix Fetch fees script
1 parent 29a60eb commit cae9a50

File tree

1 file changed

+6
-3
lines changed
  • contract_manager/src/contracts

1 file changed

+6
-3
lines changed

contract_manager/src/contracts/evm.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,15 @@ export class EvmPriceFeedContract extends PriceFeedContract {
639639
let web3: Web3;
640640
let amount = BigInt(0);
641641
try {
642-
web3 = this.chain.getViemDefaultWeb3();
643-
amount = BigInt(await web3.eth.getBalance(this.address));
644-
} catch (error) {
645642
// Fallback to regular web3 if viem default web3 fails
646643
web3 = this.chain.getWeb3();
647644
amount = BigInt(await web3.eth.getBalance(this.address));
645+
} catch (error) {
646+
console.error(
647+
"Error getting balance with given RPC, moving to viem default RPC",
648+
);
649+
web3 = this.chain.getViemDefaultWeb3();
650+
amount = BigInt(await web3.eth.getBalance(this.address));
648651
}
649652
return {
650653
amount,

0 commit comments

Comments
 (0)