Documentation
¶
Index ¶
- Constants
- Variables
- func GetRunNumber() int
- func IsSecondRun() bool
- type AccountBalances
- type AccountBalancesDiff
- type Amount
- type ArgDefinition
- type Clients
- type ConnectedPdaInfo
- type E2EDependency
- type E2ERunner
- func (r *E2ERunner) ActivateChainsOnRegistry()
- func (r *E2ERunner) AddInboundTracker(coinType coin.CoinType, txHash string)
- func (r *E2ERunner) AddLiquidityBTC(amountZETA, amountBTC *big.Int)
- func (r *E2ERunner) AddLiquidityERC20(amountZETA, amountERC20 *big.Int)
- func (r *E2ERunner) AddLiquidityETH(amountZETA, amountETH *big.Int)
- func (r *E2ERunner) AddLiquiditySOL(amountZETA, amountSOL *big.Int)
- func (r *E2ERunner) AddLiquiditySPL(amountZETA, amountSPL *big.Int)
- func (r *E2ERunner) AddLiquiditySUI(amountZETA, amountSUI *big.Int)
- func (r *E2ERunner) AddLiquiditySuiFungibleToken(amountZETA, amountToken *big.Int)
- func (r *E2ERunner) AddLiquidityTON(amountZETA, amountTON *big.Int)
- func (r *E2ERunner) AddPostUpgradeHandler(upgradeFrom string, postHandler func())
- func (r *E2ERunner) AddPreUpgradeHandler(upgradeFrom string, preHandler func())
- func (r *E2ERunner) AddTSSToNode()
- func (r *E2ERunner) AnvilMineBlocks(url string, blockTime int) (func(), error)
- func (r *E2ERunner) ApproveBTCZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveERC20OnEVM(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveERC20ZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveETHZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveFungibleTokenZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveSOLZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveSPLZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveSUIZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveTONZRC20(allowed ethcommon.Address)
- func (r *E2ERunner) ApproveZetaOnEVM(allowed ethcommon.Address)
- func (r *E2ERunner) AssertAfterUpgrade(assertVersion string, assertFunc func())
- func (r *E2ERunner) AssertTestDAppEVMCalled(expectedCalled bool, message string, amount *big.Int)
- func (r *E2ERunner) AssertTestDAppZEVMCalled(expectedCalled bool, message string, sender []byte, amount *big.Int)
- func (r *E2ERunner) BitcoinCalcReceivedAmount(depositTx *btcjson.TxRawResult, depositedAmount int64) int64
- func (r *E2ERunner) BitcoinEstimateFeeRate(confTarget int64) uint64
- func (r *E2ERunner) BroadcastTxSync(tx *solana.Transaction) (solana.Signature, *rpc.GetTransactionResult)
- func (r *E2ERunner) BroadcastTxSyncOnce(tx *solana.Transaction) (solana.Signature, *rpc.GetTransactionResult, bool)
- func (r *E2ERunner) CallSOLZRC20(to solana.PublicKey, approveAmount *big.Int, data []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) CheckBTCTSSBalance()
- func (r *E2ERunner) CheckSUITSSBalance()
- func (r *E2ERunner) CheckSolanaTSSBalance()
- func (r *E2ERunner) ComputePdaAddress() solana.PublicKey
- func (r *E2ERunner) CopyAddressesFrom(other *E2ERunner) (err error)
- func (r *E2ERunner) CreateDepositInstruction(signer solana.PublicKey, receiver ethcommon.Address, data []byte, ...) solana.Instruction
- func (r *E2ERunner) CreateDepositInstructionThroughProgram(signer solana.PublicKey, receiver ethcommon.Address, amount uint64, ...) solana.Instruction
- func (r *E2ERunner) CreateDepositSPLInstruction(amount uint64, signer solana.PublicKey, whitelistEntry solana.PublicKey, ...) solana.Instruction
- func (r *E2ERunner) CreateGovProposals(sequence ExecuteProposalSequence) error
- func (r *E2ERunner) CreateSOLCallInstruction(signer solana.PublicKey, receiver ethcommon.Address, data []byte, ...) solana.Instruction
- func (r *E2ERunner) CreateSignedTransaction(instructions []solana.Instruction, privateKey solana.PrivateKey, ...) *solana.Transaction
- func (r *E2ERunner) CreateWhitelistSPLMintInstruction(signer, whitelistEntry, whitelistCandidate solana.PublicKey) solana.Instruction
- func (r *E2ERunner) DeployCoreRegistry()
- func (r *E2ERunner) DeploySPL(privateKey *solana.PrivateKey, whitelist bool) *solana.Wallet
- func (r *E2ERunner) DeployTestDAppV2EVM()
- func (r *E2ERunner) DeployTestDAppV2ZEVM()
- func (r *E2ERunner) DeployZetaConnectorNative()
- func (r *E2ERunner) DepositBTC(receiver common.Address)
- func (r *E2ERunner) DepositBTCWithAmount(amount float64, memo *memo.InboundMemo) *chainhash.Hash
- func (r *E2ERunner) DepositBTCWithExactAmount(amount float64, memo *memo.InboundMemo) *chainhash.Hash
- func (r *E2ERunner) DepositERC20ToDeployer() ethcommon.Hash
- func (r *E2ERunner) DepositEtherToDeployer() ethcommon.Hash
- func (r *E2ERunner) DepositWZeta(amount *big.Int)
- func (r *E2ERunner) DepositZETAToDeployer() *ethtypes.Transaction
- func (r *E2ERunner) DonateBTC()
- func (r *E2ERunner) DonateEtherToTSS(amount *big.Int) (*ethtypes.Transaction, error)
- func (r *E2ERunner) ERC20Deposit(receiver ethcommon.Address, amount *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ERC20DepositAndCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ERC20Withdraw(receiver ethcommon.Address, amount *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ERC20WithdrawAndArbitraryCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ERC20WithdrawAndCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ETHDeposit(receiver ethcommon.Address, amount *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ETHDepositAndCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ETHWithdraw(receiver ethcommon.Address, amount *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ETHWithdrawAndArbitraryCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ETHWithdrawAndCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ETHWithdrawAndCallThroughContract(gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller, ...) *ethtypes.Transaction
- func (r *E2ERunner) EVMAddress() ethcommon.Address
- func (r *E2ERunner) EVMToZEMVCall(receiver ethcommon.Address, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) EVMVerifyOutboundTransferAmount(outboundHash string, amount int64)
- func (r *E2ERunner) EnableHeaderVerification(chainIDList []int64) error
- func (r *E2ERunner) EnableV2ZETAFlows() error
- func (r *E2ERunner) EncodeERC20Call(erc20Addr ethcommon.Address, amount *big.Int, message string) []byte
- func (r *E2ERunner) EncodeERC20CallRevert(erc20Addr ethcommon.Address, amount *big.Int) []byte
- func (r *E2ERunner) EncodeGasCall(message string) []byte
- func (r *E2ERunner) EncodeGasCallRevert() []byte
- func (r *E2ERunner) EncodeSimpleCall(message string) []byte
- func (r *E2ERunner) EnsureNoStaleBallots()
- func (r *E2ERunner) EnsureNoTrackers()
- func (r *E2ERunner) EnsureZeroBalanceOnRestrictedAddressZEVM()
- func (r *E2ERunner) Errorf(format string, args ...any)
- func (r *E2ERunner) FailNow()
- func (r *E2ERunner) FetchWithdrawableEmissions(observer string) (sdk.Coin, error)
- func (r *E2ERunner) FundEmissionsPool() error
- func (r *E2ERunner) GenerateNetworkReport() (NetworkReport, error)
- func (r *E2ERunner) GenerateToAddressIfLocalBitcoin(numBlocks int64, address btcutil.Address) ([]*chainhash.Hash, error)
- func (r *E2ERunner) GetAccountBalances(network string) (AccountBalances, error)
- func (r *E2ERunner) GetBitcoinBalance() (string, error)
- func (r *E2ERunner) GetBitcoinBalanceByAddress(address btcutil.Address) (btcutil.Amount, error)
- func (r *E2ERunner) GetBitcoinChainID() int64
- func (r *E2ERunner) GetBtcAddress() *btcutil.AddressWitnessPubKeyHash
- func (r *E2ERunner) GetBtcKeypair() (*btcutil.AddressWitnessPubKeyHash, *btcutil.WIF)
- func (r *E2ERunner) GetE2ETestsToRunByConfig(availableTests []E2ETest, testConfigs []E2ETestRunConfig) ([]E2ETest, error)
- func (r *E2ERunner) GetE2ETestsToRunByName(availableTests []E2ETest, testNames ...string) ([]E2ETest, error)
- func (r *E2ERunner) GetSolanaPrivKey() solana.PrivateKey
- func (r *E2ERunner) GetTop20UTXOsForTssAddress() ([]btcjson.ListUnspentResult, error)
- func (r *E2ERunner) GetZetacoredVersion() string
- func (r *E2ERunner) InitializeBTCChainParams()
- func (r *E2ERunner) InitializeChainParams(testLegacy bool)
- func (r *E2ERunner) InitializeEVMChainParams(testLegacy bool)
- func (r *E2ERunner) InscribeToTSSWithMemo(amount float64, memo []byte, feeRate int64) (*btcjson.TxRawResult, int64, string)
- func (r *E2ERunner) IsLocalBitcoin() bool
- func (r *E2ERunner) IsRunningTssMigration() bool
- func (r *E2ERunner) IsRunningUpgrade() bool
- func (r *E2ERunner) IsRunningUpgradeOrTSSMigration() bool
- func (r *E2ERunner) IsRunningZetaclientOnlyUpgrade() bool
- func (r *E2ERunner) IsV2ZETAEnabled() bool
- func (r *E2ERunner) LegacyDepositAndApproveWZeta(amount *big.Int)
- func (r *E2ERunner) LegacyDepositERC20() ethcommon.Hash
- func (r *E2ERunner) LegacyDepositERC20WithAmountAndMessage(to ethcommon.Address, amount *big.Int, msg []byte) ethcommon.Hash
- func (r *E2ERunner) LegacyDepositEther() ethcommon.Hash
- func (r *E2ERunner) LegacyDepositEtherWithAmount(amount *big.Int) ethcommon.Hash
- func (r *E2ERunner) LegacyDepositZeta() ethcommon.Hash
- func (r *E2ERunner) LegacyDepositZetaWithAmount(to ethcommon.Address, amount *big.Int) ethcommon.Hash
- func (r *E2ERunner) LegacyDepositZetaWithAmountAndPayload(to ethcommon.Address, amount *big.Int, payload []byte) ethcommon.Hash
- func (r *E2ERunner) LegacySendEther(_ ethcommon.Address, value *big.Int, data []byte) (*ethtypes.Transaction, error)
- func (r *E2ERunner) LegacySetEVMContractsFromConfig()
- func (r *E2ERunner) LegacySetupEVM(contractsDeployed bool, legacyTestRunning bool)
- func (r *E2ERunner) LegacyWithdrawERC20(amount *big.Int) *ethtypes.Transaction
- func (r *E2ERunner) LegacyWithdrawEther(amount *big.Int) *ethtypes.Transaction
- func (r *E2ERunner) LegacyWithdrawZeta(amount *big.Int, waitReceipt bool) *ethtypes.Transaction
- func (r *E2ERunner) ListUTXOs() []btcjson.ListUnspentResult
- func (r *E2ERunner) Lock()
- func (r *E2ERunner) MineBlocksIfLocalBitcoin() func()
- func (r *E2ERunner) MintERC20OnEVM(amountERC20 int64)
- func (r *E2ERunner) ParseConnectedPda(connectedPda solana.PublicKey) ConnectedPdaInfo
- func (r *E2ERunner) PrintAccountBalances(balances AccountBalances, network string)
- func (r *E2ERunner) PrintContractAddresses()
- func (r *E2ERunner) PrintNetworkReport(nr NetworkReport)
- func (r *E2ERunner) PrintTestReports(tr TestReports)
- func (r *E2ERunner) PrintTotalDiff(diffs AccountBalancesDiff)
- func (r *E2ERunner) QueryOutboundReceiverAndAmount(txid string) (string, int64)
- func (r *E2ERunner) RemoveObserver() error
- func (r *E2ERunner) RequestSuiFromFaucet(faucetURL, recipient string)
- func (r *E2ERunner) ResolveSolanaATA(payer solana.PrivateKey, owner solana.PublicKey, mintAccount solana.PublicKey) solana.PublicKey
- func (r *E2ERunner) RunE2ETest(e2eTest E2ETest) error
- func (r *E2ERunner) RunE2ETests(e2eTests []E2ETest) (err error)
- func (r *E2ERunner) RunE2ETestsIntoReport(e2eTests []E2ETest) (TestReports, error)
- func (r *E2ERunner) RunGatewayUpgradeTestsExternalChains(conf config.Config, opts UpgradeGatewayOptions)
- func (r *E2ERunner) RunSetup()
- func (r *E2ERunner) SOLCall(signerPrivKey *solana.PrivateKey, receiver ethcommon.Address, data []byte, ...) solana.Signature
- func (r *E2ERunner) SOLDepositAndCall(signerPrivKey *solana.PrivateKey, receiver ethcommon.Address, amount *big.Int, ...) solana.Signature
- func (r *E2ERunner) SOLDepositAndCallThroughProgram(signerPrivKey *solana.PrivateKey, receiver ethcommon.Address, amount *big.Int, ...) solana.Signature
- func (r *E2ERunner) SPLDepositAndCall(privateKey *solana.PrivateKey, amount uint64, mintAccount solana.PublicKey, ...) solana.Signature
- func (r *E2ERunner) SelectUTXOs(amount btcutil.Amount) ([]btcjson.ListUnspentResult, btcutil.Amount)
- func (r *E2ERunner) SendERC20OnEVM(address ethcommon.Address, amountERC20 int64) *ethtypes.Transaction
- func (r *E2ERunner) SendToTSSWithMemo(amount float64, memo []byte) (*chainhash.Hash, error)
- func (r *E2ERunner) SendWithdrawTONZRC20(to ton.AccountID, amount *big.Int, revertOptions gatewayzevm.RevertOptions) *ethtypes.Transaction
- func (r *E2ERunner) SendZetaOnEVM(address ethcommon.Address, zetaAmount int64) *ethtypes.Transaction
- func (r *E2ERunner) SetTSSAddresses() error
- func (r *E2ERunner) SetupBTCZRC20()
- func (r *E2ERunner) SetupBitcoinAccounts(createWallet bool)
- func (r *E2ERunner) SetupBtcAddress(createWallet bool)
- func (r *E2ERunner) SetupETHZRC20()
- func (r *E2ERunner) SetupEVM()
- func (r *E2ERunner) SetupLegacyZEVMContracts()
- func (r *E2ERunner) SetupSOLZRC20()
- func (r *E2ERunner) SetupSUIZRC20()
- func (r *E2ERunner) SetupSolana(gatewayID, deployerPrivateKey, splAccountPrivateKey string)
- func (r *E2ERunner) SetupSolanaAccount()
- func (r *E2ERunner) SetupSui(faucetURL string)
- func (r *E2ERunner) SetupTON(faucetURL string, userTON config.Account)
- func (r *E2ERunner) SetupTONZRC20()
- func (r *E2ERunner) SetupTestAddressLookupTableWithRandomWallets(accounts []solana.PublicKey) (solana.PublicKey, []solana.PublicKey)
- func (r *E2ERunner) SetupTestAddressLookupTableWithRandomWalletsSPL(accounts []solana.PublicKey) (solana.PublicKey, []solana.PublicKey)
- func (r *E2ERunner) SetupZEVM()
- func (r *E2ERunner) SetupZRC20(zrc20Deployment txserver.ZRC20Deployment)
- func (r *E2ERunner) SolanaVerifyGatewayContractsUpgrade(deployerPrivateKey string)
- func (r *E2ERunner) SolanaVerifyWithdrawalAmount(outboundHash string, amount uint64)
- func (r *E2ERunner) SuiCreateExampleWACPayload(authorizedSender ethcommon.Address, suiAddress string) sui.CallPayload
- func (r *E2ERunner) SuiCreateExampleWACPayloadForRevert() (sui.CallPayload, error)
- func (r *E2ERunner) SuiDepositAndCallSUI(receiver ethcommon.Address, amount math.Uint, payload []byte) models.SuiTransactionBlockResponse
- func (r *E2ERunner) SuiDepositFungibleToken(packageID string, receiver ethcommon.Address, amount math.Uint) models.SuiTransactionBlockResponse
- func (r *E2ERunner) SuiDepositSUI(packageID string, receiver ethcommon.Address, amount math.Uint) models.SuiTransactionBlockResponse
- func (r *E2ERunner) SuiFungibleTokenDepositAndCall(receiver ethcommon.Address, amount math.Uint, payload []byte) models.SuiTransactionBlockResponse
- func (r *E2ERunner) SuiGetActiveMessageContextID() string
- func (r *E2ERunner) SuiGetConnectedCalledCount() uint64
- func (r *E2ERunner) SuiGetFungibleTokenBalance(addr string) uint64
- func (r *E2ERunner) SuiGetGatewaySUIBalance() (*big.Int, error)
- func (r *E2ERunner) SuiGetSUIBalance(addr string) uint64
- func (r *E2ERunner) SuiMintUSDC(amount, receiver string) models.SuiTransactionBlockResponse
- func (r *E2ERunner) SuiMonitorCCTXByInboundHash(inboundHash string, index int) (time.Duration, error)
- func (r *E2ERunner) SuiUpdateGatewayInfoAndTSS()
- func (r *E2ERunner) SuiVerifyGatewayPackageUpgrade()
- func (r *E2ERunner) SuiWithdraw(receiver string, amount *big.Int, zrc20 ethcommon.Address, ...) *ethtypes.Transaction
- func (r *E2ERunner) SuiWithdrawAndCall(receiver string, amount *big.Int, zrc20 ethcommon.Address, message []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) TONCall(gw *toncontracts.Gateway, sender *wallet.Wallet, amount math.Uint, ...) (*cctypes.CrossChainTx, error)
- func (r *E2ERunner) TONDeposit(gw *toncontracts.Gateway, sender *wallet.Wallet, amount math.Uint, ...) (*cctypes.CrossChainTx, error)
- func (r *E2ERunner) TONDepositAndCall(gw *toncontracts.Gateway, sender *wallet.Wallet, amount math.Uint, ...) (*cctypes.CrossChainTx, error)
- func (r *E2ERunner) TONDepositRaw(gw *toncontracts.Gateway, sender *wallet.Wallet, amount math.Uint, ...) (ton.Transaction, error)
- func (r *E2ERunner) TransferZETAOnEvm(address ethcommon.Address, zetaAmount int64) *ethtypes.Transaction
- func (r *E2ERunner) Unlock()
- func (r *E2ERunner) UpdateEVMChainParams(testLegacy bool)
- func (r *E2ERunner) UpdateGatewayGasLimit(newGasLimit uint64)
- func (r *E2ERunner) UpdateTSSAddressForConnector()
- func (r *E2ERunner) UpdateTSSAddressForConnectorNative()
- func (r *E2ERunner) UpdateTSSAddressForERC20custody()
- func (r *E2ERunner) UpdateTSSAddressForGateway()
- func (r *E2ERunner) UpdateTSSAddressSolana(gatewayID, deployerPrivateKey string)
- func (r *E2ERunner) UpdateTSSAddressSui(faucetURL string)
- func (r *E2ERunner) UpdateTSSAddressTON(gatewayAccountID, faucetURL string)
- func (r *E2ERunner) UpgradeERC20Custody()
- func (r *E2ERunner) UpgradeGatewayEVM()
- func (r *E2ERunner) UpgradeGatewayZEVM()
- func (r *E2ERunner) UpgradeGatewaysAndERC20Custody()
- func (r *E2ERunner) VerifyAccounting(testLegacy bool)
- func (r *E2ERunner) VerifyUpgradedInstruction(deployerPrivateKey string)
- func (r *E2ERunner) WaitAndVerifySPLBalanceChange(ata solana.PublicKey, oldBalance *big.Int, change utils.BalanceChange)
- func (r *E2ERunner) WaitForBitcoinTxInclusion(txHash *chainhash.Hash, timeout time.Duration) (*btcjson.TxRawResult, error)
- func (r *E2ERunner) WaitForBlocks(n int64)
- func (r *E2ERunner) WaitForMinedCCTX(txHash ethcommon.Hash)
- func (r *E2ERunner) WaitForMinedCCTXFromIndex(index string) *types.CrossChainTx
- func (r *E2ERunner) WaitForSpecificCCTX(filter func(*types.CrossChainTx) bool, status types.CctxStatus, ...) *types.CrossChainTx
- func (r *E2ERunner) WaitForTSSGeneration(tssNumber int64)
- func (r *E2ERunner) WaitForTxReceiptOnEVM(tx *ethtypes.Transaction)
- func (r *E2ERunner) WaitForTxReceiptOnZEVM(tx *ethtypes.Transaction)
- func (r *E2ERunner) WithdrawAndCallSOLZRC20(amount *big.Int, approveAmount *big.Int, msgEncoded []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) WithdrawAndCallSPLZRC20(amount *big.Int, approveAmount *big.Int, msgEncoded []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) WithdrawBTC(to btcutil.Address, amount *big.Int, revertOptions gatewayzevm.RevertOptions, ...) *ethtypes.Transaction
- func (r *E2ERunner) WithdrawBTCAndWaitCCTX(to btcutil.Address, amount *big.Int, revertOptions gatewayzevm.RevertOptions, ...) *btcjson.TxRawResult
- func (r *E2ERunner) WithdrawEmissions() error
- func (r *E2ERunner) WithdrawSOLZRC20(to solana.PublicKey, amount *big.Int, approveAmount *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) WithdrawSPLZRC20(to solana.PublicKey, amount *big.Int, approveAmount *big.Int) *ethtypes.Transaction
- func (r *E2ERunner) WithdrawTONZRC20(recipient ton.AccountID, amount *big.Int, ...) *cctypes.CrossChainTx
- func (r *E2ERunner) WorkDirPrefixed(path string) string
- func (r *E2ERunner) ZETADeposit(receiver ethcommon.Address, amount *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZETAWithdraw(receiver ethcommon.Address, amount *big.Int, chainID *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZETAWithdrawAndArbitraryCall(receiver ethcommon.Address, amount *big.Int, chainID *big.Int, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZETAWithdrawAndCall(receiver ethcommon.Address, amount *big.Int, payload []byte, chainID *big.Int, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZEVMToEMVArbitraryCall(receiver ethcommon.Address, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZEVMToEMVCall(receiver ethcommon.Address, payload []byte, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZEVMToEMVCallThroughContract(gatewayZEVMCaller *gatewayzevmcaller.GatewayZEVMCaller, ...) *ethtypes.Transaction
- func (r *E2ERunner) ZetaAddress() types.AccAddress
- func (r *E2ERunner) ZetaDepositAndCall(receiver ethcommon.Address, amount *big.Int, payload []byte, ...) *ethtypes.Transaction
- type E2ERunnerOption
- type E2ETest
- type E2ETestFunc
- type E2ETestOpt
- type E2ETestRunConfig
- type ERC20BalanceOf
- type ExecuteProposalSequence
- type LeafScriptBuilder
- type Logger
- func (l *Logger) CCTX(cctx crosschaintypes.CrossChainTx, name string)
- func (l *Logger) EVMReceipt(receipt ethtypes.Receipt, name string)
- func (l *Logger) EVMTransaction(tx *ethtypes.Transaction, name string)
- func (l *Logger) Error(message string, args ...interface{})
- func (l *Logger) GatewayDeposit(contract depositParser, receipt ethtypes.Receipt, name string)
- func (l *Logger) Info(message string, args ...any)
- func (l *Logger) InfoLoud(message string, args ...interface{})
- func (l *Logger) Prefix() string
- func (l *Logger) Print(message string, args ...interface{})
- func (l *Logger) PrintNoPrefix(message string, args ...interface{})
- func (l *Logger) SetColor(printColor color.Attribute)
- func (l *Logger) ZRC20Withdrawal(contract interface{ ... }, receipt ethtypes.Receipt, name string)
- type MetricsClient
- type NetworkReport
- type Response
- type TONOpt
- type TapscriptSpender
- type TestReport
- type TestReports
- type UpgradeGatewayOptions
Constants ¶
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 )
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 )
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
const (
ContractsConfigFile = "contracts.toml"
)
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
const V36Version = "v36.0.0"
Variables ¶
var ConnectedProgramID = solana.MustPublicKeyFromBase58("4xEw862A2SEwMjofPkUyd4NEekmVJKJsdHkK3UkAtDrc")
Connected programs used to test sol and spl withdraw and call
var ConnectedSPLProgramID = solana.MustPublicKeyFromBase58("8iUjRRhUCn8BjrvsWPfj8mguTe9L81ES4oAUApiF8JFC")
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 ¶
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 ArgDefinition ¶
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) 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 (*E2ERunner) ActivateChainsOnRegistry ¶
func (r *E2ERunner) ActivateChainsOnRegistry()
func (*E2ERunner) AddInboundTracker ¶
AddInboundTracker adds an inbound tracker from the tx hash
func (*E2ERunner) AddLiquidityBTC ¶
AddLiquidityBTC adds liquidity token to the uniswap pool ZETA/BTC
func (*E2ERunner) AddLiquidityERC20 ¶
AddLiquidityERC20 adds liquidity token to the uniswap pool ZETA/ERC20
func (*E2ERunner) AddLiquidityETH ¶
AddLiquidityETH adds liquidity token to the uniswap pool ZETA/ETH
func (*E2ERunner) AddLiquiditySOL ¶
AddLiquiditySOL adds liquidity token to the uniswap pool ZETA/SOL
func (*E2ERunner) AddLiquiditySPL ¶
AddLiquiditySPL adds liquidity token to the uniswap pool ZETA/SPL
func (*E2ERunner) AddLiquiditySUI ¶
AddLiquiditySUI adds liquidity token to the uniswap pool ZETA/SUI
func (*E2ERunner) AddLiquiditySuiFungibleToken ¶
AddLiquiditySuiFungibleToken adds liquidity token to the uniswap pool ZETA/SuiFungibleToken
func (*E2ERunner) AddLiquidityTON ¶
AddLiquidityTON adds liquidity token to the uniswap pool ZETA/TON
func (*E2ERunner) AddPostUpgradeHandler ¶
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 ¶
AddPreUpgradeHandler adds a handler to run any logic before an upgrade
func (*E2ERunner) AddTSSToNode ¶
func (r *E2ERunner) AddTSSToNode()
func (*E2ERunner) AnvilMineBlocks ¶
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 ¶
ApproveBTCZRC20 approves BTC ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveERC20OnEVM ¶
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 ¶
ApproveERC20ZRC20 approves ERC20 ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveETHZRC20 ¶
ApproveETHZRC20 approves ETH ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveFungibleTokenZRC20 ¶
ApproveFungibleTokenZRC20 approves Sui fungible token ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveSOLZRC20 ¶
ApproveSOLZRC20 approves SOL ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveSPLZRC20 ¶
ApproveSPLZRC20 approves SPL ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveSUIZRC20 ¶
ApproveSUIZRC20 approves SUI ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveTONZRC20 ¶
ApproveTONZRC20 approves TON ZRC20 on EVM to a specific address
func (*E2ERunner) ApproveZetaOnEVM ¶
func (*E2ERunner) AssertAfterUpgrade ¶
func (*E2ERunner) AssertTestDAppEVMCalled ¶
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 ¶
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 ¶
ComputePdaAddress computes the PDA address for the gateway program
func (*E2ERunner) CopyAddressesFrom ¶
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) 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 ¶
DepositBTC deposits BTC from the Bitcoin node wallet into ZEVM address.
func (*E2ERunner) DepositBTCWithAmount ¶
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 ¶
DepositERC20ToDeployer sends ERC20 into ZEVM using v2 protocol contracts
func (*E2ERunner) DepositEtherToDeployer ¶
DepositEtherToDeployer sends Ethers into ZEVM using V2 protocol contracts
func (*E2ERunner) DepositWZeta ¶
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 ¶
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 ¶
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 ¶
EVMVerifyOutboundTransferAmount verifies the transfer amount on EVM chain for given outbound hash
func (*E2ERunner) EnableHeaderVerification ¶
EnableHeaderVerification enables the header verification for the given chain IDs
func (*E2ERunner) EnableV2ZETAFlows ¶
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 ¶
EncodeERC20CallRevert encodes the payload for the erc20Call function that reverts
func (*E2ERunner) EncodeGasCall ¶
EncodeGasCall encodes the payload for the gasCall function
func (*E2ERunner) EncodeGasCallRevert ¶
EncodeGasCallRevert encodes the payload for the gasCall function that reverts
func (*E2ERunner) EncodeSimpleCall ¶
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) FailNow ¶
func (r *E2ERunner) FailNow()
FailNow implemented to mimic the behavior of testing.T.FailNow
func (*E2ERunner) FetchWithdrawableEmissions ¶
func (*E2ERunner) FundEmissionsPool ¶
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 ¶
GetBitcoinBalance returns the spendable BTC balance of the BTC address
func (*E2ERunner) GetBitcoinBalanceByAddress ¶
GetBitcoinBalanceByAddress get btc balance by address.
func (*E2ERunner) GetBitcoinChainID ¶
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 (*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 ¶
InitializeChainParams initializes the values for the chain params of the EVM and BTC chains
func (*E2ERunner) InitializeEVMChainParams ¶
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 (*E2ERunner) IsLocalBitcoin ¶
IsLocalBitcoin returns true if the runner is running on a local bitcoin network
func (*E2ERunner) IsRunningTssMigration ¶
func (*E2ERunner) IsRunningUpgrade ¶
IsRunningUpgrade returns true if the test is running an upgrade test suite.
func (*E2ERunner) IsRunningUpgradeOrTSSMigration ¶
func (*E2ERunner) IsRunningZetaclientOnlyUpgrade ¶
func (*E2ERunner) IsV2ZETAEnabled ¶
IsV2ZETAEnabled checks if V2 ZETA gateway flows are enabled Returns false if crosschain flags are not set on the network
func (*E2ERunner) LegacyDepositAndApproveWZeta ¶
LegacyDepositAndApproveWZeta deposits and approves WZETA on ZetaChain from the ZETA smart contract on ZEVM using legacy protocol contracts
func (*E2ERunner) LegacyDepositERC20 ¶
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 ¶
LegacyDepositEther sends Ethers into ZEVM using legacy protocol contracts using legacy protocol contracts
func (*E2ERunner) LegacyDepositEtherWithAmount ¶
LegacyDepositEtherWithAmount sends Ethers into ZEVM
func (*E2ERunner) LegacyDepositZeta ¶
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 ¶
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 ¶
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) 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 ¶
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 ¶
QueryOutboundReceiverAndAmount queries the outbound receiver and amount (in satoshis) from the given txid
func (*E2ERunner) RemoveObserver ¶
func (*E2ERunner) RequestSuiFromFaucet ¶
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 ¶
RunE2ETest runs a e2e test
func (*E2ERunner) RunE2ETests ¶
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) 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 (*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 ¶
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 ¶
SetupBitcoinAccounts sets up the TSS account and deployer account
func (*E2ERunner) SetupBtcAddress ¶
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 ¶
SetupSolana sets Solana contracts and params
func (*E2ERunner) SetupSolanaAccount ¶
func (r *E2ERunner) SetupSolanaAccount()
SetupSolanaAccount imports the deployer's private key
func (*E2ERunner) SetupSui ¶
SetupSui initializes the gateway package on Sui and initialize the chain params on ZetaChain
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 ¶
SolanaVerifyGatewayContractsUpgrade upgrades the Solana contracts and verifies the upgrade
func (*E2ERunner) SolanaVerifyWithdrawalAmount ¶
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 ¶
SuiGetActiveMessageContextID queries the gateway's dynamic field to get the active MessageContext ID
func (*E2ERunner) SuiGetConnectedCalledCount ¶
SuiGetConnectedCalledCount reads the called_count from the GlobalConfig object in connected module
func (*E2ERunner) SuiGetFungibleTokenBalance ¶
SuiGetFungibleTokenBalance returns the fungible token balance of an address
func (*E2ERunner) SuiGetGatewaySUIBalance ¶
SuiGetGatewaySUIBalance retrieves the SUI balance of the Sui gateway by its ID.
func (*E2ERunner) SuiGetSUIBalance ¶
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) 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) UpdateEVMChainParams ¶
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 ¶
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 ¶
UpdateTSSAddressSolana updates the TSS address on the Solana gateway program
func (*E2ERunner) UpdateTSSAddressSui ¶
UpdateTSSAddressSui updates the TSS for Sui by issuing a new WithdrawCap and transferring it to the new TSS address.
func (*E2ERunner) UpdateTSSAddressTON ¶
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 (*E2ERunner) VerifyUpgradedInstruction ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 (*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 ¶
ArgsDescription returns a string representing the arguments description in a readable format.
func (E2ETest) DefaultArgs ¶
DefaultArgs extracts and returns array of default arguments from the ArgsDefinition.
type E2ETestFunc ¶
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 ¶
E2ETestRunConfig defines the basic configuration for initiating an E2E test, including its name and optional runtime arguments.
type ERC20BalanceOf ¶
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 (*Logger) CCTX ¶
func (l *Logger) CCTX(cctx crosschaintypes.CrossChainTx, name string)
CCTX prints a CCTX
func (*Logger) EVMReceipt ¶
EVMReceipt prints a receipt
func (*Logger) EVMTransaction ¶
func (l *Logger) EVMTransaction(tx *ethtypes.Transaction, name string)
EVMTransaction prints a transaction
func (*Logger) GatewayDeposit ¶
GatewayDeposit prints a GatewayDeposit event
func (*Logger) PrintNoPrefix ¶
PrintNoPrefix prints a message to the logger without the prefix
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 ¶
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 TONOpt ¶
type TONOpt func(t *tonOpts)
func TONExpectStatus ¶
func TONExpectStatus(status cctypes.CctxStatus) TONOpt
func TONSetRevertGasLimit ¶
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 UpgradeGatewayOptions ¶
UpgradeGatewayOptions is the options for the gateway upgrade tests
Source Files
¶
- accounting.go
- admin_evm.go
- balances.go
- bitcoin.go
- bitcoin_inscription.go
- clients.go
- e2etest.go
- emissions.go
- evm.go
- gov_proposals.go
- legacy_evm.go
- legacy_setup_evm.go
- legacy_setup_zevm.go
- legacy_zevm.go
- liquidity.go
- logger.go
- observer_set.go
- report.go
- require.go
- run.go
- runner.go
- setup_bitcoin.go
- setup_evm.go
- setup_solana.go
- setup_sui.go
- setup_ton.go
- setup_zetacore_configuration.go
- setup_zevm.go
- setup_zrc20.go
- solana.go
- solana_gateway_upgrade.go
- sui.go
- sui_gateway_balance.go
- sui_gateway_upgrade.go
- testdapp.go
- ton.go
- upgrade.go
- upgrade_v36.go
- v2_zeta_flows.go
- verify.go
- zevm.go