Documentation ¶
Index ¶
- type ContractSpec
- type GenContext
- func (gen *GenContext) AddContract(name string, spec *ContractSpec)
- func (gen *GenContext) AddFunction(fn func(int, *core.BlockGen))
- func (gen *GenContext) AddOwnedAccount(key *ecdsa.PrivateKey) common.Address
- func (gen *GenContext) CreateCallTx(from common.Address, to common.Address, methodName string, args ...interface{}) (*types.Transaction, error)
- func (gen *GenContext) CreateContractTx(from common.Address, contractName string) (*types.Transaction, error)
- func (gen *GenContext) CreateLondonTx(block *core.BlockGen, addr *common.Address, key *ecdsa.PrivateKey) (*types.Transaction, error)
- func (gen *GenContext) CreateSendTx(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error)
- func (gen *GenContext) DeployContract(from common.Address, contractName string) (common.Address, error)
- func (gen *GenContext) MakeChain(n int) ([]*types.Block, []types.Receipts, *core.BlockChain)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractSpec ¶
func ParseContract ¶
func ParseContract(abiStr, binStr string) (*ContractSpec, error)
type GenContext ¶
type GenContext struct { ChainConfig *params.ChainConfig GenFuncs []func(int, *core.BlockGen) DB ethdb.Database Keys map[common.Address]*ecdsa.PrivateKey Contracts map[string]*ContractSpec Genesis *types.Block // contains filtered or unexported fields }
func DefaultGenContext ¶
func DefaultGenContext(chainConfig *params.ChainConfig, db ethdb.Database) *GenContext
A GenContext which exactly replicates the chain generator used in existing tests
func NewGenContext ¶
func NewGenContext(chainConfig *params.ChainConfig, db ethdb.Database) *GenContext
func (*GenContext) AddContract ¶
func (gen *GenContext) AddContract(name string, spec *ContractSpec)
func (*GenContext) AddFunction ¶
func (gen *GenContext) AddFunction(fn func(int, *core.BlockGen))
func (*GenContext) AddOwnedAccount ¶
func (gen *GenContext) AddOwnedAccount(key *ecdsa.PrivateKey) common.Address
func (*GenContext) CreateCallTx ¶
func (gen *GenContext) CreateCallTx(from common.Address, to common.Address, methodName string, args ...interface{}) (*types.Transaction, error)
func (*GenContext) CreateContractTx ¶
func (gen *GenContext) CreateContractTx(from common.Address, contractName string) (*types.Transaction, error)
func (*GenContext) CreateLondonTx ¶
func (gen *GenContext) CreateLondonTx(block *core.BlockGen, addr *common.Address, key *ecdsa.PrivateKey) (*types.Transaction, error)
func (*GenContext) CreateSendTx ¶
func (gen *GenContext) CreateSendTx(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error)
func (*GenContext) DeployContract ¶
func (*GenContext) MakeChain ¶
func (gen *GenContext) MakeChain(n int) ([]*types.Block, []types.Receipts, *core.BlockChain)
MakeChain creates a chain of n blocks starting at and including the genesis block. the returned hash chain is ordered head->parent.
Click to show internal directories.
Click to hide internal directories.