Documentation ¶
Overview ¶
Package geth handles creating mock geth clients and simulated backends
Index ¶
- Constants
- type Backend
- func (f *Backend) BackendName() string
- func (f *Backend) BatchWithContext(ctx context.Context, calls ...w3types.Caller) error
- func (f *Backend) ChainConfig() *params.ChainConfig
- func (f *Backend) FaucetSignTx(tx *types.Transaction) *types.Transaction
- func (f *Backend) FundAccount(ctx context.Context, address common.Address, amount big.Int)
- func (f *Backend) GetFundedAccount(ctx context.Context, requestBalance *big.Int) *keystore.Key
- func (f *Backend) GetTxContext(ctx context.Context, address *common.Address) (res backends.AuthType)
- func (f *Backend) Signer() types.Signer
Constants ¶
const GethBackendName = "GethBackend"
GethBackendName is the name of the geth backend.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { // Chain is the creates chain object *base.Backend // Node is the eth node *node.Node // contains filtered or unexported fields }
Backend is a full geth backend equivalent to running geth --dev.
func NewEmbeddedBackend ¶
NewEmbeddedBackend gets the default embedded backend.
func NewEmbeddedBackendForChainID ¶
NewEmbeddedBackendForChainID gets the embedded backend for a specific chain id.
func NewEmbeddedBackendWithConfig ¶
func NewEmbeddedBackendWithConfig(ctx context.Context, t *testing.T, config *params.ChainConfig) *Backend
NewEmbeddedBackendWithConfig gets a full node backend to test against and returns the rpc url can be canceled with the past in context object.
func (*Backend) BackendName ¶
BackendName gets the backend name.
func (*Backend) BatchWithContext ¶ added in v0.1.7
func (*Backend) ChainConfig ¶
func (f *Backend) ChainConfig() *params.ChainConfig
ChainConfig gets the chain config for the backend.
func (*Backend) FaucetSignTx ¶
func (f *Backend) FaucetSignTx(tx *types.Transaction) *types.Transaction
FaucetSignTx will sign a tx with the faucet addr.
func (*Backend) FundAccount ¶
FundAccount fundsa new account.
func (*Backend) GetFundedAccount ¶
GetFundedAccount returns an account with the requested balance. (Note: if genesis acount has an insufficient balance, blocks may be mined here).