Documentation ¶
Overview ¶
Package base contains a common interface to be used by multiple backends. This is kept in a separate package because of the overhead of different backends
Index ¶
- Variables
- func MockAccount(t *testing.T) *keystore.Key
- func WaitForConfirmation(ctx context.Context, client ConfirmationClient, transaction *types.Transaction, ...)
- type Backend
- func (b *Backend) Client() client.EVMClient
- func (b *Backend) Context() context.Context
- func (b *Backend) EnableTenderly() bool
- func (b *Backend) MockAccount() *keystore.Key
- func (b *Backend) SetT(t *testing.T)
- func (b *Backend) T() *testing.T
- func (b *Backend) VerifyContract(contractType contracts.ContractType, contract contracts.DeployedContract) (resError error)
- func (b *Backend) WaitForConfirmation(parentCtx context.Context, transaction *types.Transaction)
- type ConfirmationClient
- type InMemoryKeyStore
Constants ¶
This section is empty.
Variables ¶
var EnableLocalDebug = os.Getenv("CI") == ""
EnableLocalDebug enables local tx debugging. It is exported so it can be disabled and disabled by default to speed up the ci. Note: there's currently a bug causing this to fail if tenderly is disabled.
Functions ¶
func MockAccount ¶ added in v0.0.2
MockAccount creates a new mock account. TODO: dry this up w/ mocks.
func WaitForConfirmation ¶
func WaitForConfirmation(ctx context.Context, client ConfirmationClient, transaction *types.Transaction, timeout time.Duration)
WaitForConfirmation is a helper that can be called by various inheriting funcs. it blocks until the transaction is confirmed.
Types ¶
type Backend ¶
type Backend struct { // chain is the chain to be used by the backend chain.Chain // Manager is the nonce manager nonce.Manager // contains filtered or unexported fields }
Backend contains common functions across backends and can be used to extend a backend.
func NewBaseBackend ¶
NewBaseBackend creates a new base backend. nolint: staticcheck
func (*Backend) EnableTenderly ¶
EnableTenderly turns on tenderly on the full chain.
func (*Backend) MockAccount ¶ added in v0.0.2
MockAccount creates a new mock account.
func (*Backend) VerifyContract ¶
func (b *Backend) VerifyContract(contractType contracts.ContractType, contract contracts.DeployedContract) (resError error)
VerifyContract calls the contract verification hook (e.g. tenderly).
func (*Backend) WaitForConfirmation ¶
func (b *Backend) WaitForConfirmation(parentCtx context.Context, transaction *types.Transaction)
WaitForConfirmation waits for transaction confirmation.
type ConfirmationClient ¶
type ConfirmationClient interface { ethereum.TransactionReader ethereum.TransactionSender }
ConfirmationClient waits for confirmation.
type InMemoryKeyStore ¶
type InMemoryKeyStore struct {
// contains filtered or unexported fields
}
InMemoryKeyStore stores accounts.
func NewInMemoryKeyStore ¶
func NewInMemoryKeyStore() *InMemoryKeyStore
NewInMemoryKeyStore exposes a key store.
func (*InMemoryKeyStore) GetAccount ¶
func (i *InMemoryKeyStore) GetAccount(address common.Address) *keystore.Key
GetAccount gets an account from the in memory store. If no account is found, returns nil.
func (*InMemoryKeyStore) Store ¶
func (i *InMemoryKeyStore) Store(key *keystore.Key)
Store stores an ccount.