txserver

package
v0.0.0-...-cc3bc86 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 49 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) FundEmissionsPool

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

FundEmissionsPool funds the emissions pool with the given amount

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, error should be handled by caller

func (ZetaTxServer) GetAllAccountAddress

func (zts ZetaTxServer) GetAllAccountAddress() []string

GetAllAccountAddress returns all account addresses

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) SetAuthorityClient

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

SetAuthorityClient sets the authority client

func (ZetaTxServer) UpdateGatewayAddress

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

UpdateGatewayAddress updates the gateway address

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) 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