Documentation ¶
Index ¶
- func GetMakerTestKey(t *testing.T) *ecdsa.PrivateKey
- func GetTakerTestKey(t *testing.T) *ecdsa.PrivateKey
- func GetTestKeyByIndex(t *testing.T, index int) *ecdsa.PrivateKey
- func MineTransaction(t *testing.T, ec bind.DeployBackend, tx *ethtypes.Transaction) *ethtypes.Receipt
- func NewEthClient(t *testing.T) (*ethclient.Client, *big.Int)
- func NewEthMainnetClient(t *testing.T) *ethclient.Client
- func NewEthSepoliaClient(t *testing.T) *ethclient.Client
- func TxOpts(t *testing.T, pk *ecdsa.PrivateKey) *bind.TransactOpts
- func TxOptsWithValue(t *testing.T, pk *ecdsa.PrivateKey, value *big.Int) *bind.TransactOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMakerTestKey ¶
func GetMakerTestKey(t *testing.T) *ecdsa.PrivateKey
GetMakerTestKey returns the first ganache test key allocated to a package
func GetTakerTestKey ¶
func GetTakerTestKey(t *testing.T) *ecdsa.PrivateKey
GetTakerTestKey returns the second ganache test key allocated to a package
func GetTestKeyByIndex ¶
func GetTestKeyByIndex(t *testing.T, index int) *ecdsa.PrivateKey
GetTestKeyByIndex returns the ganache test key allocated to a package by index
func MineTransaction ¶
func MineTransaction(t *testing.T, ec bind.DeployBackend, tx *ethtypes.Transaction) *ethtypes.Receipt
MineTransaction is a test helper that blocks until the transaction is included in a block and returns the receipt. Errors are checked including the status.
func NewEthClient ¶
NewEthClient returns a connection to the local ganache instance for unit tests along with its chain ID. The connection is automatically closed when the test completes.
func NewEthMainnetClient ¶ added in v0.2.0
NewEthMainnetClient returns a connection to a mainnet endpoint, set by an ETH_MAINNET_ENDPOINT environment variable, for testing. If the environment variable is empty, the test falls back to the `fallbackMainnetEndpoint` constant.
func NewEthSepoliaClient ¶ added in v0.2.0
NewEthSepoliaClient returns a connection to a Sepolia endpoint, set by an ETH_SEPOLIA_ENDPOINT environment variable, for testing. If the environment variable is empty, the test falls back to the `fallbackSepoliaEndpoint` constant.
func TxOpts ¶ added in v0.2.1
func TxOpts(t *testing.T, pk *ecdsa.PrivateKey) *bind.TransactOpts
TxOpts returns a fresh TransactOpts for use in tests
func TxOptsWithValue ¶ added in v0.2.1
func TxOptsWithValue(t *testing.T, pk *ecdsa.PrivateKey, value *big.Int) *bind.TransactOpts
TxOptsWithValue returns a fresh TransactOpts with a set value for use in tests
Types ¶
This section is empty.