Documentation ¶
Overview ¶
Package ganache provides a ganache backend
Index ¶
- Constants
- type Address
- type Addresses
- type Backend
- func (b *Backend) BackendName() string
- func (b *Backend) FundAccount(ctx context.Context, address common.Address, amount big.Int)
- func (b *Backend) GetFundedAccount(ctx context.Context, requestBalance *big.Int) *keystore.Key
- func (b *Backend) GetTxContext(ctx context.Context, address *common.Address) (auth backends.AuthType)
- func (b *Backend) Signer() types.Signer
Constants ¶
View Source
const GanacheBackendName = "Ganache"
GanacheBackendName is the name of the geth backend.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Secretkey struct { Type string `json:"type"` Data []int `json:"data"` } `json:"secretKey"` Publickey struct { Type string `json:"type"` Data []int `json:"data"` } `json:"publicKey"` Address string `json:"address"` Account struct { Nonce string `json:"nonce"` Balance string `json:"balance"` Stateroot string `json:"stateRoot"` Codehash string `json:"codeHash"` } `json:"account"` }
Address is an object exported by --account_keys_path in ganache. these are used to authenticate with a test chain.
type Addresses ¶
type Addresses struct { Addresses map[string]Address `json:"addresses"` PrivateKeys map[string]string `json:"private_keys"` }
Addresses is a list of ganache addresses.
func ParseAddresses ¶
ParseAddresses parses the addresses out of a path and returns an object.
type Backend ¶
Backend is the ganache backend.
func NewGanacheBackend ¶
func NewGanacheBackend(ctx context.Context, t *testing.T, chainConfig *params.ChainConfig, rpcURL, chainName, keyPath string) *Backend
NewGanacheBackend creates a new ganache backend. Deprecated: this will be removed in a future version in favor of anvil.
func (*Backend) BackendName ¶
BackendName gets the backend name.
func (*Backend) FundAccount ¶
FundAccount funds an account with an amount.
func (*Backend) GetFundedAccount ¶
GetFundedAccount gets a funded account.
Click to show internal directories.
Click to hide internal directories.