chain

package
v2.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	initialization.ChainMeta

	ValidatorInitConfigs []*initialization.NodeConfig
	// voting period is number of blocks it takes to deposit, 1.2 seconds per validator to vote on the prop, and a buffer.
	VotingPeriod          float32
	ExpeditedVotingPeriod float32
	// upgrade proposal height for chain.
	UpgradePropHeight    int64
	LatestProposalNumber int
	LatestLockNumber     int
	NodeConfigs          []*NodeConfig
	AppStateBytes        []byte

	LatestCodeId int
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, containerManager *containers.Manager, id string, initValidatorConfigs []*initialization.NodeConfig, appStateBytes []byte) *Config

func (*Config) CreateNode

func (c *Config) CreateNode(initNode *initialization.Node) *NodeConfig

CreateNode returns new initialized NodeConfig.

func (*Config) GetDefaultNode

func (c *Config) GetDefaultNode() (*NodeConfig, error)

GetDefaultNode returns the default node of the chain. The default node is the first one created. Returns error if no ndoes created.

func (*Config) GetPersistentPeers

func (c *Config) GetPersistentPeers() []string

GetPersistentPeers returns persistent peers from every node associated with a chain.

func (*Config) RemoveNode

func (c *Config) RemoveNode(nodeName string) error

RemoveNode removes node and stops it from running.

func (*Config) SendIBC

func (c *Config) SendIBC(dstChain *Config, recipient string, token sdk.Coin)

func (*Config) WaitForNumHeights

func (c *Config) WaitForNumHeights(heightsToWait int64)

WaitForNumHeights waits for all nodes to go through a given number of heights.

func (*Config) WaitUntilHeight

func (c *Config) WaitUntilHeight(height int64)

WaitUntilHeight waits for all validators to reach the specified height at the minimum. returns error, if any.

type NodeConfig

type NodeConfig struct {
	initialization.Node

	OperatorAddress  string
	SnapshotInterval uint64
	// contains filtered or unexported fields
}

func NewNodeConfig

func NewNodeConfig(t *testing.T, initNode *initialization.Node, initConfig *initialization.NodeConfig, chainId string, containerManager *containers.Manager) *NodeConfig

NewNodeConfig returens new initialized NodeConfig.

func (*NodeConfig) AddClaimRecords

func (n *NodeConfig) AddClaimRecords(campaignId, claimRecordsJsonFile, from string)

func (*NodeConfig) AddClaimRecordsError

func (n *NodeConfig) AddClaimRecordsError(campaignId, claimRecordsJsonFile, from, errorString string)

func (*NodeConfig) AddMission

func (n *NodeConfig) AddMission(campaignId, name, description, missionType, weight, claimStartDate, from string)

func (*NodeConfig) AddMissionError

func (n *NodeConfig) AddMissionError(campaignId, name, description, missionType, weight, claimStartDate, from, errorString string)

func (*NodeConfig) BankSend

func (n *NodeConfig) BankSend(amount string, sendAddress string, receiveAddress string)

func (*NodeConfig) BankSendBaseBalanceFromNode

func (n *NodeConfig) BankSendBaseBalanceFromNode(receiveAddress string)

func (*NodeConfig) ClaimInitialMission

func (n *NodeConfig) ClaimInitialMission(campaignId, destinationAddress, from string)

func (*NodeConfig) ClaimInitialMissionError

func (n *NodeConfig) ClaimInitialMissionError(campaignId, destinationAddress, from, errorString string)

func (*NodeConfig) ClaimMission

func (n *NodeConfig) ClaimMission(campaignId, missionId, from string)

func (*NodeConfig) ClaimMissionError

func (n *NodeConfig) ClaimMissionError(campaignId, missionId, from, errorString string)

func (*NodeConfig) CloseCampaign

func (n *NodeConfig) CloseCampaign(campaignId, from string)

func (*NodeConfig) CloseCampaignError

func (n *NodeConfig) CloseCampaignError(campaignId, from, errorString string)

func (*NodeConfig) CreateCampaign

func (n *NodeConfig) CreateCampaign(name, description, campaignType, removableClaimRecords, feegrantAmount, initialClaimFreeAmount, free, startTime, endtime, lockupPeriod, vestingPeriod, vestingPoolName, from string) (campaignId uint64)

func (*NodeConfig) CreateCampaignError

func (n *NodeConfig) CreateCampaignError(name, description, campaignType, removableClaimRecords, feegrantAmount, initialClaimFreeAmount, free, startTime, endtime, lockupPeriod, vestingPeriod, vestingPoolName, from, errorString string)

func (*NodeConfig) CreateVestingAccount

func (n *NodeConfig) CreateVestingAccount(toAddress string, amount string, startTime, endTime, from string)

func (*NodeConfig) CreateVestingPool

func (n *NodeConfig) CreateVestingPool(vestingPoolName, amount, duration, vestinType, from string)

func (*NodeConfig) CreateWallet

func (n *NodeConfig) CreateWallet(walletName string) string

func (*NodeConfig) DelegateToValidator

func (n *NodeConfig) DelegateToValidator(validatorAddress, amount, from string)

func (*NodeConfig) DeleteClaimRecord

func (n *NodeConfig) DeleteClaimRecord(campaignId, userAddress, from string)

func (*NodeConfig) DeleteClaimRecordError

func (n *NodeConfig) DeleteClaimRecordError(campaignId, userEntryAddress, from, errorString string)

func (*NodeConfig) DepositProposal

func (n *NodeConfig) DepositProposal(proposalNumber int)

func (*NodeConfig) EnableCampaign

func (n *NodeConfig) EnableCampaign(campaignId, optionalStartTime, optionalEndTime, from string)

func (*NodeConfig) EnableCampaignError

func (n *NodeConfig) EnableCampaignError(campaignId, optionalStartTime, optionalEndTime, from, errorString string)

func (*NodeConfig) FailIBCTransfer

func (n *NodeConfig) FailIBCTransfer(from, recipient, amount string)

func (*NodeConfig) GetHostPort

func (n *NodeConfig) GetHostPort(portId string) (string, error)

func (*NodeConfig) GetWallet

func (n *NodeConfig) GetWallet(walletName string) string

func (*NodeConfig) LogActionF

func (n *NodeConfig) LogActionF(msg string, args ...interface{})

func (*NodeConfig) MoveAvailableVesting

func (n *NodeConfig) MoveAvailableVesting(toAddress string, from string)

func (*NodeConfig) MoveAvailableVestingByDenoms

func (n *NodeConfig) MoveAvailableVestingByDenoms(toAddress string, denoms string, from string)

func (*NodeConfig) MoveAvailableVestingByDenomsError

func (n *NodeConfig) MoveAvailableVestingByDenomsError(toAddress string, denoms string, from, errorString string)

func (*NodeConfig) MoveAvailableVestingError

func (n *NodeConfig) MoveAvailableVestingError(toAddress, from, errorString string)

func (*NodeConfig) QueryAccount

func (n *NodeConfig) QueryAccount(address string) authtypes.AccountI

func (*NodeConfig) QueryAccountNotFound

func (n *NodeConfig) QueryAccountNotFound(address string)

func (*NodeConfig) QueryBalances

func (n *NodeConfig) QueryBalances(address string) (sdk.Coins, error)

QueryBalances returns balances at the address.

func (*NodeConfig) QueryCampaign

func (n *NodeConfig) QueryCampaign(campaignId string) cfeclaimmoduletypes.Campaign

func (*NodeConfig) QueryCampaignMission

func (n *NodeConfig) QueryCampaignMission(campaignId, missionId string) cfeclaimmoduletypes.Mission

func (*NodeConfig) QueryCampaigns

func (n *NodeConfig) QueryCampaigns() []cfeclaimmoduletypes.Campaign

func (*NodeConfig) QueryCfedistributorParams

func (n *NodeConfig) QueryCfedistributorParams(moduleParams *cfedistributormoduletypes.QueryParamsResponse)

func (*NodeConfig) QueryCfeminterParams

func (n *NodeConfig) QueryCfeminterParams(moduleParams *cfemintermoduletypes.QueryParamsResponse)

func (*NodeConfig) QueryCfevestingParams

func (n *NodeConfig) QueryCfevestingParams(moduleParams *cfevestingmoduletypes.QueryParamsResponse)

func (*NodeConfig) QueryCurrentHeight

func (n *NodeConfig) QueryCurrentHeight() (int64, error)

QueryCurrentHeight returns the current block height of the node or error.

func (*NodeConfig) QueryFailedProposal

func (n *NodeConfig) QueryFailedProposal(proposalNumber int)

func (*NodeConfig) QueryFeegrant

func (n *NodeConfig) QueryFeegrant(granter, grantee string, feegrantResponse *feegrant.QueryAllowanceRequest)

func (*NodeConfig) QueryGRPCGateway

func (n *NodeConfig) QueryGRPCGateway(path string, parameters ...string) ([]byte, error)

func (*NodeConfig) QueryHashFromBlock

func (n *NodeConfig) QueryHashFromBlock(height int64) (string, error)

QueryHashFromBlock gets block hash at a specific height. Otherwise, error.

func (*NodeConfig) QueryLastCampaignsId

func (n *NodeConfig) QueryLastCampaignsId() uint64

func (*NodeConfig) QueryLatestBlockTime

func (n *NodeConfig) QueryLatestBlockTime() time.Time

QueryLatestBlockTime returns the latest block time.

func (*NodeConfig) QueryListSnapshots

func (n *NodeConfig) QueryListSnapshots() ([]*tmabcitypes.Snapshot, error)

QueryListSnapshots gets all snapshots currently created for a node.

func (*NodeConfig) QueryPropStatus

func (n *NodeConfig) QueryPropStatus(proposalNumber int) (string, error)

func (*NodeConfig) QueryPropStatusTimed

func (n *NodeConfig) QueryPropStatusTimed(proposalNumber int, desiredStatus string, totalTime chan time.Duration)

func (*NodeConfig) QueryPropTally

func (n *NodeConfig) QueryPropTally(proposalNumber int) (math.Int, math.Int, math.Int, math.Int, error)

func (*NodeConfig) QuerySupplyOf

func (n *NodeConfig) QuerySupplyOf(denom string) (math.Int, error)

func (*NodeConfig) QueryUserEntries

func (n *NodeConfig) QueryUserEntries() []cfeclaimmoduletypes.UserEntry

func (*NodeConfig) QueryUserEntry

func (n *NodeConfig) QueryUserEntry(address string) cfeclaimmoduletypes.UserEntry

func (*NodeConfig) QueryVestingPoolsInfo

func (n *NodeConfig) QueryVestingPoolsInfo(address string) []*cfevestingmoduletypes.VestingPoolInfo

func (*NodeConfig) QueryVestingPoolsNotFound

func (n *NodeConfig) QueryVestingPoolsNotFound(address string)

func (*NodeConfig) QueryVestingTypes

func (n *NodeConfig) QueryVestingTypes() []cfevestingmoduletypes.GenesisVestingType

func (*NodeConfig) RemoveCampaign

func (n *NodeConfig) RemoveCampaign(campaignId, from string)

func (*NodeConfig) RemoveCampaignError

func (n *NodeConfig) RemoveCampaignError(campaignId, from, errorString string)

func (*NodeConfig) Run

func (n *NodeConfig) Run() error

Run runs a node container for the given nodeIndex. The node configuration must be already added to the chain config prior to calling this method.

func (*NodeConfig) SendToVestingAccount

func (n *NodeConfig) SendToVestingAccount(fromAddress, toAddress, vestingPoolName, amount, restartVesting string)

func (*NodeConfig) SplitVesting

func (n *NodeConfig) SplitVesting(toAddress string, amount string, from string)

func (*NodeConfig) SplitVestingError

func (n *NodeConfig) SplitVestingError(toAddress string, amount string, from, errorString string)

func (*NodeConfig) Stop

func (n *NodeConfig) Stop() error

Stop stops the node from running and removes its container.

func (*NodeConfig) SubmitDepositAndVoteOnProposal

func (n *NodeConfig) SubmitDepositAndVoteOnProposal(proposalJson, from string, chainConfig *Config)

func (*NodeConfig) SubmitLegacyUpgradeProposal

func (n *NodeConfig) SubmitLegacyUpgradeProposal(upgradeVersion string, upgradeHeight int64, initialDeposit sdk.Coin)

func (*NodeConfig) SubmitParamChangeNotValidProposal

func (n *NodeConfig) SubmitParamChangeNotValidProposal(proposalJson, from, errorMessage string)

func (*NodeConfig) SubmitParamChangeProposal

func (n *NodeConfig) SubmitParamChangeProposal(proposalJson, from string)

func (*NodeConfig) SubmitTextProposal

func (n *NodeConfig) SubmitTextProposal(text string, initialDeposit sdk.Coin, isExpedited bool)

func (*NodeConfig) SubmitUpgradeProposal

func (n *NodeConfig) SubmitUpgradeProposal(upgradeVersion string, upgradeHeight int64, initialDeposit sdk.Coin)

func (*NodeConfig) ValidateCampaignIsNotOverYet

func (n *NodeConfig) ValidateCampaignIsNotOverYet(campaignIdString, creatorWalletName string)

func (*NodeConfig) ValidateClaimInitialCampaignNotStartedYet

func (n *NodeConfig) ValidateClaimInitialCampaignNotStartedYet(campaignIdString, destinationAddress, claimer string)

func (*NodeConfig) ValidateClaimInitialClaimerNotFound

func (n *NodeConfig) ValidateClaimInitialClaimerNotFound(campaignIdString, destinationAddress, claimer string)

func (*NodeConfig) ValidateDeleteClaimerNotFound

func (n *NodeConfig) ValidateDeleteClaimerNotFound(campaignIdString, userEntryAddress, creatorWalletName string)

func (*NodeConfig) VoteNoProposal

func (n *NodeConfig) VoteNoProposal(from string, proposalNumber int)

func (*NodeConfig) VoteYesProposal

func (n *NodeConfig) VoteYesProposal(from string, proposalNumber int)

func (*NodeConfig) WaitUntil

func (n *NodeConfig) WaitUntil(doneCondition func(syncInfo coretypes.SyncInfo) bool)

WaitUntil waits until node reaches doneCondition. Return nil if reached, error otherwise.

func (*NodeConfig) WaitUntilSpecifiedTime

func (n *NodeConfig) WaitUntilSpecifiedTime(time time.Time)

WaitUntilSpecifiedTime waits until node reaches specified time. Return nil if reached, error otherwise.

func (*NodeConfig) WithSetupTime

func (n *NodeConfig) WithSetupTime(t time.Time) *NodeConfig

func (*NodeConfig) WithdrawAllAvailable

func (n *NodeConfig) WithdrawAllAvailable(from string)

Jump to

Keyboard shortcuts

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