Documentation
¶
Index ¶
- Constants
- type AddChainToRelayerAction
- type AddIbcChannelAction
- type AddIbcConnectionAction
- type AssignConsumerPubKeyAction
- type CancelUnbondTokensAction
- type Chain
- func (tr Chain) AdvanceTimeForChain(chain ChainID, duration time.Duration)
- func (tr Chain) AssignConsumerPubKey(action e2e.AssignConsumerPubKeyAction, verbose bool)
- func (tr Chain) DelegateTokens(action DelegateTokensAction, verbose bool)
- func (tr Chain) GetPathNameForGorelayer(chainA, chainB ChainID) string
- func (tr Chain) GetValidatorPrivateKeyAddress(chain ChainID, validator ValidatorID) string
- func (tr *Chain) StartChain(action StartChainAction, verbose bool)
- func (tr *Chain) StartConsumerChain(action StartConsumerChainAction, verbose bool)
- func (tr Chain) SubmitConsumerAdditionProposal(action e2e.SubmitConsumerAdditionProposalAction, verbose bool)
- func (tr Chain) SubmitConsumerRemovalProposal(action SubmitConsumerRemovalProposalAction, verbose bool)
- func (tr Chain) UnbondTokens(action UnbondTokensAction, verbose bool)
- func (tr *Chain) WaitTime(duration time.Duration)
- type ChainConfig
- type ChainID
- type ChainState
- type Commands
- func (tr Commands) AssignConsumerPubKey(chain string, pubKey string, from ValidatorID, gas, home, node string, ...) ([]byte, error)
- func (tr Commands) CreateConsumer(providerChain, consumerChain ChainID, validator ValidatorID, ...) ([]byte, error)
- func (tr Commands) ExecCommand(name string, arg ...string) *exec.Cmd
- func (tr Commands) ExecDetachedCommand(name string, args ...string) *exec.Cmd
- func (tr Commands) GetBalance(chain ChainID, validator ValidatorID) uint
- func (tr Commands) GetBlockHeight(chain ChainID) uint
- func (tr Commands) GetClientFrozenHeight(chain ChainID, clientID string) (uint64, uint64)
- func (tr Commands) GetConsumerAddress(consumerChain ChainID, validator ValidatorID) string
- func (tr Commands) GetConsumerChains(chain ChainID) map[ChainID]bool
- func (tr Commands) GetConsumerCommissionRate(chain ChainID, validator ValidatorID) float64
- func (tr Commands) GetHasToValidate(validator ValidatorID) []ChainID
- func (tr Commands) GetIBCTransferParams(chain ChainID) IBCTransferParams
- func (tr Commands) GetInflationRate(chain ChainID) float64
- func (tr Commands) GetParam(chain ChainID, param Param) string
- func (tr Commands) GetPendingPacketQueueSize(chain ChainID) uint
- func (tr Commands) GetProposal(chain ChainID, proposal uint) Proposal
- func (tr Commands) GetProposedConsumerChains(chain ChainID) []string
- func (tr Commands) GetProviderAddressFromConsumer(consumerChain ChainID, validator ValidatorID) string
- func (tr Commands) GetQueryNode(chain ChainID) string
- func (tr Commands) GetQueryNodeIP(chain ChainID) string
- func (tr Commands) GetQueryNodeRPCAddress(chain ChainID) string
- func (tr Commands) GetRegisteredConsumerRewardDenoms(chain ChainID) []string
- func (tr Commands) GetReward(chain ChainID, validator ValidatorID, blockHeight uint, denom string) float64
- func (tr Commands) GetSlashMeter() int64
- func (tr Commands) GetTestScriptPath(isConsumer bool, script string) string
- func (tr Commands) GetTrustedHeight(chain ChainID, clientID string, index int) (uint64, uint64)
- func (tr Commands) GetValPower(chain ChainID, validator ValidatorID) uint
- func (tr Commands) GetValStakedTokens(chain ChainID, valoperAddress string) uint
- func (tr Commands) GetValidatorHome(chain ChainID, validator ValidatorID) string
- func (tr Commands) GetValidatorIP(chain ChainID, validator ValidatorID) string
- func (tr Commands) QueryTransaction(chain ChainID, txhash string) ([]byte, error)
- func (tr Commands) SubmitConsumerAdditionProposal(action e2e.SubmitConsumerAdditionProposalAction, verbose bool) ([]byte, error)
- func (tr Commands) SubmitGovProposal(chain ChainID, from ValidatorID, command string, proposal string, verbose bool) ([]byte, error)
- func (tr Commands) UpdateConsumer(providerChain ChainID, validator ValidatorID, ...) ([]byte, error)
- func (tr Commands) UseCometMock() bool
- type ConsumerAdditionProposal
- type ConsumerRemovalProposal
- type ContainerConfig
- type CreateIbcClientsAction
- type DelegateTokensAction
- type DoublesignSlashAction
- type DowntimeSlashAction
- type IBCTransferParams
- type IBCTransferParamsProposal
- type LightClientAmnesiaAttackAction
- type LightClientAttackType
- type LightClientEquivocationAttackAction
- type LightClientLunaticAttackAction
- type OptInAction
- type OptOutAction
- type Param
- type ParamsProposal
- type Proposal
- type RedelegateTokensAction
- type RegisterRepresentativeAction
- type RelayPacketsAction
- type RelayRewardPacketsToProviderAction
- type Rewards
- type SendTokensAction
- type SetConsumerCommissionRateAction
- type SlashMeterReplenishmentAction
- type StartChainAction
- type StartChainValidator
- type StartConsumerChainAction
- type StartConsumerEvidenceDetectorAction
- type StartRelayerAction
- type State
- type SubmitChangeRewardDenomsProposalAction
- type SubmitConsumerModificationProposalAction
- type SubmitConsumerRemovalProposalAction
- type SubmitEnableTransfersProposalAction
- type SubmitTextProposalAction
- type TargetDriver
- type TestConfig
- type TextProposal
- type TmValidatorSetYaml
- type TransferChannelCompleteAction
- type UnbondTokensAction
- type UnjailValidatorAction
- type UpgradeProposal
- type ValPubKey
- type ValidatorConfig
- type ValidatorID
- type VoteGovProposalAction
- type WaitTimeAction
Constants ¶
const ( VLatest = "latest" V400 = "v4.0.0" V330 = "v3.3.0" V300 = "v3.0.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddChainToRelayerAction ¶
type AddChainToRelayerAction struct {
Chain ChainID
Validator ValidatorID
IsConsumer bool
}
type AddIbcChannelAction ¶
type AddIbcConnectionAction ¶
type AssignConsumerPubKeyAction ¶
type AssignConsumerPubKeyAction = e2e.AssignConsumerPubKeyAction
type aliases
type CancelUnbondTokensAction ¶
type CancelUnbondTokensAction struct {
Chain ChainID
Delegator ValidatorID
Validator ValidatorID
Amount uint
}
type Chain ¶
type Chain struct {
Target e2e.TargetDriver
TestConfig *e2e.TestConfig
}
func (Chain) AdvanceTimeForChain ¶
func (Chain) AssignConsumerPubKey ¶
func (tr Chain) AssignConsumerPubKey(action e2e.AssignConsumerPubKeyAction, verbose bool)
func (Chain) DelegateTokens ¶
func (tr Chain) DelegateTokens( action DelegateTokensAction, verbose bool, )
func (Chain) GetPathNameForGorelayer ¶
GetPathNameForGorelayer returns the name of the path between two given chains used by Gorelayer. Since paths are bidirectional, we need either chain to be able to be provided as first or second argument and still return the same name, so we sort the chain names alphabetically.
func (Chain) GetValidatorPrivateKeyAddress ¶
func (tr Chain) GetValidatorPrivateKeyAddress(chain ChainID, validator ValidatorID) string
func (*Chain) StartChain ¶
func (tr *Chain) StartChain( action StartChainAction, verbose bool, )
func (*Chain) StartConsumerChain ¶
func (tr *Chain) StartConsumerChain( action StartConsumerChainAction, verbose bool, )
func (Chain) SubmitConsumerAdditionProposal ¶
func (tr Chain) SubmitConsumerAdditionProposal( action e2e.SubmitConsumerAdditionProposalAction, verbose bool, )
func (Chain) SubmitConsumerRemovalProposal ¶
func (tr Chain) SubmitConsumerRemovalProposal( action SubmitConsumerRemovalProposalAction, verbose bool, )
func (Chain) UnbondTokens ¶
func (tr Chain) UnbondTokens( action UnbondTokensAction, verbose bool, )
func (*Chain) WaitTime ¶
WaitTime waits for the given duration. To make sure that the new timestamp is visible on-chain, it also waits until at least one block has been produced on each chain after waiting. The CometMock version of this takes a pointer to the TestConfig as it needs to manipulate information in the testrun that stores how much each chain has waited, to keep times in sync. Be careful that all functions calling WaitTime should therefore also take a pointer to the TestConfig.
type ChainConfig ¶
type ChainConfig = e2e.ChainConfig
type ChainState ¶
type ChainState = e2e.ChainState
type Commands ¶
type Commands struct {
Verbose bool
ContainerConfig ContainerConfig // FIXME only needed for 'Now' time tracking
ValidatorConfigs map[ValidatorID]ValidatorConfig
ChainConfigs map[ChainID]ChainConfig
Target e2e.PlatformDriver
}
func (Commands) AssignConsumerPubKey ¶
func (Commands) CreateConsumer ¶
func (tr Commands) CreateConsumer(providerChain, consumerChain ChainID, validator ValidatorID, metadata providertypes.ConsumerMetadata, initParams *types.ConsumerInitializationParameters, powerShapingParams *types.PowerShapingParameters) ([]byte, error)
func (Commands) ExecDetachedCommand ¶
func (Commands) GetBalance ¶
func (tr Commands) GetBalance(chain ChainID, validator ValidatorID) uint
func (Commands) GetBlockHeight ¶
func (Commands) GetClientFrozenHeight ¶
GetClientFrozenHeight returns the frozen height for a client with the given client ID by querying the hosting chain with the given chainID
func (Commands) GetConsumerAddress ¶
func (tr Commands) GetConsumerAddress(consumerChain ChainID, validator ValidatorID) string
func (Commands) GetConsumerChains ¶
GetConsumerChains returns a list of consumer chains that're being secured by the provider chain, determined by querying the provider chain.
func (Commands) GetConsumerCommissionRate ¶
func (tr Commands) GetConsumerCommissionRate(chain ChainID, validator ValidatorID) float64
func (Commands) GetHasToValidate ¶
func (tr Commands) GetHasToValidate(validator ValidatorID) []ChainID
func (Commands) GetIBCTransferParams ¶
func (tr Commands) GetIBCTransferParams(chain ChainID) IBCTransferParams
Breaking forward compatibility
func (Commands) GetInflationRate ¶
func (Commands) GetPendingPacketQueueSize ¶
func (Commands) GetProposal ¶
interchain-securityd query gov proposals
func (Commands) GetProposedConsumerChains ¶
func (Commands) GetProviderAddressFromConsumer ¶
func (tr Commands) GetProviderAddressFromConsumer(consumerChain ChainID, validator ValidatorID) string
func (Commands) GetQueryNode ¶
getQueryNode returns query node tcp address on chain.
func (Commands) GetQueryNodeIP ¶
getQueryNodeIP returns query node IP for chain, ipSuffix is hardcoded to be 253 on all query nodes except for "sover" chain where there's only one node
func (Commands) GetQueryNodeRPCAddress ¶
func (Commands) GetRegisteredConsumerRewardDenoms ¶
func (Commands) GetSlashMeter ¶
func (Commands) GetTestScriptPath ¶
func (Commands) GetTrustedHeight ¶
func (Commands) GetValPower ¶
func (tr Commands) GetValPower(chain ChainID, validator ValidatorID) uint
func (Commands) GetValStakedTokens ¶
func (Commands) GetValidatorHome ¶
func (tr Commands) GetValidatorHome(chain ChainID, validator ValidatorID) string
func (Commands) GetValidatorIP ¶
func (tr Commands) GetValidatorIP(chain ChainID, validator ValidatorID) string
TODO: refactor the following APIs as they are not version dependent commands on the target
func (Commands) QueryTransaction ¶
QueryTransaction returns the content of the transaction or an error e.g. when a transaction coudl
func (Commands) SubmitConsumerAdditionProposal ¶
func (Commands) SubmitGovProposal ¶
func (tr Commands) SubmitGovProposal(chain ChainID, from ValidatorID, command string, proposal string, verbose bool) ([]byte, error)
SubmitGovProposal sends a gov legacy-proposal transaction with given command and proposal content
func (Commands) UpdateConsumer ¶
func (tr Commands) UpdateConsumer(providerChain ChainID, validator ValidatorID, update providertypes.MsgUpdateConsumer, verbose bool) ([]byte, error)
func (Commands) UseCometMock ¶
type ConsumerAdditionProposal ¶
type ConsumerAdditionProposal = e2e.ConsumerAdditionProposal
type ConsumerRemovalProposal ¶
type ConsumerRemovalProposal = e2e.ConsumerRemovalProposal
type ContainerConfig ¶
type ContainerConfig = e2e.ContainerConfig
type CreateIbcClientsAction ¶
type DoublesignSlashAction ¶
type DoublesignSlashAction struct {
// start another node for this Validator
Validator ValidatorID
Chain ChainID
}
Creates an additional node on selected chain by copying an existing validator's home folder
Steps needed to double sign: - copy existing validator's state and configs - use existing priv_validator_key.json - use new node_key.json (otherwise node gets rejected) - reset priv_validator_state.json to initial values - start the new node Double sign should be registered within couple blocks.
type DowntimeSlashAction ¶
type DowntimeSlashAction struct {
Chain ChainID
Validator ValidatorID
}
type IBCTransferParams ¶
type IBCTransferParams = e2e.IBCTransferParams
type IBCTransferParamsProposal ¶
type IBCTransferParamsProposal = e2e.IBCTransferParamsProposal
type LightClientAmnesiaAttackAction ¶
type LightClientAmnesiaAttackAction struct {
Validator ValidatorID
Chain ChainID
}
Cause light client attack evidence for a certain validator to appear on the given chain. The evidence will look like the validator tried to perform an amnesia attack. See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability for more information about light client attacks.
type LightClientAttackType ¶
type LightClientAttackType string
const ( LightClientEquivocationAttack LightClientAttackType = "Equivocation" LightClientAmnesiaAttack LightClientAttackType = "Amnesia" LightClientLunaticAttack LightClientAttackType = "Lunatic" )
type LightClientEquivocationAttackAction ¶
type LightClientEquivocationAttackAction struct {
Validator ValidatorID
Chain ChainID
}
Cause light client attack evidence for a certain validator to appear on the given chain. The evidence will look like the validator equivocated to a light client. See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability for more information about light client attacks.
type LightClientLunaticAttackAction ¶
type LightClientLunaticAttackAction struct {
Validator ValidatorID
Chain ChainID
}
Cause light client attack evidence for a certain validator to appear on the given chain. The evidence will look like the validator tried to perform a lunatic attack. See https://github.com/cometbft/cometbft/tree/main/spec/light-client/accountability for more information about light client attacks.
type OptInAction ¶
type OptInAction struct {
Chain ChainID
Validator ValidatorID
}
type OptOutAction ¶
type OptOutAction struct {
Chain ChainID
Validator ValidatorID
ExpectError bool
}
type ParamsProposal ¶
type ParamsProposal = e2e.ParamsProposal
type RedelegateTokensAction ¶
type RedelegateTokensAction struct {
Chain ChainID
Src ValidatorID
Dst ValidatorID
TxSender ValidatorID
Amount uint
}
type RegisterRepresentativeAction ¶
type RegisterRepresentativeAction struct {
Chain ChainID
Representatives []ValidatorID
Stakes []uint
}
type RelayPacketsAction ¶
type SendTokensAction ¶
type SendTokensAction struct {
Chain ChainID
From ValidatorID
To ValidatorID
Amount uint
}
type SetConsumerCommissionRateAction ¶
type SetConsumerCommissionRateAction struct {
Chain ChainID
Validator ValidatorID
CommissionRate float64
// depending on the execution, this action might throw an error (e.g., when no consumer chain exists)
ExpectError bool
ExpectedError string
}
type SlashMeterReplenishmentAction ¶
type SlashMeterReplenishmentAction struct {
TargetValue int64
// panic if timeout is exceeded
Timeout time.Duration
}
SlashMeterReplenishmentAction polls the slash meter on provider until value is achieved
type StartConsumerChainAction ¶
type StartConsumerChainAction = e2e.StartConsumerChainAction
type aliases
type StartConsumerEvidenceDetectorAction ¶
type StartConsumerEvidenceDetectorAction struct {
Chain ChainID
}
Run an instance of the Hermes relayer using the "evidence" command, which detects evidences committed to the blocks of a consumer chain. Each infraction detected is reported to the provider chain using either a SubmitConsumerDoubleVoting or a SubmitConsumerMisbehaviour message.
type StartRelayerAction ¶
type StartRelayerAction struct{}
type State ¶
type State map[ChainID]ChainState
type SubmitChangeRewardDenomsProposalAction ¶
type SubmitChangeRewardDenomsProposalAction struct {
Denom string
Deposit uint
From ValidatorID
}
type SubmitConsumerRemovalProposalAction ¶
type SubmitConsumerRemovalProposalAction = e2e.SubmitConsumerRemovalProposalAction
type aliases
type SubmitEnableTransfersProposalAction ¶
type SubmitEnableTransfersProposalAction struct {
Chain ChainID
From ValidatorID
Title string
Deposit uint
}
type SubmitTextProposalAction ¶
type SubmitTextProposalAction struct {
Chain ChainID
From ValidatorID
Deposit uint
Title string
Description string
}
type TargetDriver ¶
type TargetDriver = e2e.TargetDriver
type TestConfig ¶
type TestConfig = e2e.TestConfig
type TextProposal ¶
type TextProposal = e2e.TextProposal
type TmValidatorSetYaml ¶
type TmValidatorSetYaml struct {
BlockHeight string `yaml:"block_height"`
Pagination struct {
NextKey string `yaml:"next_key"`
Total string `yaml:"total"`
} `yaml:"pagination"`
Validators []struct {
Address string `yaml:"address"`
VotingPower string `yaml:"voting_power"`
PubKey ValPubKey `yaml:"pub_key"`
}
}
type UnjailValidatorAction ¶
type UnjailValidatorAction struct {
Provider ChainID
Validator ValidatorID
}
type UpgradeProposal ¶
type UpgradeProposal = e2e.UpgradeProposal
type ValidatorConfig ¶
type ValidatorConfig = e2e.ValidatorConfig
type ValidatorID ¶
type ValidatorID = e2e.ValidatorID
type VoteGovProposalAction ¶
type VoteGovProposalAction struct {
Chain ChainID
From []ValidatorID
Vote []string
PropNumber uint
}