Documentation ¶
Index ¶
- Variables
- func BatchSignAndSend(t *testing.T, wallet *sequence.Wallet, to common.Address, data [][]byte) error
- func ContractCall(provider *ethrpc.Provider, contractAddress common.Address, contractABI abi.ABI, ...) ([]byte, error)
- func ContractQuery(provider *ethrpc.Provider, contractAddress common.Address, ...) ([]string, error)
- func ContractTransact(signer *ethwallet.Wallet, contractAddress common.Address, contractABI abi.ABI, ...) (*types.Receipt, error)
- func DummyAddr() common.Address
- func DummyPrivateKey(seed uint64) string
- func RandomSeed() uint64
- func SequenceContext() sequence.WalletContext
- func SignAndSend(t *testing.T, wallet *sequence.Wallet, to common.Address, data []byte) error
- func SignAndSendRawTransaction(t *testing.T, wallet *sequence.Wallet, stx *sequence.Transaction) error
- type TestChain
- func (c *TestChain) ChainID() *big.Int
- func (c *TestChain) Deploy(t *testing.T, contractName string, contractConstructorArgs ...interface{}) (*ethcontract.Contract, *types.Receipt)
- func (c *TestChain) DeploySequenceContext() (sequence.WalletContext, error)
- func (c *TestChain) DeploySequenceWallet(wallet *sequence.Wallet) error
- func (c *TestChain) DummySequenceWallet(seed uint64, optSkipDeploy ...bool) (*sequence.Wallet, error)
- func (c *TestChain) DummySequenceWallets(nWallets uint64, startingSeed uint64) ([]*sequence.Wallet, error)
- func (c *TestChain) GetDeployTransactor() (*bind.TransactOpts, error)
- func (c *TestChain) GetDeployWallet() *ethwallet.Wallet
- func (c *TestChain) GetRelayerWallet() *ethwallet.Wallet
- func (c *TestChain) MustDeploySequenceContext() sequence.WalletContext
- func (c *TestChain) MustFundAddress(addr common.Address) error
- func (c *TestChain) MustWallet(optAccountIndex ...uint32) *ethwallet.Wallet
- func (c *TestChain) RandomNonce() *big.Int
- func (c *TestChain) SequenceContext() sequence.WalletContext
- func (c *TestChain) SetRpcRelayer(relayerURL string) error
- func (c *TestChain) UniDeploy(t *testing.T, contractName string, contractInstanceNum uint, ...) *ethcontract.Contract
- func (c *TestChain) WaitMined(txn common.Hash) error
- func (c *TestChain) Wallet() (*ethwallet.Wallet, error)
- type TestChainOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Contracts = ethartifact.NewContractRegistry()
)
View Source
var DefaultTestChainOptions = TestChainOptions{
NodeURL: "http://localhost:8545",
}
Functions ¶
func BatchSignAndSend ¶ added in v0.2.0
func ContractCall ¶
func ContractQuery ¶
func ContractTransact ¶
func DummyPrivateKey ¶
DummyPrivateKey returns random private key in hex used with ethwallet
func SequenceContext ¶
func SequenceContext() sequence.WalletContext
func SignAndSend ¶ added in v0.2.0
func SignAndSendRawTransaction ¶ added in v0.2.0
Types ¶
type TestChain ¶
type TestChain struct { Provider *ethrpc.Provider // provider rpc to the test chain RpcRelayer *relayer.RpcRelayer // helper to track RpcRelayer client // contains filtered or unexported fields }
func NewTestChain ¶
func NewTestChain(opts ...TestChainOptions) (*TestChain, error)
func (*TestChain) Deploy ¶
func (c *TestChain) Deploy(t *testing.T, contractName string, contractConstructorArgs ...interface{}) (*ethcontract.Contract, *types.Receipt)
Deploy will deploy a contract registered in `Contracts` registry using the standard deployment method. Each Deploy call will instanitate a new contract on the test chain.
func (*TestChain) DeploySequenceContext ¶
func (*TestChain) DeploySequenceWallet ¶ added in v0.4.4
func (*TestChain) DummySequenceWallet ¶
func (*TestChain) DummySequenceWallets ¶
func (*TestChain) GetDeployTransactor ¶
func (c *TestChain) GetDeployTransactor() (*bind.TransactOpts, error)
GetDeployTransactor returns a account transactor typically used for deploying contracts
func (*TestChain) GetDeployWallet ¶
func (*TestChain) GetRelayerWallet ¶
GetRelayerWallet is the wallet dedicated EOA wallet to relaying transactions
func (*TestChain) MustDeploySequenceContext ¶
func (c *TestChain) MustDeploySequenceContext() sequence.WalletContext
func (*TestChain) MustFundAddress ¶ added in v0.4.0
func (*TestChain) MustWallet ¶
func (*TestChain) RandomNonce ¶ added in v0.4.0
func (*TestChain) SequenceContext ¶ added in v0.3.3
func (c *TestChain) SequenceContext() sequence.WalletContext
func (*TestChain) SetRpcRelayer ¶ added in v0.3.3
func (*TestChain) UniDeploy ¶
func (c *TestChain) UniDeploy(t *testing.T, contractName string, contractInstanceNum uint, contractConstructorArgs ...interface{}) *ethcontract.Contract
UniDeploy will deploy a contract registered in `Contracts` registry using the universal deployer. Multiple calls to UniDeploy will instantiate just a single instance for the same contract with the same `contractInstanceNum`.
type TestChainOptions ¶
type TestChainOptions struct {
NodeURL string
}
Click to show internal directories.
Click to hide internal directories.