Skip to content

Commit

Permalink
fix callopts
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed May 17, 2024
1 parent 951176b commit 34b87cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions op-chain-ops/cmd/check-fjord/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func sendTxAndCheckFees(ctx context.Context, env *actionEnv, to *common.Address,
return fmt.Errorf("executing tx: %w", err)
}
blockHash := tx.receipt.BlockHash
opts := &bind.CallOpts{BlockHash: blockHash}
txUnsigned, err := tx.unsigned.MarshalBinary()
if err != nil {
return fmt.Errorf("binary-encoding unsigned tx: %w", err)
Expand All @@ -299,15 +300,15 @@ func sendTxAndCheckFees(ctx context.Context, env *actionEnv, to *common.Address,
"block_hash", blockHash,
)

gpoL1GasUsed, err := gasPriceOracle.GetL1GasUsed(&bind.CallOpts{}, txUnsigned)
gpoL1GasUsed, err := gasPriceOracle.GetL1GasUsed(opts, txUnsigned)
if err != nil {
return fmt.Errorf("calling GasPriceOracle.GetL1GasUsed: %w", err)
}

env.log.Info("retrieved L1 gas used", "gpoL1GasUsed", gpoL1GasUsed.Uint64())

// Check that GetL1Fee takes into account fast LZ
gpoFee, err := gasPriceOracle.GetL1Fee(&bind.CallOpts{}, txUnsigned)
gpoFee, err := gasPriceOracle.GetL1Fee(opts, txUnsigned)
if err != nil {
return fmt.Errorf("calling GasPriceOracle.GetL1Fee: %w", err)
}
Expand All @@ -331,7 +332,7 @@ func sendTxAndCheckFees(ctx context.Context, env *actionEnv, to *common.Address,
env.log.Info("gethFee matches receipt fee")

// Check that L1FeeUpperBound works
upperBound, err := gasPriceOracle.GetL1FeeUpperBound(&bind.CallOpts{}, big.NewInt(int64(len(txUnsigned))))
upperBound, err := gasPriceOracle.GetL1FeeUpperBound(opts, big.NewInt(int64(len(txUnsigned))))
if err != nil {
return fmt.Errorf("failed when calling GasPriceOracle.GetL1FeeUpperBound function: %w", err)
}
Expand Down

0 comments on commit 34b87cd

Please sign in to comment.