runner

package
v0.0.0-...-c5e366f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 121 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ZRC20InitialSupply is the initial supply of the ZRC20 token
	ZRC20SOLInitialSupply = 100000000

	// SolanaPDAInitialBalance is the initial balance (in lamports) of the gateway PDA account
	SolanaPDAInitialBalance = 1447680
)
View Source
const (
	// BTCBlockTime is the block time for the Bitcoin mainnet and testnet
	BTCBlockTime = 10 * time.Minute

	// BTCRegnetBlockTime is the block time for the Bitcoin regnet
	BTCRegnetBlockTime = 6 * time.Second

	// BTCDepositTxFee is the fixed deposit transaction fee (0.00003 BTC) for E2E tests
	// Given one UTXO input, the deposit transaction fee rate is approximately 10 sat/vB
	BTCDepositTxFee = 0.00003
)
View Source
const (
	EnvKeyLocalnetMode          = "LOCALNET_MODE"
	EnvKeyUpgradeZetaclientOnly = "UPGRADE_ZETACLIENT_ONLY"

	LocalnetModeUpgrade      = "upgrade"
	LocalNetModeTSSMigration = "tss-migration"

	// NodeSyncTolerance is the time tolerance for the ZetaChain nodes behind a RPC to be synced
	NodeSyncTolerance = constant.ZetaBlockTime * 5
)

Important ENV

View Source
const (
	ContractsConfigFile = "contracts.toml"
)
View Source
const GatewayGasLimit = 4000000

GatewayGasLimit is the gas limit used for calls from the gateway In our tests we use 4M to replicate live network environment This value is set either when we initialize the contracts or when we upgrade the gateway to ensure the tests pass in regular or upgrade tests

View Source
const V36Version = "v36.0.0"

Variables

View Source
var ConnectedProgramID = solana.MustPublicKeyFromBase58("4xEw862A2SEwMjofPkUyd4NEekmVJKJsdHkK3UkAtDrc")

Connected programs used to test sol and spl withdraw and call

View Source
var ConnectedSPLProgramID = solana.MustPublicKeyFromBase58("8iUjRRhUCn8BjrvsWPfj8mguTe9L81ES4oAUApiF8JFC")
View Source
var EmissionsPoolFunding = big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(2e7))

EmissionsPoolFunding represents the amount of ZETA to fund the emissions pool with This is the same value as used originally on mainnet (20M ZETA)

Functions

func GetRunNumber

func GetRunNumber() int

GetRunNumber returns the current run number from the RUN_NUMBER environment variable.

func IsSecondRun

func IsSecondRun() bool

IsSecondRun returns true if this is the second run of an upgrade/migration test.

Types

type AccountBalances

type AccountBalances struct {
	ZetaETH      *big.Int
	ZetaZETA     *big.Int
	ZetaWZETA    *big.Int
	ZetaERC20    *big.Int
	ZetaBTC      *big.Int
	ZetaSOL      *big.Int
	ZetaSPL      *big.Int
	ZetaSui      *big.Int
	ZetaSuiToken *big.Int
	ZetaTON      *big.Int
	EvmETH       *big.Int
	EvmZETA      *big.Int
	EvmERC20     *big.Int
	BtcBTC       string
	SolSOL       *big.Int
	SolSPL       *big.Int
	SuiSUI       uint64
	SuiToken     uint64
	TONTON       uint64
}

AccountBalances is a struct that contains the balances of the accounts used in the E2E test

type AccountBalancesDiff

type AccountBalancesDiff struct {
	ETH   *big.Int
	ZETA  *big.Int
	ERC20 *big.Int
}

AccountBalancesDiff is a struct that contains the difference in the balances of the accounts used in the E2E test

func GetAccountBalancesDiff

func GetAccountBalancesDiff(balancesBefore, balancesAfter AccountBalances) AccountBalancesDiff

GetAccountBalancesDiff returns the difference in the account balances of the accounts used in the E2E test

type Amount

type Amount struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type ArgDefinition

type ArgDefinition struct {
	Description  string
	DefaultValue string
}

ArgDefinition defines a structure for holding an argument's description along with it's default value.

type Clients

type Clients struct {
	Zetacore zetacore_rpc.Clients

	// the RPC clients for external chains in the localnet
	BtcRPC  *btcclient.Client
	Solana  *rpc.Client
	Evm     *ethclient.Client
	EvmAuth *bind.TransactOpts
	TON     *tonrunner.Client
	Sui     sui.ISuiAPI

	// the RPC clients for ZetaChain
	Zevm     *ethclient.Client
	ZevmAuth *bind.TransactOpts

	ZetaclientMetrics *MetricsClient
}

Clients contains all the RPC clients and gRPC clients for E2E tests

type ConnectedPdaInfo

type ConnectedPdaInfo struct {
	Discriminator     [8]byte
	LastSender        ethcommon.Address
	LastMessage       string
	LastRevertSender  solana.PublicKey
	LastRevertMessage string
}

ConnectedPdaInfo is struct representing example connected programs pda

type E2EDependency

type E2EDependency struct {
	// contains filtered or unexported fields
}

E2EDependency defines a structure that holds a E2E test dependency

func NewE2EDependency

func NewE2EDependency(name string) E2EDependency

NewE2EDependency creates a new instance of E2Edependency with specified parameters.

func (*E2EDependency) Done

func (d *E2EDependency) Done()

Done marks the E2EDependency as done

func (*E2EDependency) Wait

func (d *E2EDependency) Wait()

Wait waits for the E2EDependency to complete

type E2ERunner

type E2ERunner struct {
	// accounts
	Account               config.Account
	TSSAddress            ethcommon.Address
	BTCTSSAddress         btcutil.Address
	SuiTSSAddress         string
	SolanaDeployerAddress solana.PublicKey
	FeeCollectorAddress   types.AccAddress

	// all clients.
	// a reference to this type is required to enable creating a new E2ERunner.
	Clients Clients

	// rpc clients
	ZEVMClient   *ethclient.Client
	EVMClient    *ethclient.Client
	BtcRPCClient *btcclient.Client
	SolanaClient *rpc.Client

	// zetacored grpc clients
	AuthorityClient    authoritytypes.QueryClient
	CctxClient         crosschaintypes.QueryClient
	FungibleClient     fungibletypes.QueryClient
	AuthClient         authtypes.QueryClient
	BankClient         banktypes.QueryClient
	StakingClient      stakingtypes.QueryClient
	ObserverClient     observertypes.QueryClient
	LightclientClient  lightclienttypes.QueryClient
	DistributionClient distributiontypes.QueryClient
	EmissionsClient    emissionstypes.QueryClient

	// optional zeta (cosmos) client
	// typically only in test runners that need it
	// (like admin tests)
	ZetaTxServer *txserver.ZetaTxServer

	// evm auth
	EVMAuth  *bind.TransactOpts
	ZEVMAuth *bind.TransactOpts

	// programs on Solana
	GatewayProgram      solana.PublicKey
	SPLAddr             solana.PublicKey
	ConnectedProgram    solana.PublicKey
	ConnectedSPLProgram solana.PublicKey

	// TON related
	TONGateway ton.AccountID

	// contract Sui
	SuiGateway *sui.Gateway

	// SuiGatewayUpgradeCap is the upgrade cap used for upgrading the Sui gateway package
	SuiGatewayUpgradeCap string

	// SuiTokenCoinType is the coin type identifying the fungible token for SUI
	SuiTokenCoinType string

	// SuiTokenTreasuryCap is the treasury cap for the SUI token that allows minting, only using in local tests
	SuiTokenTreasuryCap string

	// SuiExample contains the example package information for Sui authenticated call
	SuiExample config.SuiExample

	// contracts evm
	ZetaEthAddr       ethcommon.Address
	ZetaEth           *zetaeth.ZetaEth
	ERC20CustodyAddr  ethcommon.Address
	ERC20Custody      *erc20custodyv2.ERC20Custody
	ERC20Addr         ethcommon.Address
	ERC20             *erc20.ERC20
	EvmTestDAppAddr   ethcommon.Address
	GatewayEVMAddr    ethcommon.Address
	GatewayEVM        *gatewayevm.GatewayEVM
	TestDAppV2EVMAddr ethcommon.Address
	TestDAppV2EVM     *testdappv2.TestDAppV2
	// ConnectorNative is the V2 connector for EVM chains
	ConnectorNativeAddr ethcommon.Address
	ConnectorNative     *zetaconnnectornative.ZetaConnectorNative
	// ConnectorEthAddr is the V1 connector for EVM chains
	ConnectorEthAddr ethcommon.Address
	ConnectorEth     *zetaconnectoreth.ZetaConnectorEth

	// contracts zevm
	// zrc20 contracts
	ERC20ZRC20Addr    ethcommon.Address
	ERC20ZRC20        *zrc20.ZRC20
	SPLZRC20Addr      ethcommon.Address
	SPLZRC20          *zrc20.ZRC20
	ETHZRC20Addr      ethcommon.Address
	ETHZRC20          *zrc20.ZRC20
	BTCZRC20Addr      ethcommon.Address
	BTCZRC20          *zrc20.ZRC20
	SOLZRC20Addr      ethcommon.Address
	SOLZRC20          *zrc20.ZRC20
	TONZRC20Addr      ethcommon.Address
	TONZRC20          *zrc20.ZRC20
	SUIZRC20Addr      ethcommon.Address
	SUIZRC20          *zrc20.ZRC20
	SuiTokenZRC20Addr ethcommon.Address
	SuiTokenZRC20     *zrc20.ZRC20

	// other contracts
	UniswapV2FactoryAddr ethcommon.Address
	UniswapV2Factory     *uniswapv2factory.UniswapV2Factory
	UniswapV2RouterAddr  ethcommon.Address
	UniswapV2Router      *uniswapv2router.UniswapV2Router02
	ConnectorZEVMAddr    ethcommon.Address
	ConnectorZEVM        *connectorzevm.ZetaConnectorZEVM
	WZetaAddr            ethcommon.Address
	WZeta                *wzeta.WETH9
	ZEVMSwapAppAddr      ethcommon.Address
	ZEVMSwapApp          *zevmswap.ZEVMSwapApp
	SystemContractAddr   ethcommon.Address
	SystemContract       *systemcontract.SystemContract
	ZevmTestDAppAddr     ethcommon.Address
	GatewayZEVMAddr      ethcommon.Address
	GatewayZEVM          *gatewayzevm.GatewayZEVM
	TestDAppV2ZEVMAddr   ethcommon.Address
	TestDAppV2ZEVM       *testdappv2.TestDAppV2
	CoreRegistryAddr     ethcommon.Address
	CoreRegistry         *coreregistry.CoreRegistry

	// config
	CctxTimeout    time.Duration
	ReceiptTimeout time.Duration

	// other
	Name          string
	Ctx           context.Context
	CtxCancel     context.CancelCauseFunc
	Logger        *Logger
	BitcoinParams *chaincfg.Params
	TestFilter    *regexp.Regexp
	// contains filtered or unexported fields
}

E2ERunner stores all the clients and addresses needed for E2E test Exposes a method to run E2E test It also provides some helper functions

func NewE2ERunner

func NewE2ERunner(
	ctx context.Context,
	name string,
	ctxCancel context.CancelCauseFunc,
	account config.Account,
	clients Clients,
	logger *Logger,
	opts ...E2ERunnerOption,
) *E2ERunner

func (*E2ERunner) ActivateChainsOnRegistry

func (r *E2ERunner) ActivateChainsOnRegistry()

func (*E2ERunner) AddInboundTracker

func (r *E2ERunner) AddInboundTracker(coinType coin.CoinType, txHash string)

AddInboundTracker adds an inbound tracker from the tx hash

func (*E2ERunner) AddLiquidityBTC

func (r *E2ERunner) AddLiquidityBTC(amountZETA, amountBTC *big.Int)

AddLiquidityBTC adds liquidity token to the uniswap pool ZETA/BTC

func (*E2ERunner) AddLiquidityERC20

func (r *E2ERunner) AddLiquidityERC20(amountZETA, amountERC20 *big.Int)

AddLiquidityERC20 adds liquidity token to the uniswap pool ZETA/ERC20

func (*E2ERunner) AddLiquidityETH

func (r *E2ERunner) AddLiquidityETH(amountZETA, amountETH *big.Int)

AddLiquidityETH adds liquidity token to the uniswap pool ZETA/ETH

func (*E2ERunner) AddLiquiditySOL

func (r *E2ERunner) AddLiquiditySOL(amountZETA, amountSOL *big.Int)

AddLiquiditySOL adds liquidity token to the uniswap pool ZETA/SOL

func (*E2ERunner) AddLiquiditySPL

func (r *E2ERunner) AddLiquiditySPL(amountZETA, amountSPL *big.Int)

AddLiquiditySPL adds liquidity token to the uniswap pool ZETA/SPL

func (*E2ERunner) AddLiquiditySUI

func (r *E2ERunner) AddLiquiditySUI(amountZETA, amountSUI *big.Int)

AddLiquiditySUI adds liquidity token to the uniswap pool ZETA/SUI

func (*E2ERunner) AddLiquiditySuiFungibleToken

func (r *E2ERunner) AddLiquiditySuiFungibleToken(amountZETA, amountToken *big.Int)

AddLiquiditySuiFungibleToken adds liquidity token to the uniswap pool ZETA/SuiFungibleToken

func (*E2ERunner) AddLiquidityTON

func (r *E2ERunner) AddLiquidityTON(amountZETA, amountTON *big.Int)

AddLiquidityTON adds liquidity token to the uniswap pool ZETA/TON

func (*E2ERunner) AddPostUpgradeHandler

func (r *E2ERunner) AddPostUpgradeHandler(upgradeFrom string, postHandler func())

AddPostUpgradeHandler adds a handler to run any logic after and upgrade to enable tests to be executed Note This is handler is not related to the cosmos-sdk upgrade handler in any way

func (*E2ERunner) AddPreUpgradeHandler

func (r *E2ERunner) AddPreUpgradeHandler(upgradeFrom string, preHandler func())

AddPreUpgradeHandler adds a handler to run any logic before an upgrade

func (*E2ERunner) AddTSSToNode

func (r *E2ERunner) AddTSSToNode()

func (*E2ERunner) AnvilMineBlocks

func (r *E2ERunner) AnvilMineBlocks(url string, blockTime int) (func(), error)

AnvilMineBlocks mines blocks on Anvil localnet the block time is provided in seconds the method returns a function to stop the mining

func (*E2ERunner) ApproveBTCZRC20

func (r *E2ERunner) ApproveBTCZRC20(allowed ethcommon.Address)

ApproveBTCZRC20 approves BTC ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveERC20OnEVM

func (r *E2ERunner) ApproveERC20OnEVM(allowed ethcommon.Address)

ApproveERC20OnEVM approves ERC20 on EVM to a specific address check if allowance is zero before calling this method allow a high amount to avoid multiple approvals

func (*E2ERunner) ApproveERC20ZRC20

func (r *E2ERunner) ApproveERC20ZRC20(allowed ethcommon.Address)

ApproveERC20ZRC20 approves ERC20 ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveETHZRC20

func (r *E2ERunner) ApproveETHZRC20(allowed ethcommon.Address)

ApproveETHZRC20 approves ETH ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveFungibleTokenZRC20

func (r *E2ERunner) ApproveFungibleTokenZRC20(allowed ethcommon.Address)

ApproveFungibleTokenZRC20 approves Sui fungible token ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveSOLZRC20

func (r *E2ERunner) ApproveSOLZRC20(allowed ethcommon.Address)

ApproveSOLZRC20 approves SOL ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveSPLZRC20

func (r *E2ERunner) ApproveSPLZRC20(allowed ethcommon.Address)

ApproveSPLZRC20 approves SPL ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveSUIZRC20

func (r *E2ERunner) ApproveSUIZRC20(allowed ethcommon.Address)

ApproveSUIZRC20 approves SUI ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveTONZRC20

func (r *E2ERunner) ApproveTONZRC20(allowed ethcommon.Address)

ApproveTONZRC20 approves TON ZRC20 on EVM to a specific address

func (*E2ERunner) ApproveZetaOnEVM

func (r *E2ERunner) ApproveZetaOnEVM(allowed ethcommon.Address)

func (*E2ERunner) AssertAfterUpgrade

func (r *E2ERunner) AssertAfterUpgrade(assertVersion string, assertFunc func())

func (*E2ERunner) AssertTestDAppEVMCalled

func (r *E2ERunner) AssertTestDAppEVMCalled(expectedCalled bool, message string, amount *big.Int)

AssertTestDAppEVMCalled is a function that asserts the values of the test dapp on the external EVM

func (*E2ERunner) AssertTestDAppZEVMCalled

func (r *E2ERunner) AssertTestDAppZEVMCalled(expectedCalled bool, message string, sender []byte, amount *big.Int)

AssertTestDAppZEVMCalled is a function that asserts the values of the test dapp on the ZEVM this function uses TestDAppV2 for the assertions, in the future we should only use this contracts for all tests https://github.com/zeta-chain/node/issues/2655

func (*E2ERunner) BitcoinCalcReceivedAmount

func (r *E2ERunner) BitcoinCalcReceivedAmount(depositTx *btcjson.TxRawResult, depositedAmount int64) int64

BitcoinCalcReceivedAmount calculates the amount received by the receiver after deducting the depositor fee

func (*E2ERunner) BitcoinEstimateFeeRate

func (r *E2ERunner) BitcoinEstimateFeeRate(confTarget int64) uint64

BitcoinEstimateFeeRate returns the estimated fee rate in sat/vB for live networks

func (*E2ERunner) BroadcastTxSync

func (r *E2ERunner) BroadcastTxSync(tx *solana.Transaction) (solana.Signature, *rpc.GetTransactionResult)

BroadcastTxSync broadcasts a transaction and waits for it to be finalized

func (*E2ERunner) BroadcastTxSyncOnce

func (r *E2ERunner) BroadcastTxSyncOnce(tx *solana.Transaction) (solana.Signature, *rpc.GetTransactionResult, bool)

BroadcastTxSyncOnce broadcasts a transaction once and checks if it's confirmed

func (*E2ERunner) CallSOLZRC20

func (r *E2ERunner) CallSOLZRC20(
	to solana.PublicKey,
	approveAmount *big.Int,
	data []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

CallSOLZRC20 calls program on solana

func (*E2ERunner) CheckBTCTSSBalance

func (r *E2ERunner) CheckBTCTSSBalance()

func (*E2ERunner) CheckSUITSSBalance

func (r *E2ERunner) CheckSUITSSBalance()

CheckSUITSSBalance checks the TSS balance on Sui against the ZRC20 total supply

func (*E2ERunner) CheckSolanaTSSBalance

func (r *E2ERunner) CheckSolanaTSSBalance()

CheckSolanaTSSBalance compares the gateway PDA balance with the total supply of the SOL ZRC20 on ZetaChain

func (*E2ERunner) ComputePdaAddress

func (r *E2ERunner) ComputePdaAddress() solana.PublicKey

ComputePdaAddress computes the PDA address for the gateway program

func (*E2ERunner) CopyAddressesFrom

func (r *E2ERunner) CopyAddressesFrom(other *E2ERunner) (err error)

CopyAddressesFrom copies addresses from another E2ETestRunner that initialized the contracts

func (*E2ERunner) CreateDepositInstruction

func (r *E2ERunner) CreateDepositInstruction(
	signer solana.PublicKey,
	receiver ethcommon.Address,
	data []byte,
	amount uint64,
	revertOptions *solanacontract.RevertOptions,
) solana.Instruction

CreateDepositInstruction creates a 'deposit' instruction

func (*E2ERunner) CreateDepositInstructionThroughProgram

func (r *E2ERunner) CreateDepositInstructionThroughProgram(
	signer solana.PublicKey,
	receiver ethcommon.Address,
	amount uint64,
	revertOptions *solanacontract.RevertOptions,
) solana.Instruction

CreateDepositInstructionThroughProgram creates a 'trigger_deposit' instruction for connected example program

func (*E2ERunner) CreateDepositSPLInstruction

func (r *E2ERunner) CreateDepositSPLInstruction(
	amount uint64,
	signer solana.PublicKey,
	whitelistEntry solana.PublicKey,
	mint solana.PublicKey,
	from solana.PublicKey,
	to solana.PublicKey,
	receiver ethcommon.Address,
	data []byte,
	revertOptions *solanacontract.RevertOptions,
) solana.Instruction

CreateDepositSPLInstruction creates a 'deposit_spl' instruction

func (*E2ERunner) CreateGovProposals

func (r *E2ERunner) CreateGovProposals(sequence ExecuteProposalSequence) error

CreateGovProposals creates and votes on proposals from the given directory The directory should contain JSON files with the correct proposal format The directories currently used are: - /contrib/orchestrator/proposals_e2e_start - /contrib/orchestrator/proposals_e2e_end

func (*E2ERunner) CreateSOLCallInstruction

func (r *E2ERunner) CreateSOLCallInstruction(
	signer solana.PublicKey,
	receiver ethcommon.Address,
	data []byte,
	revertOptions *solanacontract.RevertOptions,
) solana.Instruction

CreateSOLCallInstruction creates a 'call' instruction

func (*E2ERunner) CreateSignedTransaction

func (r *E2ERunner) CreateSignedTransaction(
	instructions []solana.Instruction,
	privateKey solana.PrivateKey,
	additionalPrivateKeys []solana.PrivateKey,
) *solana.Transaction

CreateSignedTransaction creates a signed transaction from instructions

func (*E2ERunner) CreateWhitelistSPLMintInstruction

func (r *E2ERunner) CreateWhitelistSPLMintInstruction(
	signer, whitelistEntry, whitelistCandidate solana.PublicKey,
) solana.Instruction

CreateWhitelistSPLMintInstruction creates a 'whitelist_spl_mint' instruction

func (*E2ERunner) DeployCoreRegistry

func (r *E2ERunner) DeployCoreRegistry()

DeployCoreRegistry deploys the CoreRegistry contract with proxy

func (*E2ERunner) DeploySPL

func (r *E2ERunner) DeploySPL(privateKey *solana.PrivateKey, whitelist bool) *solana.Wallet

func (*E2ERunner) DeployTestDAppV2EVM

func (r *E2ERunner) DeployTestDAppV2EVM()

DeployTestDAppV2EVM deploys the test DApp V2 contract for EVM

func (*E2ERunner) DeployTestDAppV2ZEVM

func (r *E2ERunner) DeployTestDAppV2ZEVM()

DeployTestDAppV2ZEVM deploys the test DApp V2 contract

func (*E2ERunner) DeployZetaConnectorNative

func (r *E2ERunner) DeployZetaConnectorNative()

DeployZetaConnectorNative deploys the ZetaConnectorNative contract with proxy

func (*E2ERunner) DepositBTC

func (r *E2ERunner) DepositBTC(receiver common.Address)

DepositBTC deposits BTC from the Bitcoin node wallet into ZEVM address.

func (*E2ERunner) DepositBTCWithAmount

func (r *E2ERunner) DepositBTCWithAmount(amount float64, memo *memo.InboundMemo) *chainhash.Hash

DepositBTCWithAmount deposits 'amount' of BTC to TSS address with the given memo

func (*E2ERunner) DepositBTCWithExactAmount

func (r *E2ERunner) DepositBTCWithExactAmount(amount float64, memo *memo.InboundMemo) *chainhash.Hash

DepositBTCWithExactAmount deposits exact 'amount' of BTC to receiver ZEVM address It automatically adds the depositor fee so that the receiver gets the exact 'amount' in ZetaChain

func (*E2ERunner) DepositERC20ToDeployer

func (r *E2ERunner) DepositERC20ToDeployer() ethcommon.Hash

DepositERC20ToDeployer sends ERC20 into ZEVM using v2 protocol contracts

func (*E2ERunner) DepositEtherToDeployer

func (r *E2ERunner) DepositEtherToDeployer() ethcommon.Hash

DepositEtherToDeployer sends Ethers into ZEVM using V2 protocol contracts

func (*E2ERunner) DepositWZeta

func (r *E2ERunner) DepositWZeta(amount *big.Int)

DepositWZeta deposits WZETA on ZetaChain

func (*E2ERunner) DepositZETAToDeployer

func (r *E2ERunner) DepositZETAToDeployer() *ethtypes.Transaction

DepositZETAToDeployer deposits ZETA into ZEVM using v2 protocol contracts

func (*E2ERunner) DonateBTC

func (r *E2ERunner) DonateBTC()

DonateBTC donates BTC from the Bitcoin node wallet to the TSS address.

func (*E2ERunner) DonateEtherToTSS

func (r *E2ERunner) DonateEtherToTSS(amount *big.Int) (*ethtypes.Transaction, error)

DonateEtherToTSS donates ether to TSS

func (*E2ERunner) ERC20Deposit

func (r *E2ERunner) ERC20Deposit(
	receiver ethcommon.Address,
	amount *big.Int,
	revertOptions gatewayevm.RevertOptions,
) *ethtypes.Transaction

ERC20Deposit calls Deposit of Gateway with erc20 token on EVM

func (*E2ERunner) ERC20DepositAndCall

func (r *E2ERunner) ERC20DepositAndCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayevm.RevertOptions,
) *ethtypes.Transaction

ERC20DepositAndCall calls DepositAndCall of Gateway with erc20 token on EVM

func (*E2ERunner) ERC20Withdraw

func (r *E2ERunner) ERC20Withdraw(
	receiver ethcommon.Address,
	amount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ERC20Withdraw calls Withdraw of Gateway with erc20 token on ZEVM

func (*E2ERunner) ERC20WithdrawAndArbitraryCall

func (r *E2ERunner) ERC20WithdrawAndArbitraryCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ERC20WithdrawAndArbitraryCall calls WithdrawAndCall of Gateway with erc20 token on ZEVM using arbitrary call

func (*E2ERunner) ERC20WithdrawAndCall

func (r *E2ERunner) ERC20WithdrawAndCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
	gasLimit *big.Int,
) *ethtypes.Transaction

ERC20WithdrawAndCall calls WithdrawAndCall of Gateway with erc20 token on ZEVM using authenticated call

func (*E2ERunner) ETHDeposit

func (r *E2ERunner) ETHDeposit(
	receiver ethcommon.Address,
	amount *big.Int,
	revertOptions gatewayevm.RevertOptions,
	wait bool,
) *ethtypes.Transaction

ETHDeposit calls Deposit of Gateway with gas token on EVM

func (*E2ERunner) ETHDepositAndCall

func (r *E2ERunner) ETHDepositAndCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayevm.RevertOptions,
) *ethtypes.Transaction

ETHDepositAndCall calls DepositAndCall of Gateway with gas token on EVM

func (*E2ERunner) ETHWithdraw

func (r *E2ERunner) ETHWithdraw(
	receiver ethcommon.Address,
	amount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ETHWithdraw calls Withdraw of Gateway with gas token on ZEVM

func (*E2ERunner) ETHWithdrawAndArbitraryCall

func (r *E2ERunner) ETHWithdrawAndArbitraryCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ETHWithdrawAndArbitraryCall calls WithdrawAndCall of Gateway with gas token on ZEVM using arbitrary call

func (*E2ERunner) ETHWithdrawAndCall

func (r *E2ERunner) ETHWithdrawAndCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
	gasLimit *big.Int,
) *ethtypes.Transaction

ETHWithdrawAndCall calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call

func (*E2ERunner) ETHWithdrawAndCallThroughContract

func (r *E2ERunner) ETHWithdrawAndCallThroughContract(
	gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller,
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayzevmcaller.RevertOptions,
) *ethtypes.Transaction

ETHWithdrawAndCallThroughContract calls WithdrawAndCall of Gateway with gas token on ZEVM using authenticated call through contract

func (*E2ERunner) EVMAddress

func (r *E2ERunner) EVMAddress() ethcommon.Address

EVMAddress is shorthand to get the EVM address of the account

func (*E2ERunner) EVMToZEMVCall

func (r *E2ERunner) EVMToZEMVCall(
	receiver ethcommon.Address,
	payload []byte,
	revertOptions gatewayevm.RevertOptions,
) *ethtypes.Transaction

EVMToZEMVCall calls Call of Gateway on EVM

func (*E2ERunner) EVMVerifyOutboundTransferAmount

func (r *E2ERunner) EVMVerifyOutboundTransferAmount(outboundHash string, amount int64)

EVMVerifyOutboundTransferAmount verifies the transfer amount on EVM chain for given outbound hash

func (*E2ERunner) EnableHeaderVerification

func (r *E2ERunner) EnableHeaderVerification(chainIDList []int64) error

EnableHeaderVerification enables the header verification for the given chain IDs

func (*E2ERunner) EnableV2ZETAFlows

func (r *E2ERunner) EnableV2ZETAFlows() error

EnableV2ZETAFlows sends a message to enable V2 ZETA gateway flows

func (*E2ERunner) EncodeERC20Call

func (r *E2ERunner) EncodeERC20Call(erc20Addr ethcommon.Address, amount *big.Int, message string) []byte

EncodeERC20Call encodes the payload for the erc20Call function

func (*E2ERunner) EncodeERC20CallRevert

func (r *E2ERunner) EncodeERC20CallRevert(erc20Addr ethcommon.Address, amount *big.Int) []byte

EncodeERC20CallRevert encodes the payload for the erc20Call function that reverts

func (*E2ERunner) EncodeGasCall

func (r *E2ERunner) EncodeGasCall(message string) []byte

EncodeGasCall encodes the payload for the gasCall function

func (*E2ERunner) EncodeGasCallRevert

func (r *E2ERunner) EncodeGasCallRevert() []byte

EncodeGasCallRevert encodes the payload for the gasCall function that reverts

func (*E2ERunner) EncodeSimpleCall

func (r *E2ERunner) EncodeSimpleCall(message string) []byte

EncodeSimpleCall encodes the payload for the simpleCall function

func (*E2ERunner) EnsureNoStaleBallots

func (r *E2ERunner) EnsureNoStaleBallots()

EnsureNoStaleBallots ensures that there are no stale ballots left on the chain.

func (*E2ERunner) EnsureNoTrackers

func (r *E2ERunner) EnsureNoTrackers()

EnsureNoTrackers ensures that there are no trackers left on zetacore

func (*E2ERunner) EnsureZeroBalanceOnRestrictedAddressZEVM

func (r *E2ERunner) EnsureZeroBalanceOnRestrictedAddressZEVM()

EnsureZeroBalanceOnRestrictedAddressZEVM ensures that the balance of the restricted address is zero in the ZEVM

func (*E2ERunner) Errorf

func (r *E2ERunner) Errorf(format string, args ...any)

Errorf logs an error message. Mimics the behavior of testing.T.Errorf

func (*E2ERunner) FailNow

func (r *E2ERunner) FailNow()

FailNow implemented to mimic the behavior of testing.T.FailNow

func (*E2ERunner) FetchWithdrawableEmissions

func (r *E2ERunner) FetchWithdrawableEmissions(observer string) (sdk.Coin, error)

func (*E2ERunner) FundEmissionsPool

func (r *E2ERunner) FundEmissionsPool() error

FundEmissionsPool funds the emissions pool on ZetaChain with the same value as used originally on mainnet (20M ZETA)

func (*E2ERunner) GenerateNetworkReport

func (r *E2ERunner) GenerateNetworkReport() (NetworkReport, error)

GenerateNetworkReport generates a report for the network used after running e2e tests

func (*E2ERunner) GenerateToAddressIfLocalBitcoin

func (r *E2ERunner) GenerateToAddressIfLocalBitcoin(
	numBlocks int64,
	address btcutil.Address,
) ([]*chainhash.Hash, error)

GenerateToAddressIfLocalBitcoin generates blocks to an address if the runner is interacting with a local bitcoin network

func (*E2ERunner) GetAccountBalances

func (r *E2ERunner) GetAccountBalances(network string) (AccountBalances, error)

GetAccountBalances returns the account balances of the accounts used in the E2E test. The network parameter controls which external chain's native balance is queried:

  • EVM chains ("polygon", "bsc", "eth", "base", "arbitrum", "avalanche") → external chain native balances
  • "btc" → BTC balance
  • "solana" → Solana SOL + SPL balances
  • "sui" → Sui SUI + token balances
  • "ton" → TON balance
  • "zevm" → safe default, no external chain native balances

ZEVM and EVM balances are always queried: ZEVM because all cross-chain operations go through ZetaChain, and EVM because GetAccountBalancesDiff needs them for gas reporting.

func (*E2ERunner) GetBitcoinBalance

func (r *E2ERunner) GetBitcoinBalance() (string, error)

GetBitcoinBalance returns the spendable BTC balance of the BTC address

func (*E2ERunner) GetBitcoinBalanceByAddress

func (r *E2ERunner) GetBitcoinBalanceByAddress(address btcutil.Address) (btcutil.Amount, error)

GetBitcoinBalanceByAddress get btc balance by address.

func (*E2ERunner) GetBitcoinChainID

func (r *E2ERunner) GetBitcoinChainID() int64

GetBitcoinChainID gets the bitcoin chain ID from the network params

func (*E2ERunner) GetBtcAddress

func (r *E2ERunner) GetBtcAddress() *btcutil.AddressWitnessPubKeyHash

GetBtcAddress returns the BTC address of the runner account

func (*E2ERunner) GetBtcKeypair

func (r *E2ERunner) GetBtcKeypair() (*btcutil.AddressWitnessPubKeyHash, *btcutil.WIF)

GetBtcKeypair returns the BTC address of the runner account and private key in WIF format

func (*E2ERunner) GetE2ETestsToRunByConfig

func (r *E2ERunner) GetE2ETestsToRunByConfig(
	availableTests []E2ETest,
	testConfigs []E2ETestRunConfig,
) ([]E2ETest, error)

GetE2ETestsToRunByConfig prepares a list of E2ETests to run based on provided test names and their corresponding arguments

func (*E2ERunner) GetE2ETestsToRunByName

func (r *E2ERunner) GetE2ETestsToRunByName(availableTests []E2ETest, testNames ...string) ([]E2ETest, error)

GetE2ETestsToRunByName prepares a list of E2ETests to run based on given test names without arguments

func (*E2ERunner) GetSolanaPrivKey

func (r *E2ERunner) GetSolanaPrivKey() solana.PrivateKey

func (*E2ERunner) GetTop20UTXOsForTssAddress

func (r *E2ERunner) GetTop20UTXOsForTssAddress() ([]btcjson.ListUnspentResult, error)

GetTop20UTXOsForTssAddress returns the top 20 UTXOs for the TSS address. Top 20 utxos should be used for TSS migration, as we can only migrate at max 20 utxos at a time.

func (*E2ERunner) GetZetacoredVersion

func (r *E2ERunner) GetZetacoredVersion() string

func (*E2ERunner) InitializeBTCChainParams

func (r *E2ERunner) InitializeBTCChainParams()

InitializeBTCChainParams initializes the values for the chain params of the BTC chain it updates the ticker values

func (*E2ERunner) InitializeChainParams

func (r *E2ERunner) InitializeChainParams(testLegacy bool)

InitializeChainParams initializes the values for the chain params of the EVM and BTC chains

func (*E2ERunner) InitializeEVMChainParams

func (r *E2ERunner) InitializeEVMChainParams(testLegacy bool)

InitializeEVMChainParams initializes the values for the chain params of the EVM chain it update the erc20 custody contract and gateway address in the chain params and the ticker values TODO: should be used for all protocol contracts including the ZETA connector https://github.com/zeta-chain/node/issues/3257

func (*E2ERunner) InscribeToTSSWithMemo

func (r *E2ERunner) InscribeToTSSWithMemo(
	amount float64,
	memo []byte,
	feeRate int64,
) (*btcjson.TxRawResult, int64, string)

func (*E2ERunner) IsLocalBitcoin

func (r *E2ERunner) IsLocalBitcoin() bool

IsLocalBitcoin returns true if the runner is running on a local bitcoin network

func (*E2ERunner) IsRunningTssMigration

func (r *E2ERunner) IsRunningTssMigration() bool

func (*E2ERunner) IsRunningUpgrade

func (r *E2ERunner) IsRunningUpgrade() bool

IsRunningUpgrade returns true if the test is running an upgrade test suite.

func (*E2ERunner) IsRunningUpgradeOrTSSMigration

func (r *E2ERunner) IsRunningUpgradeOrTSSMigration() bool

func (*E2ERunner) IsRunningZetaclientOnlyUpgrade

func (r *E2ERunner) IsRunningZetaclientOnlyUpgrade() bool

func (*E2ERunner) IsV2ZETAEnabled

func (r *E2ERunner) IsV2ZETAEnabled() bool

IsV2ZETAEnabled checks if V2 ZETA gateway flows are enabled Returns false if crosschain flags are not set on the network

func (*E2ERunner) LegacyDepositAndApproveWZeta

func (r *E2ERunner) LegacyDepositAndApproveWZeta(amount *big.Int)

LegacyDepositAndApproveWZeta deposits and approves WZETA on ZetaChain from the ZETA smart contract on ZEVM using legacy protocol contracts

func (*E2ERunner) LegacyDepositERC20

func (r *E2ERunner) LegacyDepositERC20() ethcommon.Hash

LegacyDepositERC20 sends ERC20 into ZEVM using legacy protocol contracts

func (*E2ERunner) LegacyDepositERC20WithAmountAndMessage

func (r *E2ERunner) LegacyDepositERC20WithAmountAndMessage(
	to ethcommon.Address,
	amount *big.Int,
	msg []byte,
) ethcommon.Hash

LegacyDepositERC20WithAmountAndMessage sends ERC20 into ZEVM using legacy protocol contracts

func (*E2ERunner) LegacyDepositEther

func (r *E2ERunner) LegacyDepositEther() ethcommon.Hash

LegacyDepositEther sends Ethers into ZEVM using legacy protocol contracts using legacy protocol contracts

func (*E2ERunner) LegacyDepositEtherWithAmount

func (r *E2ERunner) LegacyDepositEtherWithAmount(amount *big.Int) ethcommon.Hash

LegacyDepositEtherWithAmount sends Ethers into ZEVM

func (*E2ERunner) LegacyDepositZeta

func (r *E2ERunner) LegacyDepositZeta() ethcommon.Hash

LegacyDepositZeta deposits ZETA on ZetaChain from the ZETA smart contract on EVM using legacy protocol contracts

func (*E2ERunner) LegacyDepositZetaWithAmount

func (r *E2ERunner) LegacyDepositZetaWithAmount(to ethcommon.Address, amount *big.Int) ethcommon.Hash

LegacyDepositZetaWithAmount deposits ZETA on ZetaChain from the ZETA smart contract on EVM with the specified amount using legacy protocol contracts

func (*E2ERunner) LegacyDepositZetaWithAmountAndPayload

func (r *E2ERunner) LegacyDepositZetaWithAmountAndPayload(
	to ethcommon.Address,
	amount *big.Int,
	payload []byte,
) ethcommon.Hash

LegacyDepositZetaWithAmountAndPayload deposits ZETA on ZetaChain from the ZETA smart contract on EVM with the specified amount and payload using legacy protocol contracts

func (*E2ERunner) LegacySendEther

func (r *E2ERunner) LegacySendEther(_ ethcommon.Address, value *big.Int, data []byte) (*ethtypes.Transaction, error)

LegacySendEther sends ethers to the TSS on EVM using legacy protocol contracts

func (*E2ERunner) LegacySetEVMContractsFromConfig

func (r *E2ERunner) LegacySetEVMContractsFromConfig()

LegacySetEVMContractsFromConfig set legacy EVM contracts for e2e test from the config

func (*E2ERunner) LegacySetupEVM

func (r *E2ERunner) LegacySetupEVM(contractsDeployed bool, legacyTestRunning bool)

LegacySetupEVM setup legacy contracts on EVM for e2e test

func (*E2ERunner) LegacyWithdrawERC20

func (r *E2ERunner) LegacyWithdrawERC20(amount *big.Int) *ethtypes.Transaction

LegacyWithdrawERC20 withdraws an ERC20 token from ZetaChain to the ZETA smart contract on EVM using legacy protocol contracts

func (*E2ERunner) LegacyWithdrawEther

func (r *E2ERunner) LegacyWithdrawEther(amount *big.Int) *ethtypes.Transaction

LegacyWithdrawEther withdraws Ether from ZetaChain to the ZETA smart contract on EVM using legacy protocol contracts

func (*E2ERunner) LegacyWithdrawZeta

func (r *E2ERunner) LegacyWithdrawZeta(amount *big.Int, waitReceipt bool) *ethtypes.Transaction

LegacyWithdrawZeta withdraws ZETA from ZetaChain to the ZETA smart contract on EVM using legacy protocol contracts waitReceipt specifies whether to wait for the tx receipt and check if the tx was successful

func (*E2ERunner) ListUTXOs

func (r *E2ERunner) ListUTXOs() []btcjson.ListUnspentResult

ListUTXOs list the deployer's UTXOs

func (*E2ERunner) Lock

func (r *E2ERunner) Lock()

Lock locks the mutex

func (*E2ERunner) MineBlocksIfLocalBitcoin

func (r *E2ERunner) MineBlocksIfLocalBitcoin() func()

MineBlocksIfLocalBitcoin mines blocks on the local BTC chain at a rate of 1 blocks every 5 seconds and returns a channel that can be used to stop the mining If the chain is not local, the function does nothing

func (*E2ERunner) MintERC20OnEVM

func (r *E2ERunner) MintERC20OnEVM(amountERC20 int64)

MintERC20OnEVM mints ERC20 on EVM amount is a multiple of 1e18

func (*E2ERunner) ParseConnectedPda

func (r *E2ERunner) ParseConnectedPda(connectedPda solana.PublicKey) ConnectedPdaInfo

ParseConnectedPda deserializes connectedPda into ConnectedPdaInfo struct

func (*E2ERunner) PrintAccountBalances

func (r *E2ERunner) PrintAccountBalances(balances AccountBalances, network string)

PrintAccountBalances shows the account balances of the accounts used in the E2E test. Only sections relevant to the given network are printed. Note: USDT is mentioned as erc20 here because we want to show the balance of any erc20 contract

func (*E2ERunner) PrintContractAddresses

func (r *E2ERunner) PrintContractAddresses()

PrintContractAddresses prints the addresses of the contracts the printed contracts are grouped in a zevm and evm section there is a padding used to print the addresses at the same position

func (*E2ERunner) PrintNetworkReport

func (r *E2ERunner) PrintNetworkReport(nr NetworkReport)

PrintNetworkReport prints the network report

func (*E2ERunner) PrintTestReports

func (r *E2ERunner) PrintTestReports(tr TestReports)

PrintTestReports prints the test reports

func (*E2ERunner) PrintTotalDiff

func (r *E2ERunner) PrintTotalDiff(diffs AccountBalancesDiff)

PrintTotalDiff shows the difference in the account balances of the accounts used in the e2e test from two balances structs

func (*E2ERunner) QueryOutboundReceiverAndAmount

func (r *E2ERunner) QueryOutboundReceiverAndAmount(txid string) (string, int64)

QueryOutboundReceiverAndAmount queries the outbound receiver and amount (in satoshis) from the given txid

func (*E2ERunner) RemoveObserver

func (r *E2ERunner) RemoveObserver() error

func (*E2ERunner) RequestSuiFromFaucet

func (r *E2ERunner) RequestSuiFromFaucet(faucetURL, recipient string)

RequestSuiFromFaucet requests SUI tokens from the faucet for the runner account

func (*E2ERunner) ResolveSolanaATA

func (r *E2ERunner) ResolveSolanaATA(
	payer solana.PrivateKey,
	owner solana.PublicKey,
	mintAccount solana.PublicKey,
) solana.PublicKey

ResolveSolanaATA finds or creates SOL associated token account

func (*E2ERunner) RunE2ETest

func (r *E2ERunner) RunE2ETest(e2eTest E2ETest) error

RunE2ETest runs a e2e test

func (*E2ERunner) RunE2ETests

func (r *E2ERunner) RunE2ETests(e2eTests []E2ETest) (err error)

RunE2ETests runs a list of e2e tests

func (*E2ERunner) RunE2ETestsIntoReport

func (r *E2ERunner) RunE2ETestsIntoReport(e2eTests []E2ETest) (TestReports, error)

RunE2ETestsIntoReport runs a list of e2e tests by name in a list of e2e tests and returns a report The function doesn't return an error, it returns a report with the error

func (*E2ERunner) RunGatewayUpgradeTestsExternalChains

func (r *E2ERunner) RunGatewayUpgradeTestsExternalChains(conf config.Config, opts UpgradeGatewayOptions)

RunGatewayUpgradeTestsExternalChains runs the gateway upgrade tests for external chains

func (*E2ERunner) RunSetup

func (r *E2ERunner) RunSetup()

func (*E2ERunner) SOLCall

func (r *E2ERunner) SOLCall(
	signerPrivKey *solana.PrivateKey,
	receiver ethcommon.Address,
	data []byte,
	revertOptions *solanacontract.RevertOptions,
) solana.Signature

SOLCall calls a contract on zevm

func (*E2ERunner) SOLDepositAndCall

func (r *E2ERunner) SOLDepositAndCall(
	signerPrivKey *solana.PrivateKey,
	receiver ethcommon.Address,
	amount *big.Int,
	data []byte,
	revertOptions *solanacontract.RevertOptions,
) solana.Signature

SOLDepositAndCall deposits an amount of ZRC20 SOL tokens (in lamports) and calls a contract (if data is provided)

func (*E2ERunner) SOLDepositAndCallThroughProgram

func (r *E2ERunner) SOLDepositAndCallThroughProgram(
	signerPrivKey *solana.PrivateKey,
	receiver ethcommon.Address,
	amount *big.Int,
	revertOptions *solanacontract.RevertOptions,
) solana.Signature

SOLDepositAndCallThroughProgram deposits an amount of ZRC20 SOL tokens (in lamports) through program

func (*E2ERunner) SPLDepositAndCall

func (r *E2ERunner) SPLDepositAndCall(
	privateKey *solana.PrivateKey,
	amount uint64,
	mintAccount solana.PublicKey,
	receiver ethcommon.Address,
	data []byte,
	revertOptions *solanacontract.RevertOptions,
) solana.Signature

SPLDepositAndCall deposits an amount of SPL tokens and calls a contract (if data is provided)

func (*E2ERunner) SelectUTXOs

func (r *E2ERunner) SelectUTXOs(amount btcutil.Amount) ([]btcjson.ListUnspentResult, btcutil.Amount)

SelectUTXOs selects a subset of deployer's UTXOs to cover the given amount

func (*E2ERunner) SendERC20OnEVM

func (r *E2ERunner) SendERC20OnEVM(address ethcommon.Address, amountERC20 int64) *ethtypes.Transaction

SendERC20OnEVM sends ERC20 to an address on EVM this allows the ERC20 contract deployer to funds other accounts on EVM amountERC20 is a multiple of 1e18

func (*E2ERunner) SendToTSSWithMemo

func (r *E2ERunner) SendToTSSWithMemo(
	amount float64,
	memo []byte,
) (*chainhash.Hash, error)

func (*E2ERunner) SendWithdrawTONZRC20

func (r *E2ERunner) SendWithdrawTONZRC20(
	to ton.AccountID,
	amount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

SendWithdrawTONZRC20 sends withdraw tx of TON ZRC20 tokens

func (*E2ERunner) SendZetaOnEVM

func (r *E2ERunner) SendZetaOnEVM(address ethcommon.Address, zetaAmount int64) *ethtypes.Transaction

SendZetaOnEVM sends ZETA to an address on EVM.This can be used to fund an account to run tests

func (*E2ERunner) SetTSSAddresses

func (r *E2ERunner) SetTSSAddresses() error

SetTSSAddresses set TSS addresses from information queried from ZetaChain

func (*E2ERunner) SetupBTCZRC20

func (r *E2ERunner) SetupBTCZRC20()

SetupBTCZRC20 sets up the BTC ZRC20 in the runner from the values queried from the chain

func (*E2ERunner) SetupBitcoinAccounts

func (r *E2ERunner) SetupBitcoinAccounts(createWallet bool)

SetupBitcoinAccounts sets up the TSS account and deployer account

func (*E2ERunner) SetupBtcAddress

func (r *E2ERunner) SetupBtcAddress(createWallet bool)

SetupBtcAddress setups the deployer Bitcoin address

func (*E2ERunner) SetupETHZRC20

func (r *E2ERunner) SetupETHZRC20()

SetupETHZRC20 sets up the ETH ZRC20 in the runner from the values queried from the chain

func (*E2ERunner) SetupEVM

func (r *E2ERunner) SetupEVM()

SetupEVM setup contracts on EVM with v2 contracts

func (*E2ERunner) SetupLegacyZEVMContracts

func (r *E2ERunner) SetupLegacyZEVMContracts()

SetupLegacyZEVMContracts sets up the legacy contracts on ZEVM In particular it deploys test contracts used with the protocol contracts v1

func (*E2ERunner) SetupSOLZRC20

func (r *E2ERunner) SetupSOLZRC20()

SetupSOLZRC20 sets up the SOL ZRC20 in the runner from the values queried from the chain

func (*E2ERunner) SetupSUIZRC20

func (r *E2ERunner) SetupSUIZRC20()

SetupSUIZRC20 sets up the SUI ZRC20 in the runner from the values queried from the chain

func (*E2ERunner) SetupSolana

func (r *E2ERunner) SetupSolana(gatewayID, deployerPrivateKey, splAccountPrivateKey string)

SetupSolana sets Solana contracts and params

func (*E2ERunner) SetupSolanaAccount

func (r *E2ERunner) SetupSolanaAccount()

SetupSolanaAccount imports the deployer's private key

func (*E2ERunner) SetupSui

func (r *E2ERunner) SetupSui(faucetURL string)

SetupSui initializes the gateway package on Sui and initialize the chain params on ZetaChain

func (*E2ERunner) SetupTON

func (r *E2ERunner) SetupTON(faucetURL string, userTON config.Account)

SetupTON setups TON deployer and deploys Gateway contract

func (*E2ERunner) SetupTONZRC20

func (r *E2ERunner) SetupTONZRC20()

SetupTONZRC20 sets up the TON ZRC20 in the runner from the values queried from the chain

func (*E2ERunner) SetupTestAddressLookupTableWithRandomWallets

func (r *E2ERunner) SetupTestAddressLookupTableWithRandomWallets(
	accounts []solana.PublicKey,
) (solana.PublicKey, []solana.PublicKey)

SetupTestAddressLookupTableWithRandomWallets sets up AddressLookupTable with random accounts provided in setup solana script, with accounts provided as argument used to test AddressLookupTables with large amount of accounts

func (*E2ERunner) SetupTestAddressLookupTableWithRandomWalletsSPL

func (r *E2ERunner) SetupTestAddressLookupTableWithRandomWalletsSPL(
	accounts []solana.PublicKey,
) (solana.PublicKey, []solana.PublicKey)

SetupTestAddressLookupTableWithRandomWallets sets up AddressLookupTable with random accounts provided in setup solana script, with accounts provided as argument using only 10 accounts because this is creating ATAs, and point is not to test accounts amount, just execute SPL functionality

func (*E2ERunner) SetupZEVM

func (r *E2ERunner) SetupZEVM()

SetupZEVM setup protocol contracts for the ZEVM

func (*E2ERunner) SetupZRC20

func (r *E2ERunner) SetupZRC20(zrc20Deployment txserver.ZRC20Deployment)

SetupZRC20 setup ZRC20 for the ZEVM

func (*E2ERunner) SolanaVerifyGatewayContractsUpgrade

func (r *E2ERunner) SolanaVerifyGatewayContractsUpgrade(deployerPrivateKey string)

SolanaVerifyGatewayContractsUpgrade upgrades the Solana contracts and verifies the upgrade

func (*E2ERunner) SolanaVerifyWithdrawalAmount

func (r *E2ERunner) SolanaVerifyWithdrawalAmount(outboundHash string, amount uint64)

SolanaVerifyWithdrawalAmount verifies the withdrawn amount on Solana for given outbound hash

func (*E2ERunner) SuiCreateExampleWACPayload

func (r *E2ERunner) SuiCreateExampleWACPayload(authorizedSender ethcommon.Address, suiAddress string) sui.CallPayload

SuiCreateExampleWACPayload creates a payload for on_call function in Sui the example package The payload message contains below three fields in order: field 0: [42-byte ZEVM sender], checksum address, with 0x prefix field 1: [32-byte Sui target package], without 0x prefix field 2: [32-byte Sui receiver], without 0x prefix

The first two fields are used by E2E test to easily mock up the verifications against 'MessageContext' passed to the 'on_call'. A real-world app just encodes useful data that meets its needs, and it will be only the receiver 'suiAddress' in this case.

func (*E2ERunner) SuiCreateExampleWACPayloadForRevert

func (r *E2ERunner) SuiCreateExampleWACPayloadForRevert() (sui.CallPayload, error)

SuiCreateExampleWACPayload creates a payload that triggers a revert in the 'on_call' function in Sui the example package

func (*E2ERunner) SuiDepositAndCallSUI

func (r *E2ERunner) SuiDepositAndCallSUI(
	receiver ethcommon.Address,
	amount math.Uint,
	payload []byte,
) models.SuiTransactionBlockResponse

SuiDepositAndCallSUI calls DepositAndCall on Sui

func (*E2ERunner) SuiDepositFungibleToken

func (r *E2ERunner) SuiDepositFungibleToken(
	packageID string,
	receiver ethcommon.Address,
	amount math.Uint,
) models.SuiTransactionBlockResponse

SuiDepositFungibleToken calls Deposit with fungible token on Sui

func (*E2ERunner) SuiDepositSUI

func (r *E2ERunner) SuiDepositSUI(
	packageID string,
	receiver ethcommon.Address,
	amount math.Uint,
) models.SuiTransactionBlockResponse

SuiDepositSUI calls Deposit on Sui

func (*E2ERunner) SuiFungibleTokenDepositAndCall

func (r *E2ERunner) SuiFungibleTokenDepositAndCall(
	receiver ethcommon.Address,
	amount math.Uint,
	payload []byte,
) models.SuiTransactionBlockResponse

SuiFungibleTokenDepositAndCall calls DepositAndCall with fungible token on Sui

func (*E2ERunner) SuiGetActiveMessageContextID

func (r *E2ERunner) SuiGetActiveMessageContextID() string

SuiGetActiveMessageContextID queries the gateway's dynamic field to get the active MessageContext ID

func (*E2ERunner) SuiGetConnectedCalledCount

func (r *E2ERunner) SuiGetConnectedCalledCount() uint64

SuiGetConnectedCalledCount reads the called_count from the GlobalConfig object in connected module

func (*E2ERunner) SuiGetFungibleTokenBalance

func (r *E2ERunner) SuiGetFungibleTokenBalance(addr string) uint64

SuiGetFungibleTokenBalance returns the fungible token balance of an address

func (*E2ERunner) SuiGetGatewaySUIBalance

func (r *E2ERunner) SuiGetGatewaySUIBalance() (*big.Int, error)

SuiGetGatewaySUIBalance retrieves the SUI balance of the Sui gateway by its ID.

func (*E2ERunner) SuiGetSUIBalance

func (r *E2ERunner) SuiGetSUIBalance(addr string) uint64

SuiGetSUIBalance returns the SUI balance of an address

func (*E2ERunner) SuiMintUSDC

func (r *E2ERunner) SuiMintUSDC(
	amount,
	receiver string,
) models.SuiTransactionBlockResponse

SuiMintUSDC mints FakeUSDC on Sui to a receiver this function requires the signer to be the owner of the trasuryCap

func (*E2ERunner) SuiMonitorCCTXByInboundHash

func (r *E2ERunner) SuiMonitorCCTXByInboundHash(inboundHash string, index int) (time.Duration, error)

SuiMonitorCCTXByInboundHash monitors a CCTX by inbound hash until it gets mined This function wraps WaitCctxMinedByInboundHash and prints additional logs needed in stress test

func (*E2ERunner) SuiUpdateGatewayInfoAndTSS

func (r *E2ERunner) SuiUpdateGatewayInfoAndTSS()

SuiUpdateGatewayInfoAndTSS updates the gateway and TSS information from chain params and observer module

func (*E2ERunner) SuiVerifyGatewayPackageUpgrade

func (r *E2ERunner) SuiVerifyGatewayPackageUpgrade()

SuiVerifyGatewayPackageUpgrade upgrades the Sui gateway package and verifies the upgrade

func (*E2ERunner) SuiWithdraw

func (r *E2ERunner) SuiWithdraw(
	receiver string,
	amount *big.Int,
	zrc20 ethcommon.Address,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

SuiWithdraw calls Withdraw on ZEVM Gateway with given ZRC20

func (*E2ERunner) SuiWithdrawAndCall

func (r *E2ERunner) SuiWithdrawAndCall(
	receiver string,
	amount *big.Int,
	zrc20 ethcommon.Address,
	message []byte,
	gasLimit *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

SuiWithdrawAndCall calls WithdrawAndCall on ZEVM Gateway with given ZRC20

func (*E2ERunner) TONCall

func (r *E2ERunner) TONCall(
	gw *toncontracts.Gateway,
	sender *wallet.Wallet,
	amount math.Uint,
	zevmRecipient eth.Address,
	callData []byte,
	opts ...TONOpt,
) (*cctypes.CrossChainTx, error)

func (*E2ERunner) TONDeposit

func (r *E2ERunner) TONDeposit(
	gw *toncontracts.Gateway,
	sender *wallet.Wallet,
	amount math.Uint,
	zevmRecipient eth.Address,
) (*cctypes.CrossChainTx, error)

TONDeposit deposit TON to Gateway contract and wait for cctx to be mined

func (*E2ERunner) TONDepositAndCall

func (r *E2ERunner) TONDepositAndCall(
	gw *toncontracts.Gateway,
	sender *wallet.Wallet,
	amount math.Uint,
	zevmRecipient eth.Address,
	callData []byte,
	opts ...TONOpt,
) (*cctypes.CrossChainTx, error)

TONDepositAndCall deposit TON to Gateway contract with call data and wait for cctx to be mined

func (*E2ERunner) TONDepositRaw

func (r *E2ERunner) TONDepositRaw(
	gw *toncontracts.Gateway,
	sender *wallet.Wallet,
	amount math.Uint,
	zevmRecipient eth.Address,
) (ton.Transaction, error)

TONDepositRaw deposits TON to Gateway contract and returns the raw tx. Doesn't wait for cctx to be mined.

func (*E2ERunner) TransferZETAOnEvm

func (r *E2ERunner) TransferZETAOnEvm(address ethcommon.Address, zetaAmount int64) *ethtypes.Transaction

TransferZETAOnEvm sends ZETA to an address on EVM

func (*E2ERunner) Unlock

func (r *E2ERunner) Unlock()

Unlock unlocks the mutex

func (*E2ERunner) UpdateEVMChainParams

func (r *E2ERunner) UpdateEVMChainParams(testLegacy bool)

UpdateEVMChainParams update the erc20 custody contract and gateway address in the chain params TODO: should be used for all protocol contracts including the ZETA connector https://github.com/zeta-chain/node/issues/3257

func (*E2ERunner) UpdateGatewayGasLimit

func (r *E2ERunner) UpdateGatewayGasLimit(newGasLimit uint64)

UpdateGatewayGasLimit updates the gateway gas limit used by the fungible module for ZEVM calls

func (*E2ERunner) UpdateTSSAddressForConnector

func (r *E2ERunner) UpdateTSSAddressForConnector()

UpdateTSSAddressForConnector updates the TSS address for the connector contract

func (*E2ERunner) UpdateTSSAddressForConnectorNative

func (r *E2ERunner) UpdateTSSAddressForConnectorNative()

UpdateTSSAddressForConnectorNative updates the TSS address for V2 connector contract

func (*E2ERunner) UpdateTSSAddressForERC20custody

func (r *E2ERunner) UpdateTSSAddressForERC20custody()

UpdateTSSAddressForERC20custody updates the TSS address for the ERC20 custody contract

func (*E2ERunner) UpdateTSSAddressForGateway

func (r *E2ERunner) UpdateTSSAddressForGateway()

UpdateTSSAddressForGateway updates the TSS address for the gateway contract

func (*E2ERunner) UpdateTSSAddressSolana

func (r *E2ERunner) UpdateTSSAddressSolana(gatewayID, deployerPrivateKey string)

UpdateTSSAddressSolana updates the TSS address on the Solana gateway program

func (*E2ERunner) UpdateTSSAddressSui

func (r *E2ERunner) UpdateTSSAddressSui(faucetURL string)

UpdateTSSAddressSui updates the TSS for Sui by issuing a new WithdrawCap and transferring it to the new TSS address.

func (*E2ERunner) UpdateTSSAddressTON

func (r *E2ERunner) UpdateTSSAddressTON(gatewayAccountID, faucetURL string)

UpdateTSSAddressTON updates the TSS address on the TON gateway contract and resets the seqno.

func (*E2ERunner) UpgradeERC20Custody

func (r *E2ERunner) UpgradeERC20Custody()

UpgradeERC20Custody upgrades the ERC20Custody contract

func (*E2ERunner) UpgradeGatewayEVM

func (r *E2ERunner) UpgradeGatewayEVM()

UpgradeGatewayEVM upgrades the GatewayEVM contract

func (*E2ERunner) UpgradeGatewayZEVM

func (r *E2ERunner) UpgradeGatewayZEVM()

UpgradeGatewayZEVM upgrades the GatewayZEVM contract

func (*E2ERunner) UpgradeGatewaysAndERC20Custody

func (r *E2ERunner) UpgradeGatewaysAndERC20Custody()

UpgradeGatewaysAndERC20Custody upgrades gateways and ERC20Custody contracts It deploys new contract implementation with the current imported artifacts and upgrades the contract

func (*E2ERunner) VerifyAccounting

func (r *E2ERunner) VerifyAccounting(testLegacy bool)

func (*E2ERunner) VerifyUpgradedInstruction

func (r *E2ERunner) VerifyUpgradedInstruction(deployerPrivateKey string)

func (*E2ERunner) WaitAndVerifySPLBalanceChange

func (r *E2ERunner) WaitAndVerifySPLBalanceChange(
	ata solana.PublicKey,
	oldBalance *big.Int,
	change utils.BalanceChange,
)

WaitAndVerifySPLBalanceChange waits for the SPL balance of the given address to change by the given delta amount This function is to tolerate the fact that the balance update may not be synced across Solana nodes behind a RPC.

func (*E2ERunner) WaitForBitcoinTxInclusion

func (r *E2ERunner) WaitForBitcoinTxInclusion(
	txHash *chainhash.Hash,
	timeout time.Duration,
) (*btcjson.TxRawResult, error)

WaitForBitcoinTxInclusion waits for the given transaction to be included either in the mempool or a block

func (*E2ERunner) WaitForBlocks

func (r *E2ERunner) WaitForBlocks(n int64)

WaitForBlocks waits for a specific number of blocks to be generated The parameter n is the number of blocks to wait for

func (*E2ERunner) WaitForMinedCCTX

func (r *E2ERunner) WaitForMinedCCTX(txHash ethcommon.Hash)

WaitForMinedCCTX waits for a cctx to be mined from a tx

func (*E2ERunner) WaitForMinedCCTXFromIndex

func (r *E2ERunner) WaitForMinedCCTXFromIndex(index string) *types.CrossChainTx

WaitForMinedCCTXFromIndex waits for a cctx to be mined from its index

func (*E2ERunner) WaitForSpecificCCTX

func (r *E2ERunner) WaitForSpecificCCTX(
	filter func(*types.CrossChainTx) bool,
	status types.CctxStatus,
	timeout time.Duration,
) *types.CrossChainTx

WaitForSpecificCCTX scans for cctx by filters and ensures it's mined

func (*E2ERunner) WaitForTSSGeneration

func (r *E2ERunner) WaitForTSSGeneration(tssNumber int64)

WaitForTSSGeneration waits for a specific number of TSS to be generated The parameter n is the number of TSS to wait for

func (*E2ERunner) WaitForTxReceiptOnEVM

func (r *E2ERunner) WaitForTxReceiptOnEVM(tx *ethtypes.Transaction)

WaitForTxReceiptOnEVM waits for a tx receipt on EVM

func (*E2ERunner) WaitForTxReceiptOnZEVM

func (r *E2ERunner) WaitForTxReceiptOnZEVM(tx *ethtypes.Transaction)

WaitForTxReceiptOnZEVM waits for a tx receipt on ZEVM

func (*E2ERunner) WithdrawAndCallSOLZRC20

func (r *E2ERunner) WithdrawAndCallSOLZRC20(
	amount *big.Int,
	approveAmount *big.Int,
	msgEncoded []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

WithdrawAndCallSOLZRC20 withdraws an amount of ZRC20 SOL tokens and calls program on solana

func (*E2ERunner) WithdrawAndCallSPLZRC20

func (r *E2ERunner) WithdrawAndCallSPLZRC20(
	amount *big.Int,
	approveAmount *big.Int,
	msgEncoded []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

WithdrawAndCallSPLZRC20 withdraws an amount of ZRC20 SPL tokens and calls program on solana

func (*E2ERunner) WithdrawBTC

func (r *E2ERunner) WithdrawBTC(
	to btcutil.Address,
	amount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
	approve bool,
) *ethtypes.Transaction

WithdrawBTC is a helper function to call 'withdraw' on BTCZRC20 contract with optional 'approve'

func (*E2ERunner) WithdrawBTCAndWaitCCTX

func (r *E2ERunner) WithdrawBTCAndWaitCCTX(
	to btcutil.Address,
	amount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
	expectedCCTXStatus crosschaintypes.CctxStatus,
) *btcjson.TxRawResult

WithdrawBTCAndWaitCCTX withdraws BTC from ZRC20 contract and waits for the CCTX to be finalized

func (*E2ERunner) WithdrawEmissions

func (r *E2ERunner) WithdrawEmissions() error

WithdrawEmissions withdraws emissions from the emission pool on ZetaChain for all observers This functions uses the UserEmissionsWithdrawName to create the withdraw tx. UserEmissionsWithdraw can sign the authz transactions because the necessary permissions are granted in the genesis file

func (*E2ERunner) WithdrawSOLZRC20

func (r *E2ERunner) WithdrawSOLZRC20(
	to solana.PublicKey,
	amount *big.Int,
	approveAmount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

WithdrawSOLZRC20 withdraws an amount of ZRC20 SOL tokens

func (*E2ERunner) WithdrawSPLZRC20

func (r *E2ERunner) WithdrawSPLZRC20(
	to solana.PublicKey,
	amount *big.Int,
	approveAmount *big.Int,
) *ethtypes.Transaction

WithdrawSPLZRC20 withdraws an amount of ZRC20 SPL tokens

func (*E2ERunner) WithdrawTONZRC20

func (r *E2ERunner) WithdrawTONZRC20(
	recipient ton.AccountID,
	amount *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *cctypes.CrossChainTx

WithdrawTONZRC20 withdraws an amount of ZRC20 TON tokens and waits for the cctx to be mined

func (*E2ERunner) WorkDirPrefixed

func (r *E2ERunner) WorkDirPrefixed(path string) string

func (*E2ERunner) ZETADeposit

func (r *E2ERunner) ZETADeposit(
	receiver ethcommon.Address,
	amount *big.Int,
	revertOptions gatewayevm.RevertOptions,
) *ethtypes.Transaction

ZETADeposit calls Deposit of Gateway with zeta token

func (*E2ERunner) ZETAWithdraw

func (r *E2ERunner) ZETAWithdraw(
	receiver ethcommon.Address,
	amount *big.Int,
	chainID *big.Int,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ZETAWithdraw calls Withdraw of Gateway with Zeta token on ZEVM

func (*E2ERunner) ZETAWithdrawAndArbitraryCall

func (r *E2ERunner) ZETAWithdrawAndArbitraryCall(
	receiver ethcommon.Address,
	amount *big.Int,
	chainID *big.Int,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ZETAWithdrawAndArbitraryCall calls WithdrawAndCall of Gateway with Zeta token on ZEVM using arbitrary call

func (*E2ERunner) ZETAWithdrawAndCall

func (r *E2ERunner) ZETAWithdrawAndCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	chainID *big.Int,
	revertOptions gatewayzevm.RevertOptions,
	gasLimit *big.Int,
) *ethtypes.Transaction

ZETAWithdrawAndCall calls WithdrawAndCall of Gateway with Zeta token on ZEVM

func (*E2ERunner) ZEVMToEMVArbitraryCall

func (r *E2ERunner) ZEVMToEMVArbitraryCall(
	receiver ethcommon.Address,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
) *ethtypes.Transaction

ZEVMToEMVArbitraryCall calls Call of Gateway on ZEVM using arbitrary call

func (*E2ERunner) ZEVMToEMVCall

func (r *E2ERunner) ZEVMToEMVCall(
	receiver ethcommon.Address,
	payload []byte,
	revertOptions gatewayzevm.RevertOptions,
	gasLimit *big.Int,
) *ethtypes.Transaction

ZEVMToEMVCall calls authenticated Call of Gateway on ZEVM using authenticated call

func (*E2ERunner) ZEVMToEMVCallThroughContract

func (r *E2ERunner) ZEVMToEMVCallThroughContract(
	gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller,
	receiver ethcommon.Address,
	payload []byte,
	revertOptions gatewayzevmcaller.RevertOptions,
) *ethtypes.Transaction

ZEVMToEMVCallThroughContract calls authenticated Call of Gateway on ZEVM through contract using authenticated call

func (*E2ERunner) ZetaAddress

func (r *E2ERunner) ZetaAddress() types.AccAddress

func (*E2ERunner) ZetaDepositAndCall

func (r *E2ERunner) ZetaDepositAndCall(
	receiver ethcommon.Address,
	amount *big.Int,
	payload []byte,
	revertOptions gatewayevm.RevertOptions,
) *ethtypes.Transaction

ZetaDepositAndCall calls DepositAndCall of Gateway with zeta token on EVM

type E2ERunnerOption

type E2ERunnerOption func(*E2ERunner)

func WithTestFilter

func WithTestFilter(testFilter *regexp.Regexp) E2ERunnerOption

func WithZetaTxServer

func WithZetaTxServer(txServer *txserver.ZetaTxServer) E2ERunnerOption

type E2ETest

type E2ETest struct {
	Name           string
	Description    string
	Args           []string
	ArgsDefinition []ArgDefinition
	Dependencies   []E2EDependency
	E2ETest        E2ETestFunc
	MinimumVersion string
}

E2ETest represents a E2E test with a name, args, description and test func

func NewE2ETest

func NewE2ETest(
	name, description string,
	argsDefinition []ArgDefinition,
	e2eTestFunc E2ETestFunc,
	opts ...E2ETestOpt,
) E2ETest

NewE2ETest creates a new instance of E2ETest with specified parameters.

func (E2ETest) ArgsDescription

func (e E2ETest) ArgsDescription() string

ArgsDescription returns a string representing the arguments description in a readable format.

func (E2ETest) DefaultArgs

func (e E2ETest) DefaultArgs() []string

DefaultArgs extracts and returns array of default arguments from the ArgsDefinition.

type E2ETestFunc

type E2ETestFunc func(*E2ERunner, []string)

E2ETestFunc is a function representing a E2E test It takes a E2ERunner as an argument

type E2ETestOpt

type E2ETestOpt func(*E2ETest)

func WithDependencies

func WithDependencies(dependencies ...E2EDependency) E2ETestOpt

WithDependencies sets dependencies to the E2ETest to wait for completion

func WithMinimumVersion

func WithMinimumVersion(version string) E2ETestOpt

WithMinimumVersion sets a minimum zetacored version that is required to run the test. The test will be skipped if the minimum version is not satisfied.

type E2ETestRunConfig

type E2ETestRunConfig struct {
	Name string
	Args []string
}

E2ETestRunConfig defines the basic configuration for initiating an E2E test, including its name and optional runtime arguments.

type ERC20BalanceOf

type ERC20BalanceOf interface {
	BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error)
}

type ExecuteProposalSequence

type ExecuteProposalSequence string

ExecuteProposalSequence defines the sequence of proposals execution during the e2e tests StartOfE2E : this sequence is executed at the beginning of the e2e tests EndOfE2E : this sequence is executed at the end of the e2e tests

const (
	StartOfE2E ExecuteProposalSequence = "start"
	EndOfE2E   ExecuteProposalSequence = "end"
)

type LeafScriptBuilder

type LeafScriptBuilder struct {
	// contains filtered or unexported fields
}

LeafScriptBuilder represents a builder for Taproot leaf scripts

func NewLeafScriptBuilder

func NewLeafScriptBuilder(pubKey *btcec.PublicKey) *LeafScriptBuilder

NewLeafScriptBuilder initializes a new LeafScriptBuilder with a public key and `OP_CHECKSIG`

func (*LeafScriptBuilder) PushData

func (b *LeafScriptBuilder) PushData(data []byte)

PushData adds a large data to the Taproot leaf script following OP_FALSE and OP_IF structure

func (*LeafScriptBuilder) Script

func (b *LeafScriptBuilder) Script() ([]byte, error)

Script returns the current script

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a wrapper around log.Logger that adds verbosity

func NewLogger

func NewLogger(verbose bool, printColor color.Attribute, prefix string) *Logger

NewLogger creates a new Logger

func (*Logger) CCTX

func (l *Logger) CCTX(cctx crosschaintypes.CrossChainTx, name string)

CCTX prints a CCTX

func (*Logger) EVMReceipt

func (l *Logger) EVMReceipt(receipt ethtypes.Receipt, name string)

EVMReceipt prints a receipt

func (*Logger) EVMTransaction

func (l *Logger) EVMTransaction(tx *ethtypes.Transaction, name string)

EVMTransaction prints a transaction

func (*Logger) Error

func (l *Logger) Error(message string, args ...interface{})

Error prints an error message to the logger

func (*Logger) GatewayDeposit

func (l *Logger) GatewayDeposit(
	contract depositParser,
	receipt ethtypes.Receipt,
	name string,
)

GatewayDeposit prints a GatewayDeposit event

func (*Logger) Info

func (l *Logger) Info(message string, args ...any)

Info prints a message to the logger if verbose is true

func (*Logger) InfoLoud

func (l *Logger) InfoLoud(message string, args ...interface{})

InfoLoud prints a message to the logger if verbose is true

func (*Logger) Prefix

func (l *Logger) Prefix() string

Prefix returns the prefix of the logger

func (*Logger) Print

func (l *Logger) Print(message string, args ...interface{})

Print prints a message to the logger

func (*Logger) PrintNoPrefix

func (l *Logger) PrintNoPrefix(message string, args ...interface{})

PrintNoPrefix prints a message to the logger without the prefix

func (*Logger) SetColor

func (l *Logger) SetColor(printColor color.Attribute)

SetColor sets the color of the logger

func (*Logger) ZRC20Withdrawal

func (l *Logger) ZRC20Withdrawal(
	contract interface {
		ParseWithdrawal(ethtypes.Log) (*zrc20.ZRC20Withdrawal, error)
	},
	receipt ethtypes.Receipt,
	name string,
)

ZRC20Withdrawal prints a ZRC20Withdrawal event

type MetricsClient

type MetricsClient struct {
	URL string
}

func (*MetricsClient) Fetch

func (m *MetricsClient) Fetch() (map[string]*dto.MetricFamily, error)

Fetch retrieves and parses the prometheus metrics from the provided URL

func (*MetricsClient) FetchGauge

func (m *MetricsClient) FetchGauge(name string) (float64, error)

FetchGauge fetches and individual gauge metric by it's name

type NetworkReport

type NetworkReport struct {
	EmissionsPoolBalance sdkmath.Int
	Height               uint64
	CctxCount            int
}

NetworkReport is a struct that contains the report for the network used after running e2e tests This report has been initialized to check the emissions pool balance and if the pool is decreasing TODO: add more complete data and validation to the network https://github.com/zeta-chain/node/issues/1873

func (NetworkReport) Validate

func (nr NetworkReport) Validate() error

Validate validates the network report This method is used to validate the network after running e2e tests It checks the emissions pool balance and if the pool is decreasing

type Response

type Response struct {
	Amount Amount `json:"amount"`
}

type TONOpt

type TONOpt func(t *tonOpts)

func TONExpectStatus

func TONExpectStatus(status cctypes.CctxStatus) TONOpt

func TONSetRevertGasLimit

func TONSetRevertGasLimit(gasLimit math.Uint) TONOpt

TONSetRevertGasLimit sets a higher gas limit for revert operations

type TapscriptSpender

type TapscriptSpender struct {
	// contains filtered or unexported fields
}

TapscriptSpender is a utility struct that helps create Taproot address and reveal transaction

func NewTapscriptSpender

func NewTapscriptSpender(net *chaincfg.Params) *TapscriptSpender

NewTapscriptSpender creates a new NewTapscriptSpender instance

func (*TapscriptSpender) BuildRevealTxn

func (s *TapscriptSpender) BuildRevealTxn(
	to btcutil.Address,
	commitTxn wire.OutPoint,
	commitAmount int64,
	feeRate int64,
) (*wire.MsgTx, error)

BuildRevealTxn returns a signed reveal transaction that spends the commit transaction

func (*TapscriptSpender) GenerateCommitAddress

func (s *TapscriptSpender) GenerateCommitAddress(memo []byte) (*btcutil.AddressTaproot, error)

GenerateCommitAddress generates a Taproot commit address for the given receiver and payload

type TestReport

type TestReport struct {
	Name     string
	Success  bool
	Time     time.Duration
	GasSpent AccountBalancesDiff
}

TestReport is a struct that contains the report for a specific e2e test It can be generated with the RunE2ETestsIntoReport method

type TestReports

type TestReports []TestReport

TestReports is a slice of TestReport

func (TestReports) String

func (tr TestReports) String(prefix string) (string, error)

String returns the string representation of the test report as a table it uses text/tabwriter to format the table

type UpgradeGatewayOptions

type UpgradeGatewayOptions struct {
	TestSolana bool
	TestSui    bool
}

UpgradeGatewayOptions is the options for the gateway upgrade tests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL