Documentation ¶
Index ¶
- Variables
- func BatchSignAndSend[C core.WalletConfig](t *testing.T, wallet *sequence.Wallet[C], 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 SequenceContexts() map[uint8]sequence.WalletContext
- func SignAndSend[C core.WalletConfig](t *testing.T, wallet *sequence.Wallet[C], to common.Address, data []byte) error
- func SignAndSendRawTransaction[C core.WalletConfig](t *testing.T, wallet *sequence.Wallet[C], stx *sequence.Transaction) error
- func V1SequenceContext() sequence.WalletContext
- func V2SequenceContext() sequence.WalletContext
- type TestChain
- func (c *TestChain) ChainID() *big.Int
- func (c *TestChain) Connect() error
- func (c *TestChain) Deploy(t *testing.T, contractName string, contractConstructorArgs ...interface{}) (*ethcontract.Contract, *types.Receipt)
- func (c *TestChain) DeploySequenceWallet(wallet *sequence.Wallet[core.WalletConfig]) error
- func (c *TestChain) Disconnect()
- 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) MustDeploySequenceContexts() map[uint8]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) V1DeploySequenceContext() (sequence.WalletContext, error)
- func (c *TestChain) V1DummySequenceWallet(seed uint64, optSkipDeploy ...bool) (*sequence.Wallet[core.WalletConfig], error)
- func (c *TestChain) V1DummySequenceWallets(nWallets uint64, startingSeed uint64) ([]*sequence.Wallet[core.WalletConfig], error)
- func (c *TestChain) V1SequenceContext() sequence.WalletContext
- func (c *TestChain) V2DeploySequenceContext() (sequence.WalletContext, error)
- func (c *TestChain) V2DummySequenceWallet(seed uint64, optSkipDeploy ...bool) (*sequence.Wallet[core.WalletConfig], error)
- func (c *TestChain) V2DummySequenceWallets(nWallets uint64, startingSeed uint64) ([]*sequence.Wallet[core.WalletConfig], error)
- func (c *TestChain) V2SequenceContext() sequence.WalletContext
- 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 SequenceContexts ¶ added in v0.22.0
func SequenceContexts() map[uint8]sequence.WalletContext
func SignAndSend ¶ added in v0.2.0
func SignAndSendRawTransaction ¶ added in v0.2.0
func SignAndSendRawTransaction[C core.WalletConfig](t *testing.T, wallet *sequence.Wallet[C], stx *sequence.Transaction) error
func V1SequenceContext ¶ added in v0.22.0
func V1SequenceContext() sequence.WalletContext
func V2SequenceContext ¶ added in v0.22.0
func V2SequenceContext() sequence.WalletContext
Types ¶
type TestChain ¶
type TestChain struct { Provider *ethrpc.Provider // provider rpc to the test chain Monitor *ethmonitor.Monitor ReceiptsListener *ethreceipts.ReceiptsListener 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) DeploySequenceWallet ¶ added in v0.4.4
func (c *TestChain) DeploySequenceWallet(wallet *sequence.Wallet[core.WalletConfig]) error
func (*TestChain) Disconnect ¶ added in v0.17.0
func (c *TestChain) Disconnect()
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) MustDeploySequenceContexts ¶ added in v0.22.0
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`.
func (*TestChain) V1DeploySequenceContext ¶ added in v0.22.0
func (*TestChain) V1DummySequenceWallet ¶ added in v0.22.0
func (*TestChain) V1DummySequenceWallets ¶ added in v0.22.0
func (*TestChain) V1SequenceContext ¶ added in v0.22.0
func (c *TestChain) V1SequenceContext() sequence.WalletContext
func (*TestChain) V2DeploySequenceContext ¶ added in v0.22.0
func (*TestChain) V2DummySequenceWallet ¶ added in v0.22.0
func (*TestChain) V2DummySequenceWallets ¶ added in v0.22.0
func (*TestChain) V2SequenceContext ¶ added in v0.22.0
func (c *TestChain) V2SequenceContext() sequence.WalletContext
type TestChainOptions ¶
type TestChainOptions struct {
NodeURL string
}
Click to show internal directories.
Click to hide internal directories.