From c95bf8daf7fd326b4daf636e4595b854d6ccbe0c Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 25 Jul 2023 10:50:10 +0800 Subject: [PATCH] eth/filters: add reason for check with balance instead of logs Signed-off-by: jsvisa --- eth/filters/filter_system_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index 893d321e06..1d610dd539 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -992,6 +992,9 @@ func TestLogsSubscriptionReorg(t *testing.T) { expected = append(expected, liveLogs...) // Calculate address balances + // We check with the balance instead of logs because there is a gap between the ChainReorg occurred and detected, + // so we can't fully control how many logs we'll receive. + // By checking the balance, we can test with the token transfer amount. balanceDiffer := func(logs []*types.Log) map[common.Address]uint64 { balances := make(map[common.Address]uint64) for _, log := range logs {