@@ -29,7 +29,6 @@ import (
29
29
"github.com/ethereum/go-ethereum/core/types"
30
30
"github.com/ethereum/go-ethereum/crypto"
31
31
"github.com/ethereum/go-ethereum/params"
32
- "github.com/ethereum/go-ethereum/rpc"
33
32
)
34
33
35
34
func makeReceipt (addr common.Address ) * types.Receipt {
@@ -180,7 +179,7 @@ func TestFilters(t *testing.T) {
180
179
// Set block 998 as Finalized (-3)
181
180
rawdb .WriteFinalizedBlockHash (db , chain [998 ].Hash ())
182
181
183
- filter := sys .NewRangeFilter (0 , int64 ( rpc . LatestBlockNumber ) , []common.Address {addr }, [][]common.Hash {{hash1 , hash2 , hash3 , hash4 }})
182
+ filter := sys .NewRangeFilter (0 , - 1 , []common.Address {addr }, [][]common.Hash {{hash1 , hash2 , hash3 , hash4 }})
184
183
logs , _ := filter .Logs (context .Background ())
185
184
if len (logs ) != 4 {
186
185
t .Error ("expected 4 log, got" , len (logs ))
@@ -194,36 +193,34 @@ func TestFilters(t *testing.T) {
194
193
sys .NewRangeFilter (900 , 999 , []common.Address {addr }, [][]common.Hash {{hash3 }}),
195
194
[]common.Hash {hash3 },
196
195
}, {
197
- sys .NewRangeFilter (990 , int64 ( rpc . LatestBlockNumber ) , []common.Address {addr }, [][]common.Hash {{hash3 }}),
196
+ sys .NewRangeFilter (990 , - 1 , []common.Address {addr }, [][]common.Hash {{hash3 }}),
198
197
[]common.Hash {hash3 },
199
198
}, {
200
199
sys .NewRangeFilter (1 , 10 , nil , [][]common.Hash {{hash1 , hash2 }}),
201
200
[]common.Hash {hash1 , hash2 },
202
201
}, {
203
- sys .NewRangeFilter (0 , int64 ( rpc . LatestBlockNumber ) , nil , [][]common.Hash {{common .BytesToHash ([]byte ("fail" ))}}),
202
+ sys .NewRangeFilter (0 , - 1 , nil , [][]common.Hash {{common .BytesToHash ([]byte ("fail" ))}}),
204
203
nil ,
205
204
}, {
206
- sys .NewRangeFilter (0 , int64 ( rpc . LatestBlockNumber ) , []common.Address {common .BytesToAddress ([]byte ("failmenow" ))}, nil ),
205
+ sys .NewRangeFilter (0 , - 1 , []common.Address {common .BytesToAddress ([]byte ("failmenow" ))}, nil ),
207
206
nil ,
208
207
}, {
209
- sys .NewRangeFilter (0 , int64 ( rpc . LatestBlockNumber ) , nil , [][]common.Hash {{common .BytesToHash ([]byte ("fail" ))}, {hash1 }}),
208
+ sys .NewRangeFilter (0 , - 1 , nil , [][]common.Hash {{common .BytesToHash ([]byte ("fail" ))}, {hash1 }}),
210
209
nil ,
211
210
}, {
212
- sys .NewRangeFilter (int64 ( rpc . LatestBlockNumber ), int64 ( rpc . LatestBlockNumber ) , nil , nil ), []common.Hash {hash4 },
211
+ sys .NewRangeFilter (- 1 , - 1 , nil , nil ), []common.Hash {hash4 },
213
212
}, {
214
- sys .NewRangeFilter (int64 ( rpc . FinalizedBlockNumber ), int64 ( rpc . LatestBlockNumber ) , nil , nil ), []common.Hash {hash3 , hash4 },
213
+ sys .NewRangeFilter (- 3 , - 1 , nil , nil ), []common.Hash {hash3 , hash4 },
215
214
}, {
216
- sys .NewRangeFilter (int64 ( rpc . FinalizedBlockNumber ), int64 ( rpc . FinalizedBlockNumber ) , nil , nil ), []common.Hash {hash3 },
215
+ sys .NewRangeFilter (- 3 , - 3 , nil , nil ), []common.Hash {hash3 },
217
216
}, {
218
- sys .NewRangeFilter (int64 ( rpc . LatestBlockNumber ), int64 ( rpc . FinalizedBlockNumber ) , nil , nil ), nil ,
217
+ sys .NewRangeFilter (- 1 , - 3 , nil , nil ), nil ,
219
218
}, {
220
- sys .NewRangeFilter (int64 ( rpc . SafeBlockNumber ), int64 ( rpc . LatestBlockNumber ) , nil , nil ), nil ,
219
+ sys .NewRangeFilter (- 4 , - 1 , nil , nil ), nil ,
221
220
}, {
222
- sys .NewRangeFilter (int64 ( rpc . SafeBlockNumber ), int64 ( rpc . SafeBlockNumber ) , nil , nil ), nil ,
221
+ sys .NewRangeFilter (- 4 , - 4 , nil , nil ), nil ,
223
222
}, {
224
- sys .NewRangeFilter (int64 (rpc .LatestBlockNumber ), int64 (rpc .SafeBlockNumber ), nil , nil ), nil ,
225
- }, {
226
- sys .NewRangeFilter (int64 (rpc .PendingBlockNumber ), int64 (rpc .PendingBlockNumber ), nil , nil ), nil ,
223
+ sys .NewRangeFilter (- 1 , - 4 , nil , nil ), nil ,
227
224
},
228
225
} {
229
226
logs , _ := tc .f .Logs (context .Background ())
0 commit comments