diff --git a/api/debug.go b/api/debug.go index 50876717..e2551344 100644 --- a/api/debug.go +++ b/api/debug.go @@ -178,7 +178,9 @@ func (d *DebugAPI) TraceCall( blocksProvider := requester.NewOverridableBlocksProvider( d.blocks, d.config.FlowNetworkID, - ).WithTracer(tracer) + tracer, + ) + if config.BlockOverrides != nil { blocksProvider = blocksProvider.WithBlockOverrides(ðTypes.BlockOverrides{ Number: config.BlockOverrides.Number, diff --git a/services/requester/overridable_blocks_provider.go b/services/requester/overridable_blocks_provider.go index 1c7582a7..3976aa8d 100644 --- a/services/requester/overridable_blocks_provider.go +++ b/services/requester/overridable_blocks_provider.go @@ -81,19 +81,12 @@ var _ evmTypes.BlockSnapshotProvider = (*OverridableBlocksProvider)(nil) func NewOverridableBlocksProvider( blocks storage.BlockIndexer, chainID flowGo.ChainID, + tracer *tracers.Tracer, ) *OverridableBlocksProvider { return &OverridableBlocksProvider{ blocks: blocks, chainID: chainID, - } -} - -func (bp *OverridableBlocksProvider) WithTracer(tracer *tracers.Tracer) *OverridableBlocksProvider { - return &OverridableBlocksProvider{ - blocks: bp.blocks, - chainID: bp.chainID, - tracer: tracer, - blockOverrides: bp.blockOverrides, + tracer: tracer, } } diff --git a/services/requester/requester.go b/services/requester/requester.go index 9ec3abc4..bb07ef55 100644 --- a/services/requester/requester.go +++ b/services/requester/requester.go @@ -440,7 +440,11 @@ func (e *EVM) getBlockView( height uint64, blockOverrides *ethTypes.BlockOverrides, ) (*query.View, error) { - blocksProvider := NewOverridableBlocksProvider(e.blocks, e.config.FlowNetworkID) + blocksProvider := NewOverridableBlocksProvider( + e.blocks, + e.config.FlowNetworkID, + nil, + ) if blockOverrides != nil { blocksProvider = blocksProvider.WithBlockOverrides(blockOverrides)