accounts/abi/bind/backends: use new interfaces

This commit is contained in:
Felix Lange 2023-12-05 18:33:26 +01:00 committed by Marius van der Wijden
parent e8d658b186
commit 2af45491ae

View file

@ -19,7 +19,6 @@ package backends
import ( import (
"context" "context"
"math" "math"
"math/big"
"time" "time"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
@ -58,30 +57,25 @@ type SimChainManagement interface {
Close() error Close() error
} }
// TODO: these methods should have their own interface in the ethereum package.
type SimChainExtras interface {
BlockNumber(context.Context) (uint64, error)
ChainID(context.Context) (*big.Int, error)
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
}
// SimulatedBackend all interfaces in the ethereum package, but is based on a // SimulatedBackend all interfaces in the ethereum package, but is based on a
// simulated blockchain. It is intended for testing purposes. // simulated blockchain. It is intended for testing purposes.
type SimulatedBackend interface { type SimulatedBackend interface {
SimChainManagement SimChainManagement
// The backend implements all interfaces in the ethereum package. // The backend implements all interfaces in the ethereum package.
ethereum.BlockNumberReader
ethereum.ChainReader ethereum.ChainReader
ethereum.ChainStateReader ethereum.ChainStateReader
ethereum.ContractCaller ethereum.ContractCaller
ethereum.GasEstimator ethereum.GasEstimator
ethereum.LogFilterer
ethereum.GasPricer ethereum.GasPricer
ethereum.GasPricer1559
ethereum.LogFilterer
ethereum.PendingStateReader ethereum.PendingStateReader
ethereum.PendingContractCaller ethereum.PendingContractCaller
ethereum.TransactionReader ethereum.TransactionReader
ethereum.TransactionSender ethereum.TransactionSender
SimChainExtras ethereum.ChainIDReader
} }
type simBackend struct { type simBackend struct {