@@ -3,7 +3,6 @@ package ingestion
33import (
44 "context"
55 "encoding/hex"
6- "encoding/json"
76 "math/big"
87 "testing"
98
@@ -53,8 +52,6 @@ func TestSerialBlockIngestion(t *testing.T) {
5352 }).
5453 Once () // make sure this isn't called multiple times
5554
56- traces := & storageMock.TraceIndexer {}
57-
5855 eventsChan := make (chan models.BlockEvents )
5956
6057 subscriber := & mocks.EventSubscriber {}
@@ -66,13 +63,12 @@ func TestSerialBlockIngestion(t *testing.T) {
6663
6764 engine := NewEventIngestionEngine (
6865 subscriber ,
69- replayer .NewBlocksProvider (blocks , flowGo .Emulator , nil ),
66+ replayer .NewBlocksProvider (blocks , flowGo .Emulator ),
7067 store ,
7168 registerStore ,
7269 blocks ,
7370 receipts ,
7471 transactions ,
75- traces ,
7672 models .NewPublisher [* models.Block ](),
7773 models .NewPublisher [[]* gethTypes.Log ](),
7874 zerolog .Nop (),
@@ -133,8 +129,6 @@ func TestSerialBlockIngestion(t *testing.T) {
133129 }).
134130 Once () // make sure this isn't called multiple times
135131
136- traces := & storageMock.TraceIndexer {}
137-
138132 eventsChan := make (chan models.BlockEvents )
139133 subscriber := & mocks.EventSubscriber {}
140134 subscriber .
@@ -145,13 +139,12 @@ func TestSerialBlockIngestion(t *testing.T) {
145139
146140 engine := NewEventIngestionEngine (
147141 subscriber ,
148- replayer .NewBlocksProvider (blocks , flowGo .Emulator , nil ),
142+ replayer .NewBlocksProvider (blocks , flowGo .Emulator ),
149143 store ,
150144 registerStore ,
151145 blocks ,
152146 receipts ,
153147 transactions ,
154- traces ,
155148 models .NewPublisher [* models.Block ](),
156149 models .NewPublisher [[]* gethTypes.Log ](),
157150 zerolog .Nop (),
@@ -256,23 +249,14 @@ func TestBlockAndTransactionIngestion(t *testing.T) {
256249 blockCdc , block , blockEvent , err := newBlock (nextHeight , []gethCommon.Hash {result .TxHash })
257250 require .NoError (t , err )
258251
259- traces := & storageMock.TraceIndexer {}
260- traces .
261- On ("StoreTransaction" , mock .AnythingOfType ("common.Hash" ), mock .AnythingOfType ("json.RawMessage" ), mock .Anything ).
262- Return (func (txID gethCommon.Hash , trace json.RawMessage , batch * pebbleDB.Batch ) error {
263- assert .Equal (t , transaction .Hash (), txID )
264- return nil
265- })
266-
267252 engine := NewEventIngestionEngine (
268253 subscriber ,
269- replayer .NewBlocksProvider (blocks , flowGo .Emulator , nil ),
254+ replayer .NewBlocksProvider (blocks , flowGo .Emulator ),
270255 store ,
271256 registerStore ,
272257 blocks ,
273258 receipts ,
274259 transactions ,
275- traces ,
276260 models .NewPublisher [* models.Block ](),
277261 models .NewPublisher [[]* gethTypes.Log ](),
278262 zerolog .Nop (),
@@ -359,28 +343,19 @@ func TestBlockAndTransactionIngestion(t *testing.T) {
359343 return eventsChan
360344 })
361345
362- txCdc , txEvent , transaction , res , err := newTransaction (nextHeight )
346+ txCdc , txEvent , _ , res , err := newTransaction (nextHeight )
363347 require .NoError (t , err )
364348 blockCdc , _ , blockEvent , err := newBlock (nextHeight , []gethCommon.Hash {res .TxHash })
365349 require .NoError (t , err )
366350
367- traces := & storageMock.TraceIndexer {}
368- traces .
369- On ("StoreTransaction" , mock .AnythingOfType ("common.Hash" ), mock .AnythingOfType ("json.RawMessage" ), mock .Anything ).
370- Return (func (txID gethCommon.Hash , trace json.RawMessage , batch * pebbleDB.Batch ) error {
371- assert .Equal (t , transaction .Hash (), txID )
372- return nil
373- })
374-
375351 engine := NewEventIngestionEngine (
376352 subscriber ,
377- replayer .NewBlocksProvider (blocks , flowGo .Emulator , nil ),
353+ replayer .NewBlocksProvider (blocks , flowGo .Emulator ),
378354 store ,
379355 registerStore ,
380356 blocks ,
381357 receipts ,
382358 transactions ,
383- traces ,
384359 models .NewPublisher [* models.Block ](),
385360 models .NewPublisher [[]* gethTypes.Log ](),
386361 zerolog .Nop (),
@@ -455,8 +430,6 @@ func TestBlockAndTransactionIngestion(t *testing.T) {
455430 }).
456431 Once () // make sure this isn't called multiple times
457432
458- traces := & storageMock.TraceIndexer {}
459-
460433 eventsChan := make (chan models.BlockEvents )
461434 subscriber := & mocks.EventSubscriber {}
462435 subscriber .
@@ -468,13 +441,12 @@ func TestBlockAndTransactionIngestion(t *testing.T) {
468441
469442 engine := NewEventIngestionEngine (
470443 subscriber ,
471- replayer .NewBlocksProvider (blocks , flowGo .Emulator , nil ),
444+ replayer .NewBlocksProvider (blocks , flowGo .Emulator ),
472445 store ,
473446 registerStore ,
474447 blocks ,
475448 receipts ,
476449 transactions ,
477- traces ,
478450 models .NewPublisher [* models.Block ](),
479451 models .NewPublisher [[]* gethTypes.Log ](),
480452 zerolog .Nop (),
@@ -517,13 +489,6 @@ func TestBlockAndTransactionIngestion(t *testing.T) {
517489 Return (func (receipts []* models.Receipt , _ * pebbleDB.Batch ) error { return nil }).
518490 Once ()
519491
520- traces .
521- On ("StoreTransaction" , mock .AnythingOfType ("common.Hash" ), mock .AnythingOfType ("json.RawMessage" ), mock .Anything ).
522- Return (func (txID gethCommon.Hash , trace json.RawMessage , batch * pebbleDB.Batch ) error {
523- assert .Equal (t , transaction .Hash (), txID )
524- return nil
525- })
526-
527492 events = append (events , flow.Event {
528493 Type : string (txEvent .Etype ),
529494 Value : txCdc ,
@@ -628,10 +593,9 @@ func newTransaction(height uint64) (cadence.Event, *events.Event, models.Transac
628593
629594func defaultReplayerConfig () replayer.Config {
630595 return replayer.Config {
631- ChainID : flowGo .Emulator ,
632- RootAddr : evm .StorageAccountAddress (flowGo .Emulator ),
633- CallTracerCollector : replayer .NopTracer ,
634- ValidateResults : false ,
596+ ChainID : flowGo .Emulator ,
597+ RootAddr : evm .StorageAccountAddress (flowGo .Emulator ),
598+ ValidateResults : false ,
635599 }
636600}
637601
0 commit comments