Skip to content

internal/ethapi/api_test.go

Type MOD
Upstream Lines 4199
Changed +6 -0

Adapt ethapi tests for the TD-aware block marshaling

diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go
index 161d97b4e..b7d9ce23a 100644
--- a/internal/ethapi/api_test.go
+++ b/internal/ethapi/api_test.go
@@ -596,6 +596,12 @@ func (b testBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.R
    receipts := rawdb.ReadReceipts(b.db, hash, header.Number.Uint64(), header.Time, b.chain.Config())
    return receipts, nil
 }
+func (b testBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
+   if b.pending != nil && hash == b.pending.Hash() {
+       return nil
+   }
+   return big.NewInt(1)
+}
 func (b testBackend) GetEVM(ctx context.Context, state *state.StateDB, header *types.Header, vmConfig *vm.Config, blockContext *vm.BlockContext) *vm.EVM {
    if vmConfig == nil {
        vmConfig = b.chain.GetVMConfig()

← Back to RPC & API