runner

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: MIT Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReceiptTimeout = 20 * time.Second
	LOG_NAME       = "pell-e2e"
)
View Source
const MAX_WAITING_PREPARE_TIME = 90

Waiting for the network to be ready

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgDefinition

type ArgDefinition struct {
	Description  string
	DefaultValue string
}

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

type E2ETest

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

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

func NewE2ETest

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

NewE2ETest creates a new instance of E2ETest with specified parameters.

func (E2ETest) DefaultArgs

func (e E2ETest) DefaultArgs() []string

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

type E2ETestFunc

type E2ETestFunc func(*Runner, []string)

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

type E2ETestRunConfig

type E2ETestRunConfig struct {
	Name string
	Args []string
}

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

type EVMChain

type EVMChain struct {
	EVMClient     *ethclient.Client
	EVMAuth       *bind.TransactOpts
	EvmContracts  EvmContracts
	E2ETestConfig config.E2ETestConfig
}

type EvmContracts

type EvmContracts struct {
	AdminTransact *bind.TransactOpts
	// evm related contract
	STERC20Addr                   ethcommon.Address
	STERC20                       *erc20.ERC20
	StrategyManagerAddr           ethcommon.Address
	StrategyManager               *strategymanager.StrategyManager
	StrategyAddr                  ethcommon.Address
	DelegationManagerAddr         ethcommon.Address
	DelegationManager             *delegationmanager.DelegationManager
	OmniOperatorSharesManagerAddr ethcommon.Address
	OmniOperatorSharesManager     *omnioperatorsharesmanager.OmniOperatorSharesManager
	TssManagerAddr                ethcommon.Address
	TssManager                    *tssManager.TSSManager
	EvmPellConnectorAddr          ethcommon.Address
	EvmPellConnector              *pellconnector.PellConnector
	PellTokenContractAddr         ethcommon.Address
	PellTokenContract             *erc20.ERC20
	GatewayContractAddr           ethcommon.Address
	GatewayContract               *gatewayevm.GatewayEVM
	GasSwapContractAddr           ethcommon.Address
	GasSwapContract               *gasswapevm.GasSwapEVM
	CentralSchedulerAddr          ethcommon.Address
	CentralScheduler              *centralscheduler.CentralScheduler
	StakeManagerAddr              ethcommon.Address
	StakeManager                  *operatorstakemanager.OperatorStakeManager
	EjectionManagerAddr           ethcommon.Address
	EjectionManager               *ejectionmanager.EjectionManager
	RegistryRouterAddr            ethcommon.Address
	RegistryRouter                *registryrouter.RegistryRouter
	StakeRegistryRouterAddr       ethcommon.Address
	StakeRegistryRouter           *stakeregistryrouter.StakeRegistryRouter
}

evm contracts

type Logger

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

Logger is a wrapper around log.Logger that adds verbosity

func NewLogger

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

NewLogger creates a new Logger

func (*Logger) EVMReceipt

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

EVMReceipt prints a receipt

func (*Logger) EVMTransaction

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

EVMTransaction prints a transaction

func (*Logger) Error

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

Error prints an error message to the logger

func (*Logger) Info

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

Info prints a message to the logger if verbose is true

func (*Logger) InfoLoud

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

InfoLoud prints a message to the logger if verbose is true

func (*Logger) Prefix

func (l *Logger) Prefix() string

Prefix returns the prefix of the logger

func (*Logger) Print

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

Print prints a message to the logger

func (*Logger) PrintNoPrefix

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

PrintNoPrefix prints a message to the logger without the prefix

func (*Logger) SetColor

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

SetColor sets the color of the logger

func (*Logger) Xmsg

func (l *Logger) Xmsg(xmsg xmsgtypes.Xmsg, name string)

Xmsg prints a Xmsg

type PellClients

type PellClients struct {
	XmsgClient        xmsgtypes.QueryClient
	FungibleClient    pevmtypes.QueryClient
	AuthClient        authtypes.QueryClient
	BankClient        banktypes.QueryClient
	RelayerClient     relayertypes.QueryClient
	StakingClient     stakingtypes.QueryClient
	LightclientClient lightclienttypes.QueryClient
	RestakingClient   restakingtypes.QueryClient
	XSecurityClient   xsecuritytypes.QueryClient
	RPCClientURL      string
}

type PellContracts

type PellContracts struct {
	PellDelegationManager         *pellDelegationManager.PellDelegationManager
	PellDelegationManagerAddr     ethcommon.Address
	PellStrategyManager           *pellStrategyManager.PellStrategyManager
	PellStrategyManagerAddr       ethcommon.Address
	Gateway                       *gatewaypevm.GatewayPEVM
	GatewayAddr                   ethcommon.Address
	PellRegistryRouterFactory     *registryrouterfactory.RegistryRouterFactory
	PellRegistryRouterFactoryAddr ethcommon.Address
	PellDvsDirectory              *dvsdirectory.DVSDirectory
	PellDvsDirectoryAddr          ethcommon.Address
	PellRegistryRouter            *registryrouter.RegistryRouter
	PellRegistryRouterAddr        ethcommon.Address
}

pevm contracts

type Response

type Response struct {
	JSONRPC string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  Result `json:"result"`
}

type Result

type Result struct {
	Validators []Validator `json:"validators"`
}

type Runner

type Runner struct {
	PellChainId int64

	DeployerAddress       ethcommon.Address
	DeployerPrivateKey    string
	TSSAddress            ethcommon.Address
	FungibleAdminMnemonic string

	// pell
	PEVMClient        *ethclient.Client
	PellClients       PellClients
	TxServer          txserver.PellTxServer
	TxServerPellCore0 txserver.PellTxServer
	PellContracts     PellContracts
	PEVMAuth          *bind.TransactOpts
	// multi evm
	MultiEVM map[int64]*EVMChain

	Logger *Logger

	Ctx       context.Context
	CtxCancel context.CancelFunc

	ReceiptTimeout time.Duration
	// contains filtered or unexported fields
}

func NewFromConfig

func NewFromConfig(conf *config.PellConfig) *Runner

func (*Runner) AddAllowXmsgSender

func (r *Runner) AddAllowXmsgSender(addr string) (*sdktypes.TxResponse, error)

func (*Runner) DeployConnectorContract

func (r *Runner) DeployConnectorContract() (*sdktypes.TxResponse, error)

func (*Runner) DeployGatewayContract

func (r *Runner) DeployGatewayContract() (*sdktypes.TxResponse, error)

func (*Runner) GetE2ETestsByConfig

func (runner *Runner) GetE2ETestsByConfig(availableTests []E2ETest, testConfigs []E2ETestRunConfig) ([]E2ETest, error)

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

func (*Runner) GetE2ETestsByName

func (runner *Runner) GetE2ETestsByName(availableTests []E2ETest, testNames ...string) ([]E2ETest, error)

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

func (*Runner) GetE2ETestsToRunByConfig

func (runner *Runner) 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 (*Runner) GetE2ETestsToRunByName

func (runner *Runner) GetE2ETestsToRunByName(availableTests []E2ETest, testNames ...string) ([]E2ETest, error)

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

func (*Runner) LSTAddPools

func (r *Runner) LSTAddPools(poolParams []*restakingtypes.PoolParams) (*sdktypes.TxResponse, error)

LSTAddPools send a tx to add pools

func (*Runner) LSTCreateGroup

func (r *Runner) LSTCreateGroup(operatorSetParam *restakingtypes.OperatorSetParam, poolParams []*restakingtypes.PoolParams,
	groupEjectionParam *restakingtypes.GroupEjectionParam, minStake int64) (*sdktypes.TxResponse, error)

LSTCreateGroup send a tx to create a DVS group

func (*Runner) LSTCreateRegistryRouter

func (r *Runner) LSTCreateRegistryRouter(chainApprover, churnApprover, ejector, pauser, unpauser string, initialPausedStatus int64) (*sdktypes.TxResponse, error)

LSTCreateRegistryRouter send a tx to create registry router

func (*Runner) LSTQueryGroupInfo

func (r *Runner) LSTQueryGroupInfo() (*xsecuritytypes.QueryGroupInfoResponse, error)

LSTQueryGroupInfo query group info

func (*Runner) LSTQueryLSTStakingEnabled

func (r *Runner) LSTQueryLSTStakingEnabled() (*xsecuritytypes.QueryLSTStakingEnabledResponse, error)

LSTQueryLSTStakingEnabled query LST staking enabled

func (*Runner) LSTQueryRegistryRouter

func (r *Runner) LSTQueryRegistryRouter() (*xsecuritytypes.QueryRegistryRouterAddressResponse, error)

LSTQueryRegistryRouter query registry router address

func (*Runner) LSTQueryValidator

func (r *Runner) LSTQueryValidator() ([]Validator, error)

LSTQueryValidator query validator info from staking module

func (*Runner) LSTQueryVotingPowerRatio

func (r *Runner) LSTQueryVotingPowerRatio() (*xsecuritytypes.QueryVotingPowerRatioResponse, error)

LSTQueryVotingPowerRatio query voting power ratio

func (*Runner) LSTRegisterOperator

func (r *Runner) LSTRegisterOperator(param *xsecuritytypes.RegisterOperatorParam, operatorAddress string) (*sdktypes.TxResponse, error)

LSTRegisterOperator send a tx to register an operator

func (*Runner) LSTRemovePools

func (r *Runner) LSTRemovePools(poolParams []*restakingtypes.PoolParams) (*sdktypes.TxResponse, error)

LSTRemovePools send a tx to remove pools

func (*Runner) LSTSetGroupParam

func (r *Runner) LSTSetGroupParam(param *restakingtypes.OperatorSetParam) (*sdktypes.TxResponse, error)

LSTSetGroupParam send a tx to set group param

func (*Runner) LSTUpdateLSTStakingEnabled

func (r *Runner) LSTUpdateLSTStakingEnabled(enable bool) (*sdktypes.TxResponse, error)

LSTUpdateLSTStakingEnabled send a tx to update LST staking enabled

func (*Runner) LSTUpdateVotingPowerRatio

func (r *Runner) LSTUpdateVotingPowerRatio(numerator, denominator uint64) (*sdktypes.TxResponse, error)

LSTUpdateVotingPowerRatio send a tx to update voting power ratio

func (*Runner) Lock

func (r *Runner) Lock()

func (*Runner) QueryDVSGroupSyncStatus

func (r *Runner) QueryDVSGroupSyncStatus(txHash string) (*restakingtypes.QueryDVSGroupSyncStatusResponse, error)

func (*Runner) QueryDVSSupportedChainStatus

func (r *Runner) QueryDVSSupportedChainStatus(registryRouterAddress string, chaindID uint64) *restakingtypes.QueryDVSSupportedChainStatusResponse

func (*Runner) RunPellTest

func (runner *Runner) RunPellTest(e2eTest E2ETest, checkAccounting bool) (err error)

RunE2ETest runs a e2e test

func (*Runner) RunPellTests

func (runner *Runner) RunPellTests(e2eTests []E2ETest) (err error)

RunE2ETests runs a list of e2e tests

func (*Runner) RunTest

func (runner *Runner) RunTest(e2eTest E2ETest, checkAccounting bool) (err error)

RunE2ETest runs a e2e test

func (*Runner) RunTests

func (runner *Runner) RunTests(e2eTests []E2ETest) (err error)

RunE2ETests runs a list of e2e tests

func (*Runner) SendERC20OnEvm

func (runner *Runner) SendERC20OnEvm(erc20 *erc20.ERC20, adminTransact *bind.TransactOpts, 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 (*Runner) SendEther

func (runner *Runner) SendEther(chainId int64, to ethcommon.Address, value *big.Int, gasLimit uint64, data []byte) (*ethtypes.Transaction, error)

SendEther sends ethers to the TSS on EVM

func (*Runner) Unlock

func (r *Runner) Unlock()

func (*Runner) UpdateChainParamsEnableGasTokenRecharge

func (r *Runner) UpdateChainParamsEnableGasTokenRecharge()

func (*Runner) UpdateChainParamsEnablePellTokenRecharge

func (r *Runner) UpdateChainParamsEnablePellTokenRecharge()

func (*Runner) UpdateChainParamsGateway

func (r *Runner) UpdateChainParamsGateway()

func (*Runner) UpdateChainParamsLargerGasLimit

func (r *Runner) UpdateChainParamsLargerGasLimit()

func (*Runner) UpgradeSystemContract

func (r *Runner) UpgradeSystemContract() (*sdktypes.TxResponse, error)

func (*Runner) WaitForTxReceiptOnEvm

func (runner *Runner) WaitForTxReceiptOnEvm(chainId int64, tx *ethtypes.Transaction)

WaitForTxReceiptOnEvm waits for a tx receipt on EVM

func (*Runner) WaitForTxReceiptOnPEVM

func (runner *Runner) WaitForTxReceiptOnPEVM(tx *ethtypes.Transaction)

WaitForTxReceiptOnPEVM waits for a tx receipt on EVM

type Validator

type Validator struct {
	Address     string `json:"address"`
	PubKey      any    `json:"pub_key"`
	VotingPower string `json:"voting_power"`
}

Jump to

Keyboard shortcuts

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