txserver

package
v0.0.0-...-50aa497 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const EmissionsPoolAddress = "zeta1w43fn2ze2wyhu5hfmegr6vp52c3dgn0srdgymy"

EmissionsPoolAddress is the address of the emissions pool This address is constant for all networks because it is derived from emissions name

Variables

This section is empty.

Functions

func EventOfType

func EventOfType[T proto.Message](events []abci.Event) (T, bool)

EventOfType gets one event of a specific type

func EventsOfType

func EventsOfType[T proto.Message](events []abci.Event) ([]T, bool)

EventsOfType gets events of a specified type

Types

type SystemContractAddresses

type SystemContractAddresses struct {
	UniswapV2FactoryAddr, UniswapV2RouterAddr, ZEVMConnectorAddr, WZETAAddr, ERC20zrc20Addr string
}

SystemContractAddresses contains the addresses of the system contracts deployed

type ZRC20Addresses

type ZRC20Addresses struct {
	ERC20ZRC20Addr common.Address
	SPLZRC20Addr   common.Address
}

ZRC20Addresses contains the addresses of deployed ZRC20 contracts

type ZRC20Deployment

type ZRC20Deployment struct {
	ERC20Addr common.Address
	SPLAddr   *solana.PublicKey // if nil - no SPL ZRC20 is deployed
}

ZRC20Deployment configures deployment of ZRC20 contracts

type ZetaTxServer

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

ZetaTxServer is a ZetaChain tx server for E2E test

func NewZetaTxServer

func NewZetaTxServer(rpcAddr string, names []string, privateKeys []string, chainID string) (*ZetaTxServer, error)

NewZetaTxServer returns a new TxServer with provided account

func (*ZetaTxServer) AddAuthorization

func (zts *ZetaTxServer) AddAuthorization(msgURL string) error

AddAuthorization adds a new authorization in the authority module for admin message

func (*ZetaTxServer) BroadcastTx

func (zts *ZetaTxServer) BroadcastTx(account string, msgs ...sdktypes.Msg) (*sdktypes.TxResponse, error)

BroadcastTx broadcasts a tx to ZetaChain with the provided msg from the account and waiting for blockTime for tx to be included in the block

func (*ZetaTxServer) DeploySystemContracts

func (zts *ZetaTxServer) DeploySystemContracts(
	accountOperational, accountAdmin string,
) (SystemContractAddresses, error)

DeploySystemContracts deploys the system contracts returns the addresses of uniswap factory, router

func (*ZetaTxServer) DeployZRC20s

func (zts *ZetaTxServer) DeployZRC20s(
	zrc20Deployment ZRC20Deployment,
	skipChain func(chainID int64) bool,
) (*ZRC20Addresses, error)

DeployZRC20s deploys the ZRC20 contracts returns the addresses of erc20 and spl zrc20

func (*ZetaTxServer) EnableHeaderVerification

func (zts *ZetaTxServer) EnableHeaderVerification(account string, chainIDList []int64) error

EnableHeaderVerification enables the header verification for the given chain IDs

func (*ZetaTxServer) Fee

func (zts *ZetaTxServer) Fee() sdktypes.Coins

Fee returns the fee of the tx factory

func (*ZetaTxServer) FundEmissionsPool

func (zts *ZetaTxServer) FundEmissionsPool(account string, amount *big.Int) error

FundEmissionsPool funds the emissions pool with the given amount

func (*ZetaTxServer) GasLimit

func (zts *ZetaTxServer) GasLimit() uint64

GasLimit returns the gas limit of the tx factory

func (*ZetaTxServer) GetAccountAddress

func (zts *ZetaTxServer) GetAccountAddress(index int) string

GetAccountAddress returns the account address from the given index returns empty string if index is out of bound, error should be handled by caller

func (*ZetaTxServer) GetAccountAddressFromName

func (zts *ZetaTxServer) GetAccountAddressFromName(name string) (string, error)

GetAccountAddressFromName returns the account address from the given name

func (*ZetaTxServer) GetAccountMnemonic

func (zts *ZetaTxServer) GetAccountMnemonic(index int) string

GetAccountMnemonic returns the account name from the given index returns empty string if index is out of bound, error should be handled by caller

func (*ZetaTxServer) GetAccountName

func (zts *ZetaTxServer) GetAccountName(index int) string

GetAccountName returns the account name from the given index returns empty string if index is out of bound, caller should handle error

func (*ZetaTxServer) GetAllAccountAddress

func (zts *ZetaTxServer) GetAllAccountAddress() []string

GetAllAccountAddress returns all account addresses

func (*ZetaTxServer) GetCodec

func (zts *ZetaTxServer) GetCodec() codec.Codec

GetCodec returns the codec for the ZetaTxServer

func (*ZetaTxServer) GetValidatorsKeyring

func (zts *ZetaTxServer) GetValidatorsKeyring() keyring.Keyring

GetValidatorsKeyring returns the validators keyring

func (*ZetaTxServer) InitializeLiquidityCaps

func (zts *ZetaTxServer) InitializeLiquidityCaps(zrc20s ...string) error

InitializeLiquidityCaps initializes the liquidity cap for the given coin with a large value

func (*ZetaTxServer) MustGetAccountAddressFromName

func (zts *ZetaTxServer) MustGetAccountAddressFromName(name string) string

MustGetAccountAddressFromName returns the account address from the given name.It panics on error and should be used in tests only

func (*ZetaTxServer) RemoveObserver

func (zts *ZetaTxServer) RemoveObserver(observer string) error

func (ZetaTxServer) RemoveZRC20LiquidityCap

func (zts ZetaTxServer) RemoveZRC20LiquidityCap(zrc20Addr ethcommon.Address) (*sdktypes.TxResponse, error)

RemoveZRC20LiquidityCap removes the liquidity cap for given ZRC20 token

func (*ZetaTxServer) SetAuthorityClient

func (zts *ZetaTxServer) SetAuthorityClient(authorityClient authoritytypes.QueryClient)

SetAuthorityClient sets the authority client

func (*ZetaTxServer) SetFee

func (zts *ZetaTxServer) SetFee(fee sdktypes.Coins)

SetFee sets the fee of the tx factory

func (*ZetaTxServer) SetGasLimit

func (zts *ZetaTxServer) SetGasLimit(gas uint64)

SetGasLimit sets the gas limit of the tx factory

func (ZetaTxServer) SetZRC20LiquidityCap

func (zts ZetaTxServer) SetZRC20LiquidityCap(
	zrc20Addr ethcommon.Address,
	liquidityCap math.Uint,
) (*sdktypes.TxResponse, error)

SetZRC20LiquidityCap sets the liquidity cap for given ZRC20 token

func (*ZetaTxServer) TransferZETA

func (zts *ZetaTxServer) TransferZETA(destination sdk.AccAddress, amount int64) error

TransferZETA transfers ZETA tokens from the admin account to an address Note: admin account is only used because it already have a initialized balance

func (ZetaTxServer) UpdateChainInfo

func (zts ZetaTxServer) UpdateChainInfo(chain chains.Chain) error

UpdateChainInfo sets the chain info in the authority module

func (*ZetaTxServer) UpdateChainParams

func (zts *ZetaTxServer) UpdateChainParams(chainParams *observertypes.ChainParams) error

UpdateChainParams updates the chain params for the given chain ID It takes into account that the required policy get updated in v28 operational -> admin

func (*ZetaTxServer) UpdateGatewayAddress

func (zts *ZetaTxServer) UpdateGatewayAddress(account, gatewayAddr string) error

UpdateGatewayAddress updates the gateway address

func (*ZetaTxServer) UpdateGatewayGasLimit

func (zts *ZetaTxServer) UpdateGatewayGasLimit(gasLimit uint64) error

UpdateGatewayGasLimit updates the gateway gas limit

func (*ZetaTxServer) UpdateKeygen

func (zts *ZetaTxServer) UpdateKeygen(height int64) error

UpdateKeygen sets a new keygen height . The new height is the current height + 30

func (*ZetaTxServer) UpdateKeyring

func (zts *ZetaTxServer) UpdateKeyring(kr keyring.Keyring) ZetaTxServer

UpdateKeyring updates the keyring being used by the ZetaTxServer This returns a copy of the ZetaTxServer with the updated keyring

func (ZetaTxServer) UpdateZRC20GasLimit

func (zts ZetaTxServer) UpdateZRC20GasLimit(
	zrc20Addr ethcommon.Address,
	newGasLimit math.Uint,
) (*sdktypes.TxResponse, error)

UpdateZRC20GasLimit updates the gas limit for given ZRC20 token

func (*ZetaTxServer) WithdrawAllEmissions

func (zts *ZetaTxServer) WithdrawAllEmissions(withdrawAmount sdkmath.Int, account, observer string) error

Jump to

Keyboard shortcuts

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