ethclient: serialize negative block number as "pending" #21177 (#1364)

This commit is contained in:
Daniel Liu 2025-08-21 13:42:29 +08:00 committed by GitHub
parent 917baceda8
commit f214dd6d51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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{