Ver código fonte

chore(contact-manager) Fix Fetch fees script (#2544)

Aditya Arora 7 meses atrás
pai
commit
ee6dcf6d56
1 arquivos alterados com 5 adições e 3 exclusões
  1. 5 3
      contract_manager/src/contracts/evm.ts

+ 5 - 3
contract_manager/src/contracts/evm.ts

@@ -639,11 +639,13 @@ export class EvmPriceFeedContract extends PriceFeedContract {
     let web3: Web3;
     let amount = BigInt(0);
     try {
-      web3 = this.chain.getViemDefaultWeb3();
+      web3 = this.chain.getWeb3();
       amount = BigInt(await web3.eth.getBalance(this.address));
     } catch (error) {
-      // Fallback to regular web3 if viem default web3 fails
-      web3 = this.chain.getWeb3();
+      console.error(
+        "Error getting balance with given RPC, moving to viem default RPC",
+      );
+      web3 = this.chain.getViemDefaultWeb3();
       amount = BigInt(await web3.eth.getBalance(this.address));
     }
     return {