Documentation ¶
Overview ¶
Package backends provides different kinds of backends you can test against that conform to a common interface thesse allow you to test eth functionality against a variety of backends
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthType ¶
type AuthType struct { // transaction options *bind.TransactOpts // PrivateKey used for the tx PrivateKey *ecdsa.PrivateKey }
AuthType is the type used for authentication.
type ContractVerifier ¶
type ContractVerifier interface {
VerifyContract(contractType contracts.ContractType, contract contracts.DeployedContract) error
}
ContractVerifier is a hook used to verify contracts with a test provider.
type SimulatedTestBackend ¶
type SimulatedTestBackend interface { // BackendName gets the name of the backend BackendName() string // T is the testing.T T() *testing.T // SetT sets the testing.T SetT(t *testing.T) // Manager is used for concurrent signing while generating nonce nonce.Manager // ContractVerifier are contract verification hooks ContractVerifier // WaitForConfirmation waits for a tx confirmation WaitForConfirmation(ctx context.Context, transaction *types.Transaction) // FundAccount funds an account address with an amount amount FundAccount(ctx context.Context, address common.Address, amount big.Int) // GetTxContext gets a signed transaction. If the address is `nil`, will fund a new account. GetTxContext(ctx context.Context, address *common.Address) (auth AuthType) // GetFundedAccount gets a funded account with requestBalance GetFundedAccount(ctx context.Context, requestBalance *big.Int) *keystore.Key // Chain is the Chain //nolint:staticcheck chain.Chain // Signer is the signer for the chain Signer() types.Signer // ImpersonateAccount impersonates an account. This is only supported on the anvil backend backends. ImpersonateAccount(ctx context.Context, address common.Address, transact func(opts *bind.TransactOpts) *types.Transaction) error // EVM is the evm client client.EVM // Store stores an account Store(key *keystore.Key) }
SimulatedTestBackend is a strict subset of TestBackend that all backends must comply with. TODO: we need one of these for testnets so we can run e2e tests. This should source addresses from a single address.
Directories ¶
Path | Synopsis |
---|---|
Package anvil is an anvil test backend.
|
Package anvil is an anvil test backend. |
Package base contains a common interface to be used by multiple backends.
|
Package base contains a common interface to be used by multiple backends. |
Package geth handles creating mock geth clients and simulated backends
|
Package geth handles creating mock geth clients and simulated backends |
Package preset defines preset backends that can be used to create backends of different types
|
Package preset defines preset backends that can be used to create backends of different types |
Package simulated represents a simulated backend.
|
Package simulated represents a simulated backend. |
multibackend
Package multibackend contains a copy of https://github.com/ethereum/go-ethereum/blob/master/accounts/abi/bind/backends/simulated.go that allows use with multiple chains by exporting new methods.
|
Package multibackend contains a copy of https://github.com/ethereum/go-ethereum/blob/master/accounts/abi/bind/backends/simulated.go that allows use with multiple chains by exporting new methods. |
Click to show internal directories.
Click to hide internal directories.