Documentation ¶
Index ¶
- type Backend
- func NewAnvilBackend(chainName string, chainID uint64, blockPeriod time.Duration, ...) (*Backend, error)
- func NewBackend(chainName string, chainID uint64, blockPeriod time.Duration, ...) (*Backend, error)
- func NewFireBackend(ctx context.Context, chainName string, chainID uint64, ...) (*Backend, error)
- func (b *Backend) AddAccount(privkey *ecdsa.PrivateKey) (common.Address, error)
- func (b *Backend) BindOpts(ctx context.Context, from common.Address) (*bind.TransactOpts, error)
- func (b *Backend) Chain() (string, uint64)
- func (b *Backend) EnsureSynced(ctx context.Context) error
- func (b *Backend) PublicKey(from common.Address) (*ecdsa.PublicKey, error)
- func (b *Backend) Send(ctx context.Context, from common.Address, candidate txmgr.TxCandidate) (*ethtypes.Transaction, *ethtypes.Receipt, error)
- func (b *Backend) SendTransaction(ctx context.Context, in *ethtypes.Transaction) error
- func (b *Backend) Sign(ctx context.Context, from common.Address, input [32]byte) ([65]byte, error)
- func (b *Backend) WaitMined(ctx context.Context, tx *ethtypes.Transaction) (*ethtypes.Receipt, error)
- type Backends
- func (b Backends) All() map[uint64]*Backend
- func (b Backends) Backend(sourceChainID uint64) (*Backend, error)
- func (b Backends) BindOpts(ctx context.Context, sourceChainID uint64, addr common.Address) (*bind.TransactOpts, *Backend, error)
- func (b Backends) NewWaiter() *Waiter
- func (b Backends) RPCClients() map[uint64]ethclient.Client
- type Waiter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
func NewAnvilBackend ¶
func NewAnvilBackend(chainName string, chainID uint64, blockPeriod time.Duration, ethCl ethclient.Client) (*Backend, error)
NewAnvilBackend returns a backend with all pre-funded anvil dev accounts.
func NewBackend ¶
func NewBackend(chainName string, chainID uint64, blockPeriod time.Duration, ethCl ethclient.Client, privateKeys ...*ecdsa.PrivateKey) (*Backend, error)
NewBackend returns a new backend backed by in-memory private keys.
func NewFireBackend ¶
func NewFireBackend(ctx context.Context, chainName string, chainID uint64, blockPeriod time.Duration, ethCl ethclient.Client, fireCl fireblocks.Client) (*Backend, error)
NewFireBackend returns a backend that supports all accounts supported by the configured fireblocks client. Note that private keys can still be added via AddAccount.
func (*Backend) AddAccount ¶
AddAccount adds a in-memory private key account to the backend. Note this can be called even if other accounts are fireblocks based.
func (*Backend) BindOpts ¶
BindOpts returns a new TransactOpts for interacting with bindings based contracts for the provided account. The TransactOpts are partially stubbed, since txmgr handles nonces and signing.
Do not cache or store the TransactOpts, as they are not safe for concurrent use (pointer). Rather create a new TransactOpts for each transaction.
func (*Backend) EnsureSynced ¶
EnsureSynced returns an error if the backend is not synced.
func (*Backend) SendTransaction ¶
SendTransaction intercepts the tx that bindings generates, extracts the from address (assuming the backendStubSigner was used), the strips fields, and passes it to the txmgr for reliable broadcasting.
type Backends ¶
type Backends struct {
// contains filtered or unexported fields
}
Backends is a wrapper around a set of Backends, one for each chain. At this point, it only supports "a single account for all Backends".
See Backends godoc for more information.
func NewBackends ¶
func NewBackends(ctx context.Context, testnet types.Testnet, deployKeyFile string) (Backends, error)
NewBackends returns a multi-backends backed by in-memory keys that supports configured all chains.
func NewFireBackends ¶
func NewFireBackends(ctx context.Context, testnet types.Testnet, fireCl fireblocks.Client) (Backends, error)
NewFireBackends returns a multi-backends backed by fireblocks keys that supports configured all chains.