Skip to content

Commit b87befd

Browse files
author
StreamingFast Agent
committed
Move to Firehose Shared Tracer
1 parent 6cf2f05 commit b87befd

File tree

19 files changed

+1126
-4383
lines changed

19 files changed

+1126
-4383
lines changed

eth/tracers/api_ext.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func (api *API) traceFirehoseBlock(ctx context.Context, block *types.Block, conf
5858
FlushToTestBuffer: true,
5959
},
6060
})
61-
hooks := NewTracingHooksFromFirehose(firehoseTracer)
62-
firehoseTracer.OnBlockchainInit(api.backend.ChainConfig())
61+
hooks := firehoseTracer.TracingHooks()
62+
hooks.OnBlockchainInit(api.backend.ChainConfig())
6363

6464
if block.NumberU64() == 0 {
6565
alloc, err := getGenesisState(api.backend.ChainDb(), block.Hash())
@@ -69,7 +69,7 @@ func (api *API) traceFirehoseBlock(ctx context.Context, block *types.Block, conf
6969
if alloc == nil {
7070
return nil, errors.New("genesis allocation not found")
7171
}
72-
firehoseTracer.OnGenesisBlock(block, alloc)
72+
hooks.OnGenesisBlock(block, alloc)
7373
} else {
7474
// Prepare base state
7575
parent, err := api.blockByNumberAndHash(ctx, rpc.BlockNumber(block.NumberU64()-1), block.ParentHash())
@@ -114,11 +114,12 @@ func (api *API) traceFirehoseBlock(ctx context.Context, block *types.Block, conf
114114
hooks.OnBlockEnd(nil)
115115
}
116116

117-
if firehoseTracer.testingBuffer == nil {
117+
outputBuffer := firehoseTracer.GetTestingOutputBuffer()
118+
if outputBuffer == nil {
118119
return nil, errors.New("testing buffer is not available")
119120
}
120121

121-
respStr := firehoseTracer.testingBuffer.String()
122+
respStr := outputBuffer.String()
122123
lines := strings.Split(respStr, "\n")
123124

124125
var fireBlockLine string

0 commit comments

Comments
 (0)