From 37b87242bf9f3308b38441e168215a66b3a35370 Mon Sep 17 00:00:00 2001 From: Mike Weyandt Date: Sun, 16 Mar 2025 21:43:24 -0400 Subject: [PATCH] eth/catalyst: Fix success condition for TestSimulatedBeaconSendWithdrawals --- eth/catalyst/simulated_beacon_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eth/catalyst/simulated_beacon_test.go b/eth/catalyst/simulated_beacon_test.go index ea35482896..6ad2c32fa7 100644 --- a/eth/catalyst/simulated_beacon_test.go +++ b/eth/catalyst/simulated_beacon_test.go @@ -119,6 +119,7 @@ func TestSimulatedBeaconSendWithdrawals(t *testing.T) { includedTxs := make(map[common.Hash]struct{}) var includedWithdrawals []uint64 + lastHeaderNumber := big.NewInt(0) timer := time.NewTimer(12 * time.Second) for { @@ -131,12 +132,13 @@ func TestSimulatedBeaconSendWithdrawals(t *testing.T) { for _, includedWithdrawal := range block.Withdrawals() { includedWithdrawals = append(includedWithdrawals, includedWithdrawal.Index) } - // ensure all withdrawals/txs included. this will take two blocks b/c number of withdrawals > 10 - if len(includedTxs) == len(txs) && len(includedWithdrawals) == len(withdrawals) && ev.Header.Number.Cmp(big.NewInt(2)) == 0 { + lastHeaderNumber = ev.Header.Number + // ensure all withdrawals/txs included. this will take at least two blocks b/c number of withdrawals > 10 + if len(includedTxs) == len(txs) && len(includedWithdrawals) == len(withdrawals) && ev.Header.Number.Cmp(big.NewInt(1)) == 1 { return } case <-timer.C: - t.Fatal("timed out without including all withdrawals/txs") + t.Fatalf("timed out without including all withdrawals/txs, includedTxs len = %d, includedWithdrawls = %d, lastHeaderNumber = %d", len(includedTxs), len(includedWithdrawals), lastHeaderNumber) } } }