Commit 96a92df3 authored by inphi's avatar inphi

op-e2e: wait for observed seq reorg in TestMissingBatchE2E

parent 7fd1e5d0
......@@ -393,6 +393,9 @@ func TestMissingBatchE2E(t *testing.T) {
l2Seq := sys.Clients["sequencer"]
l2Verif := sys.Clients["verifier"]
seqRollupRPCClient, err := rpc.DialContext(context.Background(), sys.RollupNodes["sequencer"].HTTPEndpoint())
require.Nil(t, err)
seqRollupClient := sources.NewRollupClient(client.NewBaseRPCClient(seqRollupRPCClient))
// Transactor Account
ethPrivKey := cfg.Secrets.Alice
......@@ -414,8 +417,8 @@ func TestMissingBatchE2E(t *testing.T) {
require.Equal(t, ethereum.NotFound, err, "Found transaction in verifier when it should not have been included")
// Wait a short time for the L2 reorg to occur on the sequencer as well.
// The proper thing to do is to wait until the sequencer marks this block safe.
<-time.After(2 * time.Second)
err = waitForSafeHead(ctx, receipt.BlockNumber.Uint64(), seqRollupClient)
require.Nil(t, err, "timeout waiting for L2 reorg on sequencer safe head")
// Assert that the reconciliation process did an L2 reorg on the sequencer to remove the invalid block
ctx2, cancel := context.WithTimeout(context.Background(), time.Second)
......
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