Documentation ¶
Index ¶
- Variables
- 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(wallet *ethwallet.Wallet, contractAddress common.Address, contractABI abi.ABI, ...) (*types.Receipt, error)
- func DummyAddr() common.Address
- func DummyPrivateKey(seed uint64) string
- func ETHValue(ether float64) *big.Int
- func ETHValueBigInt(ether *big.Int) *big.Int
- func GetBalance(t *testing.T, wallet *ethwallet.Wallet) *big.Int
- func PrepareBlastSendTransactions(ctx context.Context, fromWallets []*ethwallet.Wallet, ...) ([]*ethtxn.TransactionRequest, []*types.Transaction, error)
- func RandomSeed() uint64
- func SendTransaction(t *testing.T, wallet *ethwallet.Wallet, to common.Address, data []byte, ...) (*types.Transaction, ethtxn.WaitReceipt)
- func SendTransactionAndWaitForReceipt(t *testing.T, wallet *ethwallet.Wallet, to common.Address, data []byte, ...) (*types.Transaction, *types.Receipt)
- func WalletAddresses(wallets []*ethwallet.Wallet) []common.Address
- type ERC20Mock
- func (c *ERC20Mock) GetBalance(t *testing.T, account ethkit.Address, expectedAmount int64)
- func (c *ERC20Mock) Mint(t *testing.T, wallet *ethwallet.Wallet, amount int64) *types.Receipt
- func (c *ERC20Mock) Transfer(t *testing.T, owner *ethwallet.Wallet, to ethkit.Address, amount int64) *types.Receipt
- type Reorgme
- 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) DummyWallet(seed uint64) (*ethwallet.Wallet, error)
- func (c *Testchain) DummyWallets(nWallets uint64, startingSeed uint64) ([]*ethwallet.Wallet, error)
- func (c *Testchain) FundAddress(addr common.Address, optBalanceTarget ...float64) error
- func (c *Testchain) FundAddresses(addrs []common.Address, optBalanceTarget ...float64) error
- func (c *Testchain) FundWallets(minBalance float64, wallets ...*ethwallet.Wallet) error
- func (c *Testchain) GetDeployTransactor() (*bind.TransactOpts, error)
- func (c *Testchain) GetDeployWallet() *ethwallet.Wallet
- func (c *Testchain) GetRelayerWallet() *ethwallet.Wallet
- func (c *Testchain) MustFundAddress(addr common.Address, optBalanceTarget ...float64)
- func (c *Testchain) MustWallet(optAccountIndex ...uint32) *ethwallet.Wallet
- func (c *Testchain) RandomNonce() *big.Int
- 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 registry to have some contracts on hand during testing Contracts = ethartifact.NewContractRegistry() )
View Source
var DefaultTestchainOptions = TestchainOptions{
NodeURL: "http://localhost:8545",
}
Functions ¶
func ContractCall ¶
func ContractQuery ¶
func ContractTransact ¶
func DummyPrivateKey ¶
DummyPrivateKey returns random private key in hex used with ethwallet
func RandomSeed ¶
func RandomSeed() uint64
func SendTransaction ¶
Types ¶
type ERC20Mock ¶
type ERC20Mock struct { Contract *ethcontract.Contract // contains filtered or unexported fields }
func DeployERC20Mock ¶
func (*ERC20Mock) GetBalance ¶
type Testchain ¶
type Testchain struct { Provider *ethrpc.Provider // provider rpc to the test chain // 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) DummyWallet ¶
func (*Testchain) DummyWallets ¶
func (*Testchain) FundAddress ¶
func (*Testchain) FundAddresses ¶
func (*Testchain) FundWallets ¶
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) MustFundAddress ¶
func (*Testchain) MustWallet ¶
func (*Testchain) RandomNonce ¶
type TestchainOptions ¶
type TestchainOptions struct {
NodeURL string
}
Click to show internal directories.
Click to hide internal directories.