Skip to content

Commit

Permalink
Merge pull request ethereum#28 from OffchainLabs/fix-merge
Browse files Browse the repository at this point in the history
Fix APIBackend geth interface implementation
  • Loading branch information
PlasmaPower committed Dec 14, 2021
2 parents c4b5b25 + 11b53a0 commit 1bdde5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arbitrum/apibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func (a *APIBackend) RPCTxFeeCap() float64 {
return a.b.config.RPCTxFeeCap
}

func (a *APIBackend) RPCEVMTimeout() time.Duration {
return a.b.config.RPCEVMTimeout
}

func (a *APIBackend) UnprotectedAllowed() bool {
return true // TODO: is that true?
}
Expand Down Expand Up @@ -179,7 +183,10 @@ func (a *APIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.R
}

func (a *APIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
return a.blockChain().GetTdByHash(hash)
if header := a.blockChain().GetHeaderByHash(hash); header != nil {
return a.blockChain().GetTd(hash, header.Number.Uint64())
}
return nil
}

func (a *APIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmConfig *vm.Config) (*vm.EVM, func() error, error) {
Expand Down
4 changes: 4 additions & 0 deletions arbitrum/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package arbitrum

import (
"context"
"time"

"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
Expand Down Expand Up @@ -32,6 +33,9 @@ type Config struct {
// RPCTxFeeCap is the global transaction fee(price * gaslimit) cap for
// send-transction variants. The unit is ether.
RPCTxFeeCap float64

// RPCEVMTimeout is the global timeout for eth-call.
RPCEVMTimeout time.Duration
}

var DefaultConfig = Config{
Expand Down

0 comments on commit 1bdde5b

Please sign in to comment.