Documentation ¶
Overview ¶
e2e implements the e2e tests.
Index ¶
- Constants
- func AddEphemeralNode(network testnet.Network, flags testnet.FlagsMap) testnet.Node
- func ContextWithTimeout(duration time.Duration) context.Context
- func DefaultContext() context.Context
- func DescribeAChain(text string, body func()) bool
- func DescribeAChainSerial(text string, body func()) bool
- func DescribeDChain(text string, body func()) bool
- func DescribeOChain(text string, body func()) bool
- func Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msg string)
- func InitTestEnvironment(envBytes []byte)
- func SendEthTransaction(ethClient ethclient.Client, signedTx *types.Transaction) *types.Receipt
- func SuggestGasPrice(ethClient ethclient.Client) *big.Int
- func WaitForHealthy(node testnet.Node)
- func WithDefaultContext() common.Option
- func WithSuggestedGasPrice(ethClient ethclient.Client) common.Option
- type TestEnvironment
- func (te *TestEnvironment) AllocateFundedKey() *secp256k1.PrivateKey
- func (te *TestEnvironment) AllocateFundedKeys(count int) []*secp256k1.PrivateKey
- func (te *TestEnvironment) GetNetwork() testnet.Network
- func (te *TestEnvironment) GetRandomNodeURI() testnet.NodeURI
- func (te *TestEnvironment) NewEthClient(nodeURI testnet.NodeURI) ethclient.Client
- func (te *TestEnvironment) NewKeychain(count int) *secp256k1fx.Keychain
- func (te *TestEnvironment) NewWallet(keychain *secp256k1fx.Keychain, nodeURI testnet.NodeURI) primary.Wallet
Constants ¶
const ( // Enough for primary.NewWallet to fetch initial UTXOs. DefaultWalletCreationTimeout = 5 * time.Second // Defines default tx confirmation timeout. // Enough for test/custom networks. DefaultConfirmTxTimeout = 20 * time.Second // This interval should represent the upper bound of the time // required to start a new node on a local test network. DefaultNodeStartTimeout = 20 * time.Second // A long default timeout used to timeout failed operations but // unlikely to induce flaking due to unexpected resource // contention. DefaultTimeout = 2 * time.Minute // Interval appropriate for network operations that should be // retried periodically but not too often. DefaultPollingInterval = 500 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func AddEphemeralNode ¶
Add an ephemeral node that is only intended to be used by a single test. Its ID and URI are not intended to be returned from the Network instance to minimize accessibility from other tests.
func ContextWithTimeout ¶
Helper simplifying use of a timed context by canceling the context on ginkgo teardown.
func DefaultContext ¶
Helper simplifying use of a timed context configured with the default timeout.
func DescribeAChain ¶
DescribeAChain annotates the tests for A-Chain. Can run with any type of cluster (e.g., local, testnet, mainnet).
func DescribeAChainSerial ¶
DescribeAChainSerial annotates serial tests for A-Chain. Can run with any type of cluster (e.g., local, testnet, mainnet).
func DescribeDChain ¶
DescribeDChain annotates the tests for D-Chain. Can run with any type of cluster (e.g., local, testnet, mainnet).
func DescribeOChain ¶
DescribeOChain annotates the tests for O-Chain. Can run with any type of cluster (e.g., local, testnet, mainnet).
func Eventually ¶
Re-implementation of testify/require.Eventually that is compatible with ginkgo. testify's version calls the condition function with a goroutine and ginkgo assertions don't work properly in goroutines.
func InitTestEnvironment ¶
func InitTestEnvironment(envBytes []byte)
func SendEthTransaction ¶
Sends an eth transaction, waits for the transaction receipt to be issued and checks that the receipt indicates success.
func SuggestGasPrice ¶
Determines the suggested gas price for the configured client that will maximize the chances of transaction acceptance.
func WaitForHealthy ¶
Wait for the given node to report healthy.
func WithDefaultContext ¶
Helper simplifying use via an option of a timed context configured with the default timeout.
Types ¶
type TestEnvironment ¶
type TestEnvironment struct { // The directory where the test network configuration is stored NetworkDir string // URIs used to access the API endpoints of nodes of the network URIs []testnet.NodeURI // The URI used to access the http server that allocates test data TestDataServerURI string // contains filtered or unexported fields }
var Env *TestEnvironment
Env is used to access shared test fixture. Intended to be initialized by SynchronizedBeforeSuite.
func (*TestEnvironment) AllocateFundedKey ¶
func (te *TestEnvironment) AllocateFundedKey() *secp256k1.PrivateKey
Retrieve a funded key allocated for the caller's exclusive use.
func (*TestEnvironment) AllocateFundedKeys ¶
func (te *TestEnvironment) AllocateFundedKeys(count int) []*secp256k1.PrivateKey
Retrieve the specified number of funded keys allocated for the caller's exclusive use.
func (*TestEnvironment) GetNetwork ¶
func (te *TestEnvironment) GetNetwork() testnet.Network
Retrieve the network to target for testing.
func (*TestEnvironment) GetRandomNodeURI ¶
func (te *TestEnvironment) GetRandomNodeURI() testnet.NodeURI
Retrieve a random URI to naively attempt to spread API load across nodes.
func (*TestEnvironment) NewEthClient ¶
func (te *TestEnvironment) NewEthClient(nodeURI testnet.NodeURI) ethclient.Client
Create a new eth client targeting the specified node URI.
func (*TestEnvironment) NewKeychain ¶
func (te *TestEnvironment) NewKeychain(count int) *secp256k1fx.Keychain
Create a new keychain with the specified number of test keys.
func (*TestEnvironment) NewWallet ¶
func (te *TestEnvironment) NewWallet(keychain *secp256k1fx.Keychain, nodeURI testnet.NodeURI) primary.Wallet
Create a new wallet for the provided keychain against the specified node URI.
Directories ¶
Path | Synopsis |
---|---|
transfer
Implements A-chain transfer tests.
|
Implements A-chain transfer tests. |
Implements tests for the banff network upgrade.
|
Implements tests for the banff network upgrade. |
Implements static handlers tests for alpha and omegavm
|
Implements static handlers tests for alpha and omegavm |