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

Fixes #21175

Co-authored-by: sammy007 <sammy007@users.noreply.github.com>
Co-authored-by: Adam Schmideg <adamschmideg@users.noreply.github.com>
This commit is contained in:
Sammy Libre
2020-07-21 13:51:15 +05:00
committed by GitHub
parent 4366c45e4e
commit 7163a6664e
4 changed files with 30 additions and 12 deletions

View File

@ -97,6 +97,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{