Skip to content

Commit

Permalink
pass chainid to tx price oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
mattac21 committed Dec 6, 2024
1 parent b4f08e5 commit 5408834
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fundrebalancer/fundrebalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5408834

Please sign in to comment.