浏览代码

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

Aditya Arora 7 月之前
父节点
当前提交
ee6dcf6d56
共有 1 个文件被更改,包括 5 次插入3 次删除
  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 {