op-e2e: Fix bug in TestWithdrawals
The existing TestWithdrawals test attempts to assert that the total fees of the prove and finalize transactions are accounted for in the L1 balance. But, it re-uses the `calcGasFees` function and passes in the `GasTipCap` and the `GasFeeCap` from the L2 transaction, not from the actual L1 transactions. In the event that the gas fee differs on the L2 from the L1, then the test will fail. To keep the diff small, this change simply multiplies the GasUsed and `EffectiveGasPrice` from the receipts. This could be moved into a helper function like `calcGasFees`. Using the `EffectiveGasPrice` seems just as good or better than relying on the parameters of the original transaction, and could be similarly utilized higher in the test for the L2 fees. If we really want to get the parameters from the tx, then `ProveAndFinalizeWithdrawal` would need to be modified to return the txes.
Showing
Please register or sign in to comment