From 540883429e6d2e1d1c9a1bf6fe95535a44adeea3 Mon Sep 17 00:00:00 2001 From: Matt Acciai Date: Fri, 6 Dec 2024 12:47:26 -0500 Subject: [PATCH] pass chainid to tx price oracle --- fundrebalancer/fundrebalancer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fundrebalancer/fundrebalancer.go b/fundrebalancer/fundrebalancer.go index d3e8a9e..708ba3b 100644 --- a/fundrebalancer/fundrebalancer.go +++ b/fundrebalancer/fundrebalancer.go @@ -775,9 +775,15 @@ func (r *FundRebalancer) isGasAcceptable(ctx context.Context, txn SkipGoTxnWithM return false, "", fmt.Errorf("getting chain fund rebalancing config: %w", err) } + chainIDBigInt, ok := new(big.Int).SetString(chainID, 10) + if !ok { + return false, "", fmt.Errorf("could not convert chainID %s to *big.Int", chainID) + } + gasCostUUSDC, err := r.txPriceOracle.TxFeeUUSDC(ctx, types.NewTx(&types.DynamicFeeTx{ Gas: txn.gasEstimate, GasFeeCap: gasPrice, + ChainID: chainIDBigInt, })) if err != nil { return false, "", fmt.Errorf("calculating total fund rebalancing gas cost in UUSDC: %w", err)