e2e

package
v5.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(cmd *exec.Cmd, cmdName string)

Executes a command with verbosity specified by CLI flag

func ExecuteCommandWithVerbosity

func ExecuteCommandWithVerbosity(cmd *exec.Cmd, cmdName string, verbose bool)

Types

type ChainCommands

type ChainCommands interface {
	GetBlockHeight(chain ChainID) uint
	GetBalance(chain ChainID, validator ValidatorID) uint
	GetConsumerChains(chain ChainID) map[ChainID]bool
	GetConsumerAddress(consumerChain ChainID, validator ValidatorID) string
	GetClientFrozenHeight(chain ChainID, clientID string) (RevisionNumber, RevisionHeight uint64)
	GetHasToValidate(validator ValidatorID) []ChainID
	GetIBCTransferParams(chain ChainID) IBCTransferParams
	GetProposal(chain ChainID, proposal uint) Proposal
	GetParam(chain ChainID, param Param) string
	GetProviderAddressFromConsumer(consumerChain ChainID, validator ValidatorID) string
	GetReward(chain ChainID, validator ValidatorID, blockHeight uint, isNativeDenom bool) float64
	GetRegisteredConsumerRewardDenoms(chain ChainID) []string
	GetSlashMeter() int64
	GetPendingPacketQueueSize(chain ChainID) uint
	GetProposedConsumerChains(chain ChainID) []string
	GetQueryNode(chain ChainID) string
	GetQueryNodeRPCAddress(chain ChainID) string
	GetTrustedHeight(chain ChainID, clientID string, index int) (uint64, uint64)
	GetValPower(chain ChainID, validator ValidatorID) uint
	GetValStakedTokens(chain ChainID, validatorAddress string) uint
	GetQueryNodeIP(chain ChainID) string
	GetConsumerCommissionRate(chain ChainID, validator ValidatorID) float64
}

type ChainConfig

type ChainConfig struct {
	ChainId ChainID
	// The account prefix configured on the chain. For example, on the Hub, this is "cosmos"
	AccountPrefix string
	// Must be unique per chain
	IpPrefix       string
	VotingWaitTime uint
	// Any transformations to apply to the genesis file of all chains instantiated with this chain config, as a jq string.
	// Example: ".app_state.gov.params.voting_period = \"5s\" | .app_state.slashing.params.signed_blocks_window = \"2\" | .app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\""
	GenesisChanges string
	BinaryName     string

	// binary to use after upgrade height
	UpgradeBinary string
}

Attributes that are unique to a chain. Allows us to map (part of) the set of strings defined above to a set of viable chains

type ChainID

type ChainID string

type ChainState

type ChainState struct {
	ValBalances                    *map[ValidatorID]uint
	Proposals                      *map[uint]Proposal
	ProposedConsumerChains         *[]string
	ValPowers                      *map[ValidatorID]uint
	StakedTokens                   *map[ValidatorID]uint
	IBCTransferParams              *IBCTransferParams
	Params                         *[]Param
	Rewards                        *Rewards
	ConsumerChains                 *map[ChainID]bool
	AssignedKeys                   *map[ValidatorID]string
	ProviderKeys                   *map[ValidatorID]string // validatorID: validator provider key
	ConsumerPendingPacketQueueSize *uint                   // Only relevant to consumer chains
	RegisteredConsumerRewardDenoms *[]string
	ClientsFrozenHeights           *map[string]clienttypes.Height
	HasToValidate                  *map[ValidatorID][]ChainID // only relevant to provider chain
	ConsumerCommissionRates        *map[ValidatorID]float64
}

func (ChainState) MarshalJSON

func (c ChainState) MarshalJSON() ([]byte, error)

MarshalJSON transforms the ChainState into a ChainStateWithProposalTypes by adding type info to the proposals

func (*ChainState) UnmarshalJSON

func (c *ChainState) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the ChainStateWithProposalTypes into a ChainState by removing the type info from the proposals and getting back standard proposals

type ChainStateCopy

type ChainStateCopy ChainState

to have a ChainState object that does not have the overridden Marshal/Unmarshal method

type ChainStateWithProposalTypes

type ChainStateWithProposalTypes struct {
	ChainStateCopy
	Proposals *map[uint]ProposalAndType // the only thing changed from the real ChainState
}

duplicated from the ChainState with a minor change to the Proposals field

type ConsumerAdditionProposal

type ConsumerAdditionProposal struct {
	Deposit       uint
	Chain         ChainID
	SpawnTime     int
	InitialHeight clienttypes.Height
	Status        string
}

type ConsumerModificationProposal added in v5.1.0

type ConsumerModificationProposal struct {
	Deposit uint
	Chain   ChainID
	Status  string
}

type ConsumerRemovalProposal

type ConsumerRemovalProposal struct {
	Deposit  uint
	Chain    ChainID
	StopTime int
	Status   string
}

type ContainerConfig

type ContainerConfig struct {
	ContainerName string
	InstanceName  string
	CcvVersion    string
	Now           time.Time
}

TODO: this should not be here. mv 'Now' to a better suited type here and then move ContainerConfig back

type IBCTransferParams

type IBCTransferParams struct {
	SendEnabled    bool `json:"send_enabled"`
	ReceiveEnabled bool `json:"receive_enabled"`
}

type IBCTransferParamsProposal

type IBCTransferParamsProposal struct {
	Title   string
	Deposit uint
	Status  string
	Params  IBCTransferParams
}

type Param

type Param struct {
	Subspace string
	Key      string
	Value    string
}

type ParamsProposal

type ParamsProposal struct {
	Deposit  uint
	Status   string
	Subspace string
	Key      string
	Value    string
}

type PlatformDriver

type PlatformDriver interface {
	ExecCommand(name string, arg ...string) *exec.Cmd
	// ExecDetachedCommand: when executed the command will be run in the background and call will return immediately
	ExecDetachedCommand(name string, args ...string) *exec.Cmd
	GetTestScriptPath(isConsumer bool, script string) string
}

TODO: replace ExecutionTarget with new TargetDriver interface

type Proposal

type Proposal interface {
	// contains filtered or unexported methods
}

func UnmarshalProposalWithType

func UnmarshalProposalWithType(inputMap json.RawMessage, proposalType string) (Proposal, error)

UnmarshalProposalWithType takes a JSON object and a proposal type and marshals into an object of the corresponding proposal.

type ProposalAndType

type ProposalAndType struct {
	RawProposal json.RawMessage
	Type        string
}

stores a proposal as a raw json, together with its type

type Rewards

type Rewards struct {
	IsRewarded map[ValidatorID]bool
	// if true it will calculate if the validator/delegator is rewarded between 2 successive blocks,
	// otherwise it will calculate if it received any rewards since the 1st block
	IsIncrementalReward bool
	// if true checks rewards for "stake" token, otherwise checks rewards from
	// other chains (e.g. false is used to check if provider received rewards from a consumer chain)
	IsNativeDenom bool
}

type TargetDriver

type TargetDriver interface {
	// ChainCommands
	ChainCommands
	PlatformDriver
}

type TextProposal

type TextProposal struct {
	Title       string
	Description string
	Deposit     uint
	Status      string
}

type UpgradeProposal

type UpgradeProposal struct {
	Title         string
	Description   string
	UpgradeHeight uint64
	Type          string
	Deposit       uint
	Status        string
}

type ValidatorConfig

type ValidatorConfig struct {
	// Seed phrase to generate a secp256k1 key used by the validator on the provider
	Mnemonic string
	// Validator account address on provider marshaled to string using Bech32
	// with Bech32Prefix = ProviderAccountPrefix
	DelAddress string
	// Validator account address on provider marshaled to string using Bech32
	// with Bech32Prefix = ConsumerAccountPrefix
	DelAddressOnConsumer string
	// Validator operator address on provider marshaled to string using Bech32
	// with Bech32Prefix = ProviderAccountPrefix
	ValoperAddress string
	// Validator operator address on provider marshaled to string using Bech32
	// with Bech32Prefix = ConsumerAccountPrefix
	ValoperAddressOnConsumer string
	// Validator consensus address on provider marshaled to string using Bech32
	// with Bech32Prefix = ProviderAccountPrefix. It matches the PrivValidatorKey below.
	ValconsAddress string
	// Validator consensus address on provider marshaled to string using Bech32
	// with Bech32Prefix = ConsumerAccountPrefix.
	ValconsAddressOnConsumer string
	// Key used for consensus on provider
	PrivValidatorKey string
	NodeKey          string
	// Must be an integer greater than 0 and less than 253
	IpSuffix string

	// Seed phrase to generate a secp256k1 key used by the validator on the consumer
	ConsumerMnemonic string
	// Validator account address on consumer marshaled to string using Bech32
	// with Bech32Prefix = ConsumerAccountPrefix
	ConsumerDelAddress string
	// Validator account address on consumer marshaled to string using Bech32
	// with Bech32Prefix = ProviderAccountPrefix
	ConsumerDelAddressOnProvider string
	// Validator operator address on consumer marshaled to string using Bech32
	// with Bech32Prefix = ConsumerAccountPrefix
	ConsumerValoperAddress string
	// Validator operator address on consumer marshaled to string using Bech32
	// with Bech32Prefix = ProviderAccountPrefix
	ConsumerValoperAddressOnProvider string
	// Validator consensus address on consumer marshaled to string using Bech32
	// with Bech32Prefix = ConsumerAccountPrefix. It matches the PrivValidatorKey below.
	ConsumerValconsAddress string
	// Validator consensus address on consumer marshaled to string using Bech32
	// with Bech32Prefix = ProviderAccountPrefix.
	ConsumerValconsAddressOnProvider string
	ConsumerValPubKey                string
	// Key used for consensus on consumer
	ConsumerPrivValidatorKey string
	ConsumerNodeKey          string
	UseConsumerKey           bool // if true the validator node will start with consumer key
}

Attributes that are unique to a validator. Allows us to map (part of) the set of strings defined above to a set of viable validators

type ValidatorID

type ValidatorID string

Jump to

Keyboard shortcuts

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