Commit 9d0433c6 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge pull request #8622 from ethereum-optimism/bugfix/mint-on-reverted-deposit

op-e2e: Use wait for balance helper in TestMintOnRevertedDeposit
parents 38b56367 fb861b8e
......@@ -6,6 +6,8 @@ import (
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
......@@ -51,14 +53,15 @@ func TestMintOnRevertedDeposit(t *testing.T) {
})
// Confirm balance
ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second)
endBalance, err := l2Verif.BalanceAt(ctx, fromAddr, nil)
ctx, cancel = context.WithTimeout(context.Background(), 15*time.Second)
endBalance, err := wait.ForBalanceChange(ctx, l2Verif, fromAddr, startBalance)
cancel()
require.Nil(t, err)
ctx, cancel = context.WithTimeout(context.Background(), 1*time.Second)
toAddrBalance, err := l2Verif.BalanceAt(ctx, toAddr, nil)
require.NoError(t, err)
cancel()
require.NoError(t, err)
diff := new(big.Int)
diff = diff.Sub(endBalance, startBalance)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment