From f214dd6d51dc2d07165d651d9ec11f2a0c0f75f7 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Thu, 21 Aug 2025 13:42:29 +0800 Subject: [PATCH] ethclient: serialize negative block number as "pending" #21177 (#1364) --- ethclient/ethclient_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index e9e5055e6c..606dd1131b 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -86,6 +86,22 @@ func TestToFilterArg(t *testing.T) { }, nil, }, + { + "with negative fromBlock and negative toBlock", + ethereum.FilterQuery{ + Addresses: addresses, + FromBlock: big.NewInt(-1), + ToBlock: big.NewInt(-1), + Topics: [][]common.Hash{}, + }, + map[string]interface{}{ + "address": addresses, + "fromBlock": "pending", + "toBlock": "pending", + "topics": [][]common.Hash{}, + }, + nil, + }, { "with blockhash", ethereum.FilterQuery{