cosmos

package
v8.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 89 Imported by: 24

Documentation

Overview

Package cosmos provides an implementation of ibc.Chain backed by Cosmos-based blockchains.

Index

Constants

View Source
const (
	ProposalVoteYes        = "yes"
	ProposalVoteNo         = "no"
	ProposalVoteNoWithVeto = "noWithVeto"
	ProposalVoteAbstain    = "abstain"
)

Variables

This section is empty.

Functions

func BroadcastTx

func BroadcastTx(ctx context.Context, broadcaster *Broadcaster, broadcastingUser User, msgs ...sdk.Msg) (sdk.TxResponse, error)

BroadcastTx uses the provided Broadcaster to broadcast all the provided messages which will be signed by the User provided. The sdk.TxResponse and an error are returned.

func CondenseMoniker

func CondenseMoniker(m string) string

CondenseMoniker fits a moniker into the cosmos character limit for monikers. If the moniker already fits, it is returned unmodified. Otherwise, the middle is truncated, and a hash is appended to the end in case the only unique data was in the middle.

func DefaultEncoding

func DefaultEncoding() testutil.TestEncodingConfig

func ModifyGenesis

func ModifyGenesis(genesisKV []GenesisKV) func(ibc.ChainConfig, []byte) ([]byte, error)

func NewCosmosHeighlinerChainConfig

func NewCosmosHeighlinerChainConfig(name string,
	binary string,
	bech32Prefix string,
	denom string,
	gasPrices string,
	gasAdjustment float64,
	trustingPeriod string,
	noHostMount bool) ibc.ChainConfig

func NewWallet

func NewWallet(keyname string, address []byte, mnemonic string, chainCfg ibc.ChainConfig) ibc.Wallet

func OsmosisCreatePool

func OsmosisCreatePool(c *CosmosChain, ctx context.Context, keyName string, params OsmosisPoolParams) (string, error)

func OsmosisSwapExactAmountIn

func OsmosisSwapExactAmountIn(c *CosmosChain, ctx context.Context, keyName string, coinIn string, minAmountOut string, poolIDs []string, swapDenoms []string) (string, error)

func PollForBalance

func PollForBalance(ctx context.Context, chain *CosmosChain, deltaBlocks int64, balance ibc.WalletAmount) error

PollForBalance polls until the balance matches

func PollForMessage

func PollForMessage[T any](ctx context.Context, chain *CosmosChain, registry codectypes.InterfaceRegistry, startHeight, maxHeight int64, fn func(found T) bool) (T, error)

PollForMessage searches every transaction for a message. Must pass a coded registry capable of decoding the cosmos transaction. fn is optional. Return true from the fn to stop polling and return the found message. If fn is nil, returns the first message to match type T.

func PollForProposalStatus

func PollForProposalStatus(ctx context.Context, chain *CosmosChain, startHeight, maxHeight int64, proposalID uint64, status govv1beta1.ProposalStatus) (*govv1beta1.Proposal, error)

PollForProposalStatus attempts to find a proposal with matching ID and status.

func PollForProposalStatusV1 added in v8.1.0

func PollForProposalStatusV1(ctx context.Context, chain *CosmosChain, startHeight, maxHeight int64, proposalID uint64, status govv1.ProposalStatus) (*govv1.Proposal, error)

PollForProposalStatus attempts to find a proposal with matching ID and status using gov v1.

func PrefixMsgTypeIfRequired added in v8.1.0

func PrefixMsgTypeIfRequired(msgType string) string

func RangeBlockMessages

func RangeBlockMessages(ctx context.Context, interfaceRegistry codectypes.InterfaceRegistry, client blockClient, height int64, done func(sdk.Msg) bool) error

RangeBlockMessages iterates through all a block's transactions and each transaction's messages yielding to f. Return true from f to stop iteration.

func SetSDKConfig

func SetSDKConfig(bech32Prefix string) *sdk.Config

Types

type AccountRetriever added in v8.2.0

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

AccountRetriever defines the properties of a type that can be used to retrieve accounts.

func (AccountRetriever) EnsureExists added in v8.2.0

func (ar AccountRetriever) EnsureExists(clientCtx client.Context, addr sdk.AccAddress) error

EnsureExists returns an error if no account exists for the given address else nil.

func (AccountRetriever) GetAccount added in v8.2.0

func (ar AccountRetriever) GetAccount(clientCtx client.Context, addr sdk.AccAddress) (client.Account, error)

GetAccount queries for an account given an address and a block height. An error is returned if the query or decoding fails.

func (AccountRetriever) GetAccountNumberSequence added in v8.2.0

func (ar AccountRetriever) GetAccountNumberSequence(clientCtx client.Context, addr sdk.AccAddress) (uint64, uint64, error)

GetAccountNumberSequence returns sequence and account number for the given address. It returns an error if the account couldn't be retrieved from the state.

func (AccountRetriever) GetAccountWithHeight added in v8.2.0

func (ar AccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr sdk.AccAddress) (client.Account, int64, error)

GetAccountWithHeight queries for an account given an address. Returns the height of the query with the account. An error is returned if the query or decoding fails.

type BankMetaData

type BankMetaData struct {
	Metadata struct {
		Description string `json:"description"`
		DenomUnits  []struct {
			Denom    string   `json:"denom"`
			Exponent int      `json:"exponent"`
			Aliases  []string `json:"aliases"`
		} `json:"denom_units"`
		Base    string `json:"base"`
		Display string `json:"display"`
		Name    string `json:"name"`
		Symbol  string `json:"symbol"`
		URI     string `json:"uri"`
		URIHash string `json:"uri_hash"`
	} `json:"metadata"`
}

type BinaryBuildInformation

type BinaryBuildInformation struct {
	Name             string            `json:"name"`
	ServerName       string            `json:"server_name"`
	Version          string            `json:"version"`
	Commit           string            `json:"commit"`
	BuildTags        string            `json:"build_tags"`
	Go               string            `json:"go"`
	BuildDeps        []BuildDependency `json:"build_deps"`
	CosmosSdkVersion string            `json:"cosmos_sdk_version"`
}

type Broadcaster

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

func NewBroadcaster

func NewBroadcaster(t *testing.T, chain *CosmosChain) *Broadcaster

NewBroadcaster returns a instance of Broadcaster which can be used with broadcast.Tx to broadcast messages sdk messages.

func (*Broadcaster) ConfigureClientContextOptions

func (b *Broadcaster) ConfigureClientContextOptions(opts ...ClientContextOpt)

ConfigureClientContextOptions ensure the given configuration functions are run when calling GetClientContext after all default options have been applied.

func (*Broadcaster) ConfigureFactoryOptions

func (b *Broadcaster) ConfigureFactoryOptions(opts ...FactoryOpt)

ConfigureFactoryOptions ensure the given configuration functions are run when calling GetFactory after all default options have been applied.

func (*Broadcaster) GetClientContext

func (b *Broadcaster) GetClientContext(ctx context.Context, user User) (client.Context, error)

GetClientContext returns a client context that is configured with this Broadcaster's CosmosChain and the provided user. ConfigureClientContextOptions can be used to configure arbitrary options to configure the returned client.Context.

func (*Broadcaster) GetFactory

func (b *Broadcaster) GetFactory(ctx context.Context, user User) (tx.Factory, error)

GetFactory returns an instance of tx.Factory that is configured with this Broadcaster's CosmosChain and the provided user. ConfigureFactoryOptions can be used to specify arbitrary options to configure the returned factory.

func (*Broadcaster) GetTxResponseBytes

func (b *Broadcaster) GetTxResponseBytes(ctx context.Context, user User) ([]byte, error)

GetTxResponseBytes returns the sdk.TxResponse bytes which returned from broadcast.Tx.

func (*Broadcaster) UnmarshalTxResponseBytes

func (b *Broadcaster) UnmarshalTxResponseBytes(ctx context.Context, bytes []byte) (sdk.TxResponse, error)

UnmarshalTxResponseBytes accepts the sdk.TxResponse bytes and unmarshalls them into an instance of sdk.TxResponse.

type BuildDependency

type BuildDependency struct {
	Parent  string `json:"parent"`
	Version string `json:"version"`

	IsReplacement      bool   `json:"is_replacement"`
	Replacement        string `json:"replacement"`
	ReplacementVersion string `json:"replacement_version"`
}

type ChainNode

type ChainNode struct {
	VolumeName   string
	Index        int
	Chain        ibc.Chain
	Validator    bool
	NetworkID    string
	DockerClient *dockerclient.Client
	Client       rpcclient.Client
	GrpcConn     *grpc.ClientConn
	TestName     string
	Image        ibc.DockerImage

	// Additional processes that need to be run on a per-validator basis.
	Sidecars SidecarProcesses
	// contains filtered or unexported fields
}

ChainNode represents a node in the test network that is being created

func NewChainNode

func NewChainNode(log *zap.Logger, validator bool, chain *CosmosChain, dockerClient *dockerclient.Client, networkID string, testName string, image ibc.DockerImage, index int) *ChainNode

func (*ChainNode) AccountKeyBech32

func (tn *ChainNode) AccountKeyBech32(ctx context.Context, name string) (string, error)

AccountKeyBech32 retrieves the named key's address in bech32 account format.

func (*ChainNode) AddGenesisAccount

func (tn *ChainNode) AddGenesisAccount(ctx context.Context, address string, genesisAmount []sdk.Coin) error

AddGenesisAccount adds a genesis account for each key

func (*ChainNode) AuthzExec added in v8.1.0

func (tn *ChainNode) AuthzExec(ctx context.Context, grantee ibc.Wallet, nestedMsgCmd []string) (*sdk.TxResponse, error)

AuthzExec executes an authz MsgExec transaction with a single nested message.

func (*ChainNode) AuthzGrant added in v8.1.0

func (tn *ChainNode) AuthzGrant(ctx context.Context, granter ibc.Wallet, grantee, authType string, extraFlags ...string) (*sdk.TxResponse, error)

AuthzGrant grants a message as a permission to an account.

func (*ChainNode) AuthzRevoke added in v8.1.0

func (tn *ChainNode) AuthzRevoke(ctx context.Context, granter ibc.Wallet, grantee string, msgType string) (*sdk.TxResponse, error)

AuthzRevoke revokes a message as a permission to an account.

func (*ChainNode) BankMultiSend added in v8.1.0

func (tn *ChainNode) BankMultiSend(ctx context.Context, keyName string, addresses []string, amount sdkmath.Int, denom string) error

BankMultiSend sends an amount of token from one account to multiple accounts.

func (*ChainNode) BankSend added in v8.1.0

func (tn *ChainNode) BankSend(ctx context.Context, keyName string, amount ibc.WalletAmount) error

BankSend sends tokens from one account to another.

func (*ChainNode) BinCommand

func (tn *ChainNode) BinCommand(command ...string) []string

BinCommand is a helper to retrieve a full command for a chain node binary. For example, if chain node binary is `gaiad`, and desired command is `gaiad keys show key1`, pass ("keys", "show", "key1") for command to return the full command. Will include additional flags for home directory and chain ID.

func (*ChainNode) Bind

func (tn *ChainNode) Bind() []string

Bind returns the home folder bind point for running the node

func (*ChainNode) CliContext

func (tn *ChainNode) CliContext() client.Context

CliContext creates a new Cosmos SDK client context

func (*ChainNode) CollectGentxs

func (tn *ChainNode) CollectGentxs(ctx context.Context) error

CollectGentxs runs collect gentxs on the node's home folders

func (*ChainNode) ContainerID

func (tn *ChainNode) ContainerID() string

func (*ChainNode) CopyFile

func (tn *ChainNode) CopyFile(ctx context.Context, srcPath, dstPath string) error

CopyFile adds a file from the host filesystem to the docker filesystem relPath describes the location of the file in the docker volume relative to the home directory

func (*ChainNode) CreateKey

func (tn *ChainNode) CreateKey(ctx context.Context, name string) error

CreateKey creates a key in the keyring backend test for the given node

func (*ChainNode) CreateNodeContainer

func (tn *ChainNode) CreateNodeContainer(ctx context.Context) error

func (*ChainNode) CrisisInvariantBroken added in v8.1.0

func (tn *ChainNode) CrisisInvariantBroken(ctx context.Context, keyName, moduleName, route string) error

CrisisInvariantBroken executes the crisis invariant broken command.

func (*ChainNode) DistributionFundCommunityPool added in v8.1.0

func (tn *ChainNode) DistributionFundCommunityPool(ctx context.Context, keyName, amount string) error

DistributionFundCommunityPool funds the community pool with the specified amount of coins.

func (*ChainNode) DistributionFundValidatorRewardsPool added in v8.1.0

func (tn *ChainNode) DistributionFundValidatorRewardsPool(ctx context.Context, keyName, valAddr, amount string) error

func (*ChainNode) DistributionSetWithdrawAddr added in v8.1.0

func (tn *ChainNode) DistributionSetWithdrawAddr(ctx context.Context, keyName, withdrawAddr string) error

DistributionSetWithdrawAddr change the default withdraw address for rewards associated with an address.

func (*ChainNode) DistributionWithdrawAllRewards added in v8.1.0

func (tn *ChainNode) DistributionWithdrawAllRewards(ctx context.Context, keyName string) error

DistributionWithdrawAllRewards withdraws all delegations rewards for a delegator.

func (*ChainNode) DistributionWithdrawValidatorRewards added in v8.1.0

func (tn *ChainNode) DistributionWithdrawValidatorRewards(ctx context.Context, keyName, valAddr string, includeCommission bool) error

DistributionWithdrawValidatorRewards withdraws all delegations rewards for a delegator. If includeCommission is true, it also withdraws the validator's commission.

func (*ChainNode) DumpContractState

func (tn *ChainNode) DumpContractState(ctx context.Context, contractAddress string, height int64) (*DumpContractStateResponse, error)

DumpContractState dumps the state of a contract at a block height.

func (*ChainNode) Exec

func (tn *ChainNode) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)

func (*ChainNode) ExecBin

func (tn *ChainNode) ExecBin(ctx context.Context, command ...string) ([]byte, []byte, error)

ExecBin is a helper to execute a command for a chain node binary. For example, if chain node binary is `gaiad`, and desired command is `gaiad keys show key1`, pass ("keys", "show", "key1") for command to execute the command against the node. Will include additional flags for home directory and chain ID.

func (*ChainNode) ExecQuery

func (tn *ChainNode) ExecQuery(ctx context.Context, command ...string) ([]byte, []byte, error)

ExecQuery is a helper to execute a query command. For example, if chain node binary is gaiad, and desired command is `gaiad query gov params`, pass ("gov", "params") for command to execute the query against the node. Returns response in json format.

func (*ChainNode) ExecTx

func (tn *ChainNode) ExecTx(ctx context.Context, keyName string, command ...string) (string, error)

ExecTx executes a transaction, waits for 2 blocks if successful, then returns the tx hash.

func (*ChainNode) ExecuteContract

func (tn *ChainNode) ExecuteContract(ctx context.Context, keyName string, contractAddress string, message string, extraExecTxArgs ...string) (res *sdk.TxResponse, err error)

ExecuteContract executes a contract transaction with a message using it's address.

func (*ChainNode) ExportState

func (tn *ChainNode) ExportState(ctx context.Context, height int64) (string, error)

func (*ChainNode) FeeGrant added in v8.1.0

func (tn *ChainNode) FeeGrant(ctx context.Context, granterKey, grantee, spendLimit string, allowedMsgs []string, expiration time.Time, extraFlags ...string) error

FeeGrant grants a fee grant.

func (*ChainNode) FeeGrantRevoke added in v8.1.0

func (tn *ChainNode) FeeGrantRevoke(ctx context.Context, keyName, granterAddr, granteeAddr string) error

FeeGrantRevoke revokes a fee grant.

func (*ChainNode) FindTxs

func (tn *ChainNode) FindTxs(ctx context.Context, height int64) ([]blockdb.Tx, error)

FindTxs implements blockdb.BlockSaver.

func (*ChainNode) GenesisFileContent

func (tn *ChainNode) GenesisFileContent(ctx context.Context) ([]byte, error)

func (*ChainNode) Gentx

func (tn *ChainNode) Gentx(ctx context.Context, name string, genesisSelfDelegation sdk.Coin) error

Gentx generates the gentx for a given node

func (*ChainNode) GetBuildInformation

func (tn *ChainNode) GetBuildInformation(ctx context.Context) *BinaryBuildInformation

GetBuildInformation returns the build information and dependencies for the chain binary.

func (*ChainNode) GetTransaction

func (tn *ChainNode) GetTransaction(clientCtx client.Context, txHash string) (*sdk.TxResponse, error)

func (*ChainNode) GovSubmitProposal added in v8.1.0

func (tn *ChainNode) GovSubmitProposal(ctx context.Context, keyName string, prop TxProposalv1) (string, error)

GovSubmitProposal is an alias for SubmitProposal.

func (*ChainNode) HasCommand

func (tn *ChainNode) HasCommand(ctx context.Context, command ...string) bool

HasCommand checks if a command in the chain binary is available.

func (*ChainNode) Height

func (tn *ChainNode) Height(ctx context.Context) (int64, error)

func (*ChainNode) HomeDir

func (tn *ChainNode) HomeDir() string

func (*ChainNode) HostName

func (tn *ChainNode) HostName() string

hostname of the test node container

func (*ChainNode) InitFullNodeFiles

func (tn *ChainNode) InitFullNodeFiles(ctx context.Context) error

func (*ChainNode) InitHomeFolder

func (tn *ChainNode) InitHomeFolder(ctx context.Context) error

InitHomeFolder initializes a home folder for the given node

func (*ChainNode) InitValidatorGenTx

func (tn *ChainNode) InitValidatorGenTx(
	ctx context.Context,
	chainType *ibc.ChainConfig,
	genesisAmounts []sdk.Coin,
	genesisSelfDelegation sdk.Coin,
) error

InitValidatorFiles creates the node files and signs a genesis transaction

func (*ChainNode) InstantiateContract

func (tn *ChainNode) InstantiateContract(ctx context.Context, keyName string, codeID string, initMessage string, needsNoAdminFlag bool, extraExecTxArgs ...string) (string, error)

InstantiateContract takes a code id for a smart contract and initialization message and returns the instantiated contract address.

func (*ChainNode) IsAboveSDK47

func (tn *ChainNode) IsAboveSDK47(ctx context.Context) bool

func (*ChainNode) KeyBech32

func (tn *ChainNode) KeyBech32(ctx context.Context, name string, bech string) (string, error)

KeyBech32 retrieves the named key's address in bech32 format from the node. bech is the bech32 prefix (acc|val|cons). If empty, defaults to the account key (same as "acc").

func (*ChainNode) Name

func (tn *ChainNode) Name() string

Name of the test node container

func (*ChainNode) NewClient

func (tn *ChainNode) NewClient(addr string) error

NewClient creates and assigns a new Tendermint RPC client to the ChainNode

func (*ChainNode) NewSidecarProcess

func (tn *ChainNode) NewSidecarProcess(
	ctx context.Context,
	preStart bool,
	processName string,
	cli *dockerclient.Client,
	networkID string,
	image ibc.DockerImage,
	homeDir string,
	ports []string,
	startCmd []string,
	env []string,
) error

func (*ChainNode) NodeCommand

func (tn *ChainNode) NodeCommand(command ...string) []string

NodeCommand is a helper to retrieve a full command for a chain node binary. when interactions with the RPC endpoint are necessary. For example, if chain node binary is `gaiad`, and desired command is `gaiad keys show key1`, pass ("keys", "show", "key1") for command to return the full command. Will include additional flags for node URL, home directory, and chain ID.

func (*ChainNode) NodeID

func (tn *ChainNode) NodeID(ctx context.Context) (string, error)

NodeID returns the persistent ID of a given node.

func (*ChainNode) OverwriteGenesisFile

func (tn *ChainNode) OverwriteGenesisFile(ctx context.Context, content []byte) error

func (*ChainNode) ParamChangeProposal

func (tn *ChainNode) ParamChangeProposal(ctx context.Context, keyName string, prop *paramsutils.ParamChangeProposalJSON) (string, error)

ParamChangeProposal submits a param change proposal to the chain, signed by keyName.

func (*ChainNode) PauseContainer

func (tn *ChainNode) PauseContainer(ctx context.Context) error

func (*ChainNode) QueryBankMetadata

func (tn *ChainNode) QueryBankMetadata(ctx context.Context, denom string) (*BankMetaData, error)

QueryBankMetadata returns the bank metadata of a token denomination.

func (*ChainNode) QueryClientContractCode

func (tn *ChainNode) QueryClientContractCode(ctx context.Context, codeHash string, response any) error

QueryClientContractCode performs a query with the contract codeHash as the input and code as the output

func (*ChainNode) QueryCommand

func (tn *ChainNode) QueryCommand(command ...string) []string

QueryCommand is a helper to retrieve the full query command. For example, if chain node binary is gaiad, and desired command is `gaiad query gov params`, pass ("gov", "params") for command to return the full command with all necessary flags to query the specific node.

func (*ChainNode) QueryContract

func (tn *ChainNode) QueryContract(ctx context.Context, contractAddress string, queryMsg any, response any) error

QueryContract performs a smart query, taking in a query struct and returning a error with the response struct populated.

func (*ChainNode) QueryICA

func (tn *ChainNode) QueryICA(ctx context.Context, connectionID, address string) (string, error)

QueryICA will query for an interchain account controlled by the specified address on the counterparty chain.

func (*ChainNode) QueryParam

func (tn *ChainNode) QueryParam(ctx context.Context, subspace, key string) (*ParamChange, error)

QueryParam returns the state and details of a subspace param.

func (*ChainNode) ReadFile

func (tn *ChainNode) ReadFile(ctx context.Context, relPath string) ([]byte, error)

ReadFile reads the contents of a single file at the specified path in the docker filesystem. relPath describes the location of the file in the docker volume relative to the home directory.

func (*ChainNode) RecoverKey

func (tn *ChainNode) RecoverKey(ctx context.Context, keyName, mnemonic string) error

RecoverKey restores a key from a given mnemonic.

func (*ChainNode) RegisterICA

func (tn *ChainNode) RegisterICA(ctx context.Context, keyName, connectionID string) (string, error)

RegisterICA will attempt to register an interchain account on the counterparty chain.

func (*ChainNode) RemoveContainer

func (tn *ChainNode) RemoveContainer(ctx context.Context) error

func (*ChainNode) SendFunds deprecated

func (tn *ChainNode) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error

Deprecated: use BankSend instead

func (*ChainNode) SendIBCTransfer

func (tn *ChainNode) SendIBCTransfer(
	ctx context.Context,
	channelID string,
	keyName string,
	amount ibc.WalletAmount,
	options ibc.TransferOptions,
) (string, error)

func (*ChainNode) SendICABankTransfer

func (tn *ChainNode) SendICABankTransfer(ctx context.Context, connectionID, fromAddr string, amount ibc.WalletAmount) error

SendICABankTransfer builds a bank transfer message for a specified address and sends it to the specified interchain account.

func (*ChainNode) SetPeers

func (tn *ChainNode) SetPeers(ctx context.Context, peers string) error

SetPeers modifies the config persistent_peers for a node

func (*ChainNode) SetTestConfig

func (tn *ChainNode) SetTestConfig(ctx context.Context) error

SetTestConfig modifies the config to reasonable values for use within interchaintest.

func (*ChainNode) SlashingUnJail added in v8.1.0

func (tn *ChainNode) SlashingUnJail(ctx context.Context, keyName string) error

SlashingUnJail unjails a validator.

func (*ChainNode) StakingCancelUnbond added in v8.1.0

func (tn *ChainNode) StakingCancelUnbond(ctx context.Context, keyName, validatorAddr, coinAmt string, creationHeight int64) error

StakingCancelUnbond cancels an unbonding delegation.

func (*ChainNode) StakingCreateValidator added in v8.1.0

func (tn *ChainNode) StakingCreateValidator(ctx context.Context, keyName, valFilePath string) error

StakingCreateValidator creates a new validator.

func (*ChainNode) StakingCreateValidatorFile added in v8.1.0

func (tn *ChainNode) StakingCreateValidatorFile(
	ctx context.Context, filePath string,
	pubKeyJSON, amount, moniker, identity, website, security, details, commissionRate, commissionMaxRate, commissionMaxChangeRate, minSelfDelegation string,
) error

StakingCreateValidatorFile creates a new validator file for use in `StakingCreateValidator`.

func (*ChainNode) StakingDelegate added in v8.1.0

func (tn *ChainNode) StakingDelegate(ctx context.Context, keyName, validatorAddr, amount string) error

StakingDelegate delegates tokens to a validator.

func (*ChainNode) StakingEditValidator added in v8.1.0

func (tn *ChainNode) StakingEditValidator(ctx context.Context, keyName string, flags ...string) error

StakingEditValidator edits an existing validator.

func (*ChainNode) StakingRedelegate added in v8.1.0

func (tn *ChainNode) StakingRedelegate(ctx context.Context, keyName, srcValAddr, dstValAddr, amount string) error

StakingRedelegate redelegates tokens from one validator to another.

func (*ChainNode) StakingUnbond added in v8.1.0

func (tn *ChainNode) StakingUnbond(ctx context.Context, keyName, validatorAddr, amount string) error

StakingUnbond unstakes tokens from a validator.

func (*ChainNode) StartContainer

func (tn *ChainNode) StartContainer(ctx context.Context) error

func (*ChainNode) StopContainer

func (tn *ChainNode) StopContainer(ctx context.Context) error

func (*ChainNode) StoreClientContract

func (tn *ChainNode) StoreClientContract(ctx context.Context, keyName string, fileName string, extraExecTxArgs ...string) (string, error)

StoreClientContract takes a file path to a client smart contract and stores it on-chain. Returns the contracts code id.

func (*ChainNode) StoreContract

func (tn *ChainNode) StoreContract(ctx context.Context, keyName string, fileName string, extraExecTxArgs ...string) (string, error)

StoreContract takes a file path to smart contract and stores it on-chain. Returns the contracts code id.

func (*ChainNode) SubmitProposal

func (tn *ChainNode) SubmitProposal(ctx context.Context, keyName string, prop TxProposalv1) (string, error)

SubmitProposal submits a gov v1 proposal to the chain.

func (*ChainNode) TextProposal

func (tn *ChainNode) TextProposal(ctx context.Context, keyName string, prop TextProposal) (string, error)

TextProposal submits a text governance proposal to the chain.

func (*ChainNode) TokenFactoryBurnDenom added in v8.1.0

func (tn *ChainNode) TokenFactoryBurnDenom(ctx context.Context, keyName, fullDenom string, amount uint64) (string, error)

TokenFactoryBurnDenom burns a tokenfactory denomination from the holders account.

func (*ChainNode) TokenFactoryBurnDenomFrom added in v8.1.0

func (tn *ChainNode) TokenFactoryBurnDenomFrom(ctx context.Context, keyName, fullDenom string, amount uint64, fromAddr string) (string, error)

TokenFactoryBurnDenomFrom burns a tokenfactory denomination from any other users account. Only the admin of the token can perform this action.

func (*ChainNode) TokenFactoryChangeAdmin added in v8.1.0

func (tn *ChainNode) TokenFactoryChangeAdmin(ctx context.Context, keyName, fullDenom, newAdmin string) (string, error)

TokenFactoryChangeAdmin moves the admin of a tokenfactory token to a new address.

func (*ChainNode) TokenFactoryCreateDenom added in v8.1.0

func (tn *ChainNode) TokenFactoryCreateDenom(ctx context.Context, user ibc.Wallet, denomName string, gas uint64) (string, string, error)

TokenFactoryCreateDenom creates a new tokenfactory token in the format 'factory/accountaddress/name'. This token will be viewable by standard bank balance queries and send functionality. Depending on the chain parameters, this may require a lot of gas (Juno, Osmosis) if the DenomCreationGasConsume param is enabled. If not, the default implementation cost 10,000,000 micro tokens (utoken) of the chain's native token.

func (*ChainNode) TokenFactoryForceTransferDenom added in v8.1.0

func (tn *ChainNode) TokenFactoryForceTransferDenom(ctx context.Context, keyName, fullDenom string, amount uint64, fromAddr, toAddr string) (string, error)

TokenFactoryForceTransferDenom force moves a token from 1 account to another. Only the admin of the token can perform this action.

func (*ChainNode) TokenFactoryMetadata added in v8.1.0

func (tn *ChainNode) TokenFactoryMetadata(ctx context.Context, keyName, fullDenom, ticker, description string, exponent uint64) (string, error)

TokenFactoryMetadata sets the x/bank metadata for a tokenfactory token. This gives the token more detailed information to be queried by frontend UIs and other applications. Only the admin of the token can perform this action.

func (*ChainNode) TokenFactoryMintDenom added in v8.1.0

func (tn *ChainNode) TokenFactoryMintDenom(ctx context.Context, keyName, fullDenom string, amount uint64) (string, error)

TokenFactoryMintDenom mints a tokenfactory denomination to the admins account. Only the admin of the token can perform this action.

func (*ChainNode) TokenFactoryMintDenomTo added in v8.1.0

func (tn *ChainNode) TokenFactoryMintDenomTo(ctx context.Context, keyName, fullDenom string, amount uint64, toAddr string) (string, error)

TokenFactoryMintDenomTo mints a token to any external account. Only the admin of the token can perform this action.

func (*ChainNode) TxCommand

func (tn *ChainNode) TxCommand(keyName string, command ...string) []string

TxCommand is a helper to retrieve a full command for broadcasting a tx with the chain node binary.

func (*ChainNode) TxHashToResponse added in v8.1.0

func (tn *ChainNode) TxHashToResponse(ctx context.Context, txHash string) (*sdk.TxResponse, error)

TxHashToResponse returns the sdk transaction response struct for a given transaction hash.

func (*ChainNode) UnpauseContainer

func (tn *ChainNode) UnpauseContainer(ctx context.Context) error

func (*ChainNode) UnsafeResetAll

func (tn *ChainNode) UnsafeResetAll(ctx context.Context) error

func (*ChainNode) UpgradeCancel added in v8.1.0

func (tn *ChainNode) UpgradeCancel(ctx context.Context, keyName string, extraFlags ...string) error

UpgradeCancel executes the upgrade cancel command.

func (*ChainNode) UpgradeProposal

func (tn *ChainNode) UpgradeProposal(ctx context.Context, keyName string, prop SoftwareUpgradeProposal) (string, error)

UpgradeProposal submits a software-upgrade governance proposal to the chain.

func (*ChainNode) UpgradeSoftware added in v8.1.0

func (tn *ChainNode) UpgradeSoftware(ctx context.Context, keyName, name, info string, height int, extraFlags ...string) error

UpgradeSoftware executes the upgrade software command.

func (*ChainNode) VestingCreateAccount added in v8.1.0

func (tn *ChainNode) VestingCreateAccount(ctx context.Context, keyName string, toAddr string, coin string, endTime int64, flags ...string) error

VestingCreateAccount creates a new vesting account funded with an allocation of tokens. The account can either be a delayed or continuous vesting account, which is determined by the '--delayed' flag. All vesting accounts created will have their start time set by the committed block's time. The end_time must be provided as a UNIX epoch timestamp.

func (*ChainNode) VestingCreatePeriodicAccount added in v8.1.0

func (tn *ChainNode) VestingCreatePeriodicAccount(ctx context.Context, keyName string, toAddr string, periods vestingcli.VestingData, flags ...string) error

VestingCreatePeriodicAccount is a sequence of coins and period length in seconds. Periods are sequential, in that the duration of of a period only starts at the end of the previous period. The duration of the first period starts upon account creation.

func (*ChainNode) VestingCreatePermanentLockedAccount added in v8.1.0

func (tn *ChainNode) VestingCreatePermanentLockedAccount(ctx context.Context, keyName string, toAddr string, coin string, flags ...string) error

VestingCreatePermanentLockedAccount creates a new vesting account funded with an allocation of tokens that are locked indefinitely.

func (*ChainNode) VoteOnProposal

func (tn *ChainNode) VoteOnProposal(ctx context.Context, keyName string, proposalID uint64, vote string) error

VoteOnProposal submits a vote for the specified proposal.

func (*ChainNode) WriteFile

func (tn *ChainNode) WriteFile(ctx context.Context, content []byte, relPath string) error

WriteFile accepts file contents in a byte slice and writes the contents to the docker filesystem. relPath describes the location of the file in the docker volume relative to the home directory

type ChainNodes

type ChainNodes []*ChainNode

ChainNodes is a collection of ChainNode

func (ChainNodes) LogGenesisHashes

func (nodes ChainNodes) LogGenesisHashes(ctx context.Context) error

LogGenesisHashes logs the genesis hashes for the various nodes

func (ChainNodes) PeerString

func (nodes ChainNodes) PeerString(ctx context.Context) string

PeerString returns the string for connecting the nodes passed in

type ClientContextOpt

type ClientContextOpt func(clientContext client.Context) client.Context

type CodeInfo

type CodeInfo struct {
	CodeID string `json:"code_id"`
}

type CodeInfosResponse

type CodeInfosResponse struct {
	CodeInfos []CodeInfo `json:"code_infos"`
}

type ContractStateModels

type ContractStateModels struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type CosmosChain

type CosmosChain struct {
	Validators ChainNodes
	FullNodes  ChainNodes

	// Additional processes that need to be run on a per-chain basis.
	Sidecars SidecarProcesses
	// contains filtered or unexported fields
}

CosmosChain is a local docker testnet for a Cosmos SDK chain. Implements the ibc.Chain interface.

func NewCosmosChain

func NewCosmosChain(testName string, chainConfig ibc.ChainConfig, numValidators int, numFullNodes int, log *zap.Logger) *CosmosChain

func (*CosmosChain) AccAddressFromBech32 added in v8.1.0

func (c *CosmosChain) AccAddressFromBech32(address string) (addr sdk.AccAddress, err error)

AccAddressFromBech32 creates an AccAddress from a Bech32 string. https://github.com/cosmos/cosmos-sdk/blob/v0.50.2/types/address.go#L193-L212

func (*CosmosChain) AccAddressToBech32 added in v8.2.0

func (c *CosmosChain) AccAddressToBech32(addr sdk.AccAddress) (string, error)

func (*CosmosChain) Acknowledgements

func (c *CosmosChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)

Acknowledgements implements ibc.Chain, returning all acknowledgments in block at height

func (*CosmosChain) AddFullNodes

func (c *CosmosChain) AddFullNodes(ctx context.Context, configFileOverrides map[string]any, inc int) error

AddFullNodes adds new fullnodes to the network, peering with the existing nodes.

func (*CosmosChain) AuthAddressBytesToString added in v8.1.0

func (c *CosmosChain) AuthAddressBytesToString(ctx context.Context, addrBz []byte) (string, error)

AddressBytesToString converts a byte array address to a string

func (*CosmosChain) AuthAddressStringToBytes added in v8.1.0

func (c *CosmosChain) AuthAddressStringToBytes(ctx context.Context, addr string) ([]byte, error)

AddressStringToBytes converts a string address to a byte array

func (*CosmosChain) AuthPrintAccountInfo added in v8.1.0

func (c *CosmosChain) AuthPrintAccountInfo(chain *CosmosChain, res *cdctypes.Any) error

func (*CosmosChain) AuthQueryAccount added in v8.1.0

func (c *CosmosChain) AuthQueryAccount(ctx context.Context, addr string) (*cdctypes.Any, error)

AuthQueryAccount performs a query to get the account details of the specified address

func (*CosmosChain) AuthQueryAccountInfo added in v8.1.0

func (c *CosmosChain) AuthQueryAccountInfo(ctx context.Context, addr string) (*authtypes.BaseAccount, error)

AccountInfo queries the account information of the given address

func (*CosmosChain) AuthQueryBech32Prefix added in v8.1.0

func (c *CosmosChain) AuthQueryBech32Prefix(ctx context.Context) (string, error)

func (*CosmosChain) AuthQueryModuleAccount added in v8.1.0

func (c *CosmosChain) AuthQueryModuleAccount(ctx context.Context, moduleName string) (authtypes.ModuleAccount, error)

AuthGetModuleAccount performs a query to get the account details of the specified chain module

func (*CosmosChain) AuthQueryModuleAccounts added in v8.1.0

func (c *CosmosChain) AuthQueryModuleAccounts(ctx context.Context) ([]authtypes.ModuleAccount, error)

AuthQueryModuleAccounts performs a query to get the account details of all the chain modules

func (*CosmosChain) AuthQueryModuleAddress added in v8.1.0

func (c *CosmosChain) AuthQueryModuleAddress(ctx context.Context, moduleName string) (string, error)

GetModuleAddress performs a query to get the address of the specified chain module

func (*CosmosChain) AuthQueryParams added in v8.1.0

func (c *CosmosChain) AuthQueryParams(ctx context.Context) (*authtypes.Params, error)

AuthQueryParams performs a query to get the auth module parameters

func (*CosmosChain) AuthzQueryGrants added in v8.1.0

func (c *CosmosChain) AuthzQueryGrants(ctx context.Context, granter string, grantee string, msgType string, extraFlags ...string) ([]*authz.Grant, error)

AuthzQueryGrants queries all grants for a given granter and grantee.

func (*CosmosChain) AuthzQueryGrantsByGrantee added in v8.1.0

func (c *CosmosChain) AuthzQueryGrantsByGrantee(ctx context.Context, grantee string, extraFlags ...string) ([]*authz.GrantAuthorization, error)

AuthzQueryGrantsByGrantee queries all grants for a given grantee.

func (*CosmosChain) AuthzQueryGrantsByGranter added in v8.1.0

func (c *CosmosChain) AuthzQueryGrantsByGranter(ctx context.Context, granter string, extraFlags ...string) ([]*authz.GrantAuthorization, error)

AuthzQueryGrantsByGranter returns all grants for a granter.

func (*CosmosChain) BankQueryAllBalances added in v8.1.0

func (c *CosmosChain) BankQueryAllBalances(ctx context.Context, address string) (types.Coins, error)

AllBalances fetches an account address's balance for all denoms it holds

func (*CosmosChain) BankQueryBalance added in v8.1.0

func (c *CosmosChain) BankQueryBalance(ctx context.Context, address string, denom string) (sdkmath.Int, error)

BankGetBalance is an alias for GetBalance

func (*CosmosChain) BankQueryDenomMetadata added in v8.1.0

func (c *CosmosChain) BankQueryDenomMetadata(ctx context.Context, denom string) (*banktypes.Metadata, error)

BankDenomMetadata fetches the metadata of a specific coin denomination

func (*CosmosChain) BankQueryDenomMetadataByQueryString added in v8.1.0

func (c *CosmosChain) BankQueryDenomMetadataByQueryString(ctx context.Context, denom string) (*banktypes.Metadata, error)

func (*CosmosChain) BankQueryDenomOwners added in v8.1.0

func (c *CosmosChain) BankQueryDenomOwners(ctx context.Context, denom string) ([]*banktypes.DenomOwner, error)

func (*CosmosChain) BankQueryDenomsMetadata added in v8.1.0

func (c *CosmosChain) BankQueryDenomsMetadata(ctx context.Context) ([]banktypes.Metadata, error)

func (*CosmosChain) BankQueryParams added in v8.1.0

func (c *CosmosChain) BankQueryParams(ctx context.Context) (*banktypes.Params, error)

func (*CosmosChain) BankQuerySendEnabled added in v8.1.0

func (c *CosmosChain) BankQuerySendEnabled(ctx context.Context, denoms []string) ([]*banktypes.SendEnabled, error)

func (*CosmosChain) BankQuerySpendableBalance added in v8.1.0

func (c *CosmosChain) BankQuerySpendableBalance(ctx context.Context, address, denom string) (*types.Coin, error)

func (*CosmosChain) BankQuerySpendableBalances added in v8.1.0

func (c *CosmosChain) BankQuerySpendableBalances(ctx context.Context, address string) (*types.Coins, error)

func (*CosmosChain) BankQueryTotalSupply added in v8.1.0

func (c *CosmosChain) BankQueryTotalSupply(ctx context.Context) (*types.Coins, error)

func (*CosmosChain) BankQueryTotalSupplyOf added in v8.1.0

func (c *CosmosChain) BankQueryTotalSupplyOf(ctx context.Context, address string) (*types.Coin, error)

func (*CosmosChain) BuildProposal

func (c *CosmosChain) BuildProposal(messages []ProtoMessage, title, summary, metadata, depositStr, proposer string, expedited bool) (TxProposalv1, error)

Build a gov v1 proposal type.

The proposer field should only be set for IBC-Go v8 / SDK v50 chains.

func (*CosmosChain) BuildRelayerWallet

func (c *CosmosChain) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error)

BuildRelayerWallet will return a Cosmos wallet populated with the mnemonic so that the wallet can be restored in the relayer node using the mnemonic. After it is built, that address is included in genesis with some funds.

func (*CosmosChain) BuildWallet

func (c *CosmosChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)

BuildWallet will return a Cosmos wallet If mnemonic != "", it will restore using that mnemonic If mnemonic == "", it will create a new key

func (*CosmosChain) Config

func (c *CosmosChain) Config() ibc.ChainConfig

Implements Chain interface

func (*CosmosChain) CreateKey

func (c *CosmosChain) CreateKey(ctx context.Context, keyName string) error

Implements Chain interface

func (*CosmosChain) DistributionQueryCommission added in v8.1.0

func (c *CosmosChain) DistributionQueryCommission(ctx context.Context, valAddr string) (*distrtypes.ValidatorAccumulatedCommission, error)

DistributionCommission returns the validator's commission

func (*CosmosChain) DistributionQueryCommunityPool added in v8.1.0

func (c *CosmosChain) DistributionQueryCommunityPool(ctx context.Context) (*sdk.DecCoins, error)

DistributionCommunityPool returns the community pool

func (*CosmosChain) DistributionQueryDelegationTotalRewards added in v8.1.0

func (c *CosmosChain) DistributionQueryDelegationTotalRewards(ctx context.Context, delegatorAddr string) (*distrtypes.QueryDelegationTotalRewardsResponse, error)

DistributionDelegationTotalRewards returns the delegator's total rewards

func (*CosmosChain) DistributionQueryDelegatorValidators added in v8.1.0

func (c *CosmosChain) DistributionQueryDelegatorValidators(ctx context.Context, delegatorAddr string) (*distrtypes.QueryDelegatorValidatorsResponse, error)

DistributionDelegatorValidators returns the delegator's validators

func (*CosmosChain) DistributionQueryDelegatorWithdrawAddress added in v8.1.0

func (c *CosmosChain) DistributionQueryDelegatorWithdrawAddress(ctx context.Context, delegatorAddr string) (string, error)

DistributionDelegatorWithdrawAddress returns the delegator's withdraw address

func (*CosmosChain) DistributionQueryParams added in v8.1.0

func (c *CosmosChain) DistributionQueryParams(ctx context.Context) (*distrtypes.Params, error)

DistributionParams returns the distribution params

func (*CosmosChain) DistributionQueryRewards added in v8.1.0

func (c *CosmosChain) DistributionQueryRewards(ctx context.Context, delegatorAddr, valAddr string) (sdk.DecCoins, error)

DistributionRewards returns the delegator's rewards

func (*CosmosChain) DistributionQueryValidatorDistributionInfo added in v8.1.0

func (c *CosmosChain) DistributionQueryValidatorDistributionInfo(ctx context.Context, valAddr string) (*distrtypes.QueryValidatorDistributionInfoResponse, error)

DistributionValidatorDistributionInfo returns the validator's distribution info

func (*CosmosChain) DistributionQueryValidatorOutstandingRewards added in v8.1.0

func (c *CosmosChain) DistributionQueryValidatorOutstandingRewards(ctx context.Context, valAddr string) (*distrtypes.ValidatorOutstandingRewards, error)

DistributionValidatorOutstandingRewards returns the validator's outstanding rewards

func (*CosmosChain) DistributionQueryValidatorSlashes added in v8.1.0

func (c *CosmosChain) DistributionQueryValidatorSlashes(ctx context.Context, valAddr string) ([]distrtypes.ValidatorSlashEvent, error)

DistributionValidatorSlashes returns the validator's slashes

func (*CosmosChain) DumpContractState

func (c *CosmosChain) DumpContractState(ctx context.Context, contractAddress string, height int64) (*DumpContractStateResponse, error)

DumpContractState dumps the state of a contract at a block height.

func (*CosmosChain) Exec

func (c *CosmosChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)

Exec implements ibc.Chain.

func (*CosmosChain) ExecuteContract

func (c *CosmosChain) ExecuteContract(ctx context.Context, keyName string, contractAddress string, message string, extraExecTxArgs ...string) (res *types.TxResponse, err error)

ExecuteContract executes a contract transaction with a message using it's address.

func (*CosmosChain) ExportState

func (c *CosmosChain) ExportState(ctx context.Context, height int64) (string, error)

ExportState exports the chain state at specific height. Implements Chain interface

func (*CosmosChain) FeeGrantQueryAllowance added in v8.1.0

func (c *CosmosChain) FeeGrantQueryAllowance(ctx context.Context, granter, grantee string) (*feegrant.Grant, error)

FeeGrantGetAllowance returns the allowance of a granter and grantee pair.

func (*CosmosChain) FeeGrantQueryAllowances added in v8.1.0

func (c *CosmosChain) FeeGrantQueryAllowances(ctx context.Context, grantee string) ([]*feegrant.Grant, error)

FeeGrantGetAllowances returns all allowances of a grantee.

func (*CosmosChain) FeeGrantQueryAllowancesByGranter added in v8.1.0

func (c *CosmosChain) FeeGrantQueryAllowancesByGranter(ctx context.Context, granter string) ([]*feegrant.Grant, error)

FeeGrantGetAllowancesByGranter returns all allowances of a granter.

func (*CosmosChain) FindTxs

func (c *CosmosChain) FindTxs(ctx context.Context, height int64) ([]blockdb.Tx, error)

FindTxs implements blockdb.BlockSaver.

func (*CosmosChain) GetAPIAddress

func (c *CosmosChain) GetAPIAddress() string

Implements Chain interface

func (*CosmosChain) GetAddress

func (c *CosmosChain) GetAddress(ctx context.Context, keyName string) ([]byte, error)

Implements Chain interface

func (*CosmosChain) GetBalance

func (c *CosmosChain) GetBalance(ctx context.Context, address string, denom string) (sdkmath.Int, error)

GetBalance fetches the current balance for a specific account address and denom. Implements Chain interface

func (*CosmosChain) GetCodec added in v8.1.0

func (c *CosmosChain) GetCodec() *codec.ProtoCodec

GetCodec returns the codec for the chain.

func (*CosmosChain) GetGRPCAddress

func (c *CosmosChain) GetGRPCAddress() string

Implements Chain interface

func (*CosmosChain) GetGasFeesInNativeDenom

func (c *CosmosChain) GetGasFeesInNativeDenom(gasPaid int64) int64

func (*CosmosChain) GetGovernanceAddress

func (c *CosmosChain) GetGovernanceAddress(ctx context.Context) (string, error)

GetGovernanceAddress performs a query to get the address of the chain's x/gov module Deprecated: use AuthQueryModuleAddress(ctx, "gov") instead

func (*CosmosChain) GetHostAPIAddress

func (c *CosmosChain) GetHostAPIAddress() string

GetHostAPIAddress returns the address of the REST API server accessible by the host. This will not return a valid address until the chain has been started.

func (*CosmosChain) GetHostGRPCAddress

func (c *CosmosChain) GetHostGRPCAddress() string

GetHostGRPCAddress returns the address of the gRPC server accessible by the host. This will not return a valid address until the chain has been started.

func (*CosmosChain) GetHostPeerAddress added in v8.1.0

func (c *CosmosChain) GetHostPeerAddress() string

GetHostP2PAddress returns the address of the P2P server accessible by the host. This will not return a valid address until the chain has been started.

func (*CosmosChain) GetHostRPCAddress

func (c *CosmosChain) GetHostRPCAddress() string

GetHostRPCAddress returns the address of the RPC server accessible by the host. This will not return a valid address until the chain has been started.

func (*CosmosChain) GetModuleAddress deprecated

func (c *CosmosChain) GetModuleAddress(ctx context.Context, moduleName string) (string, error)

Deprecated: use AuthQueryModuleAddress instead

func (*CosmosChain) GetNode

func (c *CosmosChain) GetNode() *ChainNode

func (*CosmosChain) GetRPCAddress

func (c *CosmosChain) GetRPCAddress() string

Implements Chain interface

func (*CosmosChain) GetTransaction

func (c *CosmosChain) GetTransaction(txhash string) (*types.TxResponse, error)

func (*CosmosChain) GovQueryParams added in v8.1.0

func (c *CosmosChain) GovQueryParams(ctx context.Context, paramsType string) (*govv1.Params, error)

GovQueryParams returns the current governance parameters.

func (*CosmosChain) GovQueryProposal added in v8.1.0

func (c *CosmosChain) GovQueryProposal(ctx context.Context, proposalID uint64) (*govv1beta1.Proposal, error)

GovQueryProposal returns the state and details of a v1beta1 governance proposal.

func (*CosmosChain) GovQueryProposalV1 added in v8.1.0

func (c *CosmosChain) GovQueryProposalV1(ctx context.Context, proposalID uint64) (*govv1.Proposal, error)

GovQueryProposalV1 returns the state and details of a v1 governance proposal.

func (*CosmosChain) GovQueryProposalsV1 added in v8.1.0

func (c *CosmosChain) GovQueryProposalsV1(ctx context.Context, status govv1.ProposalStatus) ([]*govv1.Proposal, error)

GovQueryProposalsV1 returns all proposals with a given status.

func (*CosmosChain) GovQueryVote added in v8.1.0

func (c *CosmosChain) GovQueryVote(ctx context.Context, proposalID uint64, voter string) (*govv1.Vote, error)

GovQueryVote returns the vote for a proposal from a specific voter.

func (*CosmosChain) GovQueryVotes added in v8.1.0

func (c *CosmosChain) GovQueryVotes(ctx context.Context, proposalID uint64) ([]*govv1.Vote, error)

GovQueryVotes returns all votes for a proposal.

func (*CosmosChain) Height

func (c *CosmosChain) Height(ctx context.Context) (int64, error)

Height implements ibc.Chain

func (*CosmosChain) HomeDir

func (c *CosmosChain) HomeDir() string

HomeDir implements ibc.Chain.

func (*CosmosChain) Initialize

func (c *CosmosChain) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error

Implements Chain interface

func (*CosmosChain) InstantiateContract

func (c *CosmosChain) InstantiateContract(ctx context.Context, keyName string, codeID string, initMessage string, needsNoAdminFlag bool, extraExecTxArgs ...string) (string, error)

InstantiateContract takes a code id for a smart contract and initialization message and returns the instantiated contract address.

func (*CosmosChain) NewChainNode

func (c *CosmosChain) NewChainNode(
	ctx context.Context,
	testName string,
	cli *client.Client,
	networkID string,
	image ibc.DockerImage,
	validator bool,
	index int,
) (*ChainNode, error)

NewChainNode constructs a new cosmos chain node with a docker volume.

func (*CosmosChain) NewSidecarProcess

func (c *CosmosChain) NewSidecarProcess(
	ctx context.Context,
	preStart bool,
	processName string,
	testName string,
	cli *client.Client,
	networkID string,
	image ibc.DockerImage,
	homeDir string,
	index int,
	ports []string,
	startCmd []string,
	env []string,
) error

NewSidecarProcess constructs a new sidecar process with a docker volume.

func (*CosmosChain) Nodes

func (c *CosmosChain) Nodes() ChainNodes

Nodes returns all nodes, including validators and fullnodes.

func (*CosmosChain) ParamChangeProposal

func (c *CosmosChain) ParamChangeProposal(ctx context.Context, keyName string, prop *paramsutils.ParamChangeProposalJSON) (tx TxProposal, _ error)

ParamChangeProposal submits a param change proposal to the chain, signed by keyName.

func (*CosmosChain) PushNewWasmClientProposal

func (c *CosmosChain) PushNewWasmClientProposal(ctx context.Context, keyName string, fileName string, prop TxProposalv1) (TxProposal, string, error)

PushNewWasmClientProposal submits a new wasm client governance proposal to the chain

func (*CosmosChain) QueryBankMetadata

func (c *CosmosChain) QueryBankMetadata(ctx context.Context, denom string) (*BankMetaData, error)

QueryBankMetadata returns the metadata of a given token denomination.

func (*CosmosChain) QueryClientContractCode

func (c *CosmosChain) QueryClientContractCode(ctx context.Context, codeHash string, response any) error

QueryClientContractCode performs a query with the contract codeHash as the input and code as the output

func (*CosmosChain) QueryContract

func (c *CosmosChain) QueryContract(ctx context.Context, contractAddress string, query any, response any) error

QueryContract performs a smart query, taking in a query struct and returning a error with the response struct populated.

func (*CosmosChain) QueryParam

func (c *CosmosChain) QueryParam(ctx context.Context, subspace, key string) (*ParamChange, error)

QueryParam returns the param state of a given key.

func (*CosmosChain) RecoverKey

func (c *CosmosChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error

Implements Chain interface

func (*CosmosChain) SendFunds

func (c *CosmosChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error

Implements Chain interface

func (*CosmosChain) SendIBCTransfer

func (c *CosmosChain) SendIBCTransfer(
	ctx context.Context,
	channelID string,
	keyName string,
	amount ibc.WalletAmount,
	options ibc.TransferOptions,
) (tx ibc.Tx, _ error)

Implements Chain interface

func (*CosmosChain) SlashingQueryParams added in v8.1.0

func (c *CosmosChain) SlashingQueryParams(ctx context.Context) (*slashingtypes.Params, error)

SlashingGetParams returns slashing params

func (*CosmosChain) SlashingQuerySigningInfo added in v8.1.0

func (c *CosmosChain) SlashingQuerySigningInfo(ctx context.Context, consAddress string) (*slashingtypes.ValidatorSigningInfo, error)

SlashingSigningInfo returns signing info for a validator

func (*CosmosChain) SlashingQuerySigningInfos added in v8.1.0

func (c *CosmosChain) SlashingQuerySigningInfos(ctx context.Context) ([]slashingtypes.ValidatorSigningInfo, error)

SlashingSigningInfos returns all signing infos

func (*CosmosChain) StakingQueryDelegation added in v8.1.0

func (c *CosmosChain) StakingQueryDelegation(ctx context.Context, valAddr string, delegator string) (*stakingtypes.DelegationResponse, error)

StakingQueryDelegation returns a delegation.

func (*CosmosChain) StakingQueryDelegations added in v8.1.0

func (c *CosmosChain) StakingQueryDelegations(ctx context.Context, delegator string) ([]stakingtypes.DelegationResponse, error)

StakingQueryDelegations returns all delegations for a delegator.

func (*CosmosChain) StakingQueryDelegationsTo added in v8.1.0

func (c *CosmosChain) StakingQueryDelegationsTo(ctx context.Context, validator string) ([]*stakingtypes.DelegationResponse, error)

StakingQueryDelegationsTo returns all delegations to a validator.

func (*CosmosChain) StakingQueryDelegatorValidator added in v8.1.0

func (c *CosmosChain) StakingQueryDelegatorValidator(ctx context.Context, delegator string, validator string) (*stakingtypes.Validator, error)

StakingQueryDelegatorValidator returns a validator for a delegator.

func (*CosmosChain) StakingQueryDelegatorValidators added in v8.1.0

func (c *CosmosChain) StakingQueryDelegatorValidators(ctx context.Context, delegator string) ([]stakingtypes.Validator, error)

StakingQueryDelegatorValidators returns all validators for a delegator.

func (*CosmosChain) StakingQueryHistoricalInfo added in v8.1.0

func (c *CosmosChain) StakingQueryHistoricalInfo(ctx context.Context, height int64) (*stakingtypes.HistoricalInfo, error)

StakingQueryHistoricalInfo returns the historical info at the given height.

func (*CosmosChain) StakingQueryParams added in v8.1.0

func (c *CosmosChain) StakingQueryParams(ctx context.Context) (*stakingtypes.Params, error)

StakingQueryParams returns the staking parameters.

func (*CosmosChain) StakingQueryPool added in v8.1.0

func (c *CosmosChain) StakingQueryPool(ctx context.Context) (*stakingtypes.Pool, error)

StakingQueryPool returns the current staking pool values.

func (*CosmosChain) StakingQueryRedelegation added in v8.1.0

func (c *CosmosChain) StakingQueryRedelegation(ctx context.Context, delegator string, srcValAddr string, dstValAddr string) ([]stakingtypes.RedelegationResponse, error)

StakingQueryRedelegation returns a redelegation.

func (*CosmosChain) StakingQueryUnbondingDelegation added in v8.1.0

func (c *CosmosChain) StakingQueryUnbondingDelegation(ctx context.Context, delegator string, validator string) (*stakingtypes.UnbondingDelegation, error)

StakingQueryUnbondingDelegation returns an unbonding delegation.

func (*CosmosChain) StakingQueryUnbondingDelegations added in v8.1.0

func (c *CosmosChain) StakingQueryUnbondingDelegations(ctx context.Context, delegator string) ([]stakingtypes.UnbondingDelegation, error)

StakingQueryUnbondingDelegations returns all unbonding delegations for a delegator.

func (*CosmosChain) StakingQueryUnbondingDelegationsFrom added in v8.1.0

func (c *CosmosChain) StakingQueryUnbondingDelegationsFrom(ctx context.Context, validator string) ([]stakingtypes.UnbondingDelegation, error)

StakingQueryUnbondingDelegationsFrom returns all unbonding delegations from a validator.

func (*CosmosChain) StakingQueryValidator added in v8.1.0

func (c *CosmosChain) StakingQueryValidator(ctx context.Context, validator string) (*stakingtypes.Validator, error)

StakingQueryValidator returns a validator.

func (*CosmosChain) StakingQueryValidators added in v8.1.0

func (c *CosmosChain) StakingQueryValidators(ctx context.Context, status string) ([]stakingtypes.Validator, error)

StakingQueryValidators returns all validators.

func (*CosmosChain) Start

func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error

Bootstraps the chain and starts it from genesis

func (*CosmosChain) StartAllNodes

func (c *CosmosChain) StartAllNodes(ctx context.Context) error

StartAllNodes creates and starts new containers for each node. Should only be used if the chain has previously been started with .Start.

func (*CosmosChain) StartAllSidecars

func (c *CosmosChain) StartAllSidecars(ctx context.Context) error

StartAllSidecars creates and starts new containers for each sidecar process. Should only be used if the chain has previously been started with .Start.

func (*CosmosChain) StartAllValSidecars

func (c *CosmosChain) StartAllValSidecars(ctx context.Context) error

StartAllValSidecars creates and starts new containers for each validator sidecar process. Should only be used if the chain has previously been started with .Start.

func (*CosmosChain) StopAllNodes

func (c *CosmosChain) StopAllNodes(ctx context.Context) error

StopAllNodes stops and removes all long running containers (validators and full nodes)

func (*CosmosChain) StopAllSidecars

func (c *CosmosChain) StopAllSidecars(ctx context.Context) error

StopAllSidecars stops and removes all long-running containers for sidecar processes.

func (*CosmosChain) StoreClientContract

func (c *CosmosChain) StoreClientContract(ctx context.Context, keyName string, fileName string, extraExecTxArgs ...string) (string, error)

StoreClientContract takes a file path to a client smart contract and stores it on-chain. Returns the contracts code id.

func (*CosmosChain) StoreContract

func (c *CosmosChain) StoreContract(ctx context.Context, keyName string, fileName string, extraExecTxArgs ...string) (string, error)

StoreContract takes a file path to smart contract and stores it on-chain. Returns the contracts code id.

func (*CosmosChain) SubmitProposal

func (c *CosmosChain) SubmitProposal(ctx context.Context, keyName string, prop TxProposalv1) (tx TxProposal, _ error)

SubmitProposal submits a gov v1 proposal to the chain.

func (*CosmosChain) TextProposal

func (c *CosmosChain) TextProposal(ctx context.Context, keyName string, prop TextProposal) (tx TxProposal, _ error)

TextProposal submits a text governance proposal to the chain.

func (*CosmosChain) Timeouts

func (c *CosmosChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)

Timeouts implements ibc.Chain, returning all timeouts in block at height

func (*CosmosChain) TokenFactoryQueryAdmin added in v8.1.0

func (c *CosmosChain) TokenFactoryQueryAdmin(ctx context.Context, fullDenom string) (*QueryDenomAuthorityMetadataResponse, error)

TokenFactoryQueryAdmin returns the admin of a tokenfactory token.

func (*CosmosChain) UpgradeProposal

func (c *CosmosChain) UpgradeProposal(ctx context.Context, keyName string, prop SoftwareUpgradeProposal) (tx TxProposal, _ error)

UpgradeProposal submits a software-upgrade governance proposal to the chain.

func (*CosmosChain) UpgradeQueryAllModuleVersions added in v8.1.0

func (c *CosmosChain) UpgradeQueryAllModuleVersions(ctx context.Context) ([]*upgradetypes.ModuleVersion, error)

UpgradeQueryAllModuleVersions queries the list of module versions from state.

func (*CosmosChain) UpgradeQueryAppliedPlan added in v8.1.0

func (c *CosmosChain) UpgradeQueryAppliedPlan(ctx context.Context, name string) (*upgradetypes.QueryAppliedPlanResponse, error)

UpgradeQueryAppliedPlan queries a previously applied upgrade plan by its name.

func (*CosmosChain) UpgradeQueryAuthority added in v8.1.0

func (c *CosmosChain) UpgradeQueryAuthority(ctx context.Context) (string, error)

UpgradeQueryAuthority returns the account with authority to conduct upgrades

func (*CosmosChain) UpgradeQueryModuleVersion added in v8.1.0

func (c *CosmosChain) UpgradeQueryModuleVersion(ctx context.Context, module string) (*upgradetypes.ModuleVersion, error)

UpgradeQueryModuleVersion queries a specific module version from state.

func (*CosmosChain) UpgradeQueryPlan added in v8.1.0

func (c *CosmosChain) UpgradeQueryPlan(ctx context.Context) (*upgradetypes.Plan, error)

UpgradeQueryPlan queries the current upgrade plan.

func (*CosmosChain) UpgradeVersion

func (c *CosmosChain) UpgradeVersion(ctx context.Context, cli *client.Client, containerRepo, version string)

func (*CosmosChain) VoteOnProposalAllValidators

func (c *CosmosChain) VoteOnProposalAllValidators(ctx context.Context, proposalID string, vote string) error

type CosmosTx

type CosmosTx struct {
	TxHash string `json:"txhash"`
	Code   int    `json:"code"`
	RawLog string `json:"raw_log"`
}

type CosmosWallet

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

func (*CosmosWallet) Address

func (w *CosmosWallet) Address() []byte

Get Address with chain's prefix

func (*CosmosWallet) FormattedAddress

func (w *CosmosWallet) FormattedAddress() string

Get formatted address, passing in a prefix

func (*CosmosWallet) FormattedAddressWithPrefix

func (w *CosmosWallet) FormattedAddressWithPrefix(prefix string) string

func (*CosmosWallet) KeyName

func (w *CosmosWallet) KeyName() string

func (*CosmosWallet) Mnemonic

func (w *CosmosWallet) Mnemonic() string

Get mnemonic, only used for relayer wallets

type DenomAuthorityMetadata

type DenomAuthorityMetadata struct {
	// Can be empty for no admin, or a valid address
	Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"`
}

type DumpContractStateResponse

type DumpContractStateResponse struct {
	Models []ContractStateModels `json:"models"`
}

type FactoryOpt

type FactoryOpt func(factory tx.Factory) tx.Factory

type GenesisFile

type GenesisFile struct {
	Validators []GenesisValidators `json:"validators"`
}

type GenesisKV

type GenesisKV struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

func NewGenesisKV

func NewGenesisKV(key string, value interface{}) GenesisKV

type GenesisValidatorPubKey

type GenesisValidatorPubKey struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type GenesisValidators

type GenesisValidators struct {
	Address string                 `json:"address"`
	Name    string                 `json:"name"`
	Power   string                 `json:"power"`
	PubKey  GenesisValidatorPubKey `json:"pub_key"`
}

type InstantiateContractAttribute

type InstantiateContractAttribute struct {
	Value string `json:"value"`
}

type InstantiateContractEvent

type InstantiateContractEvent struct {
	Attributes []InstantiateContractAttribute `json:"attributes"`
}

type InstantiateContractLog

type InstantiateContractLog struct {
	Events []InstantiateContractEvent `json:"event"`
}

type InstantiateContractResponse

type InstantiateContractResponse struct {
	Logs []InstantiateContractLog `json:"log"`
}

type OsmosisPoolParams

type OsmosisPoolParams struct {
	Weights        string `json:"weights"`
	InitialDeposit string `json:"initial-deposit"`
	SwapFee        string `json:"swap-fee"`
	ExitFee        string `json:"exit-fee"`
	FutureGovernor string `json:"future-governor"`
}

OsmosisPoolParams defines parameters for creating an osmosis gamm liquidity pool

type ParamChange

type ParamChange struct {
	Subspace string `json:"subspace"`
	Key      string `json:"key"`
	Value    any    `json:"value"`
}

type PrivValidatorKey

type PrivValidatorKey struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type PrivValidatorKeyFile

type PrivValidatorKeyFile struct {
	Address string           `json:"address"`
	PubKey  PrivValidatorKey `json:"pub_key"`
	PrivKey PrivValidatorKey `json:"priv_key"`
}

type ProposalContent

type ProposalContent struct {
	Type        string `json:"@type"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type ProposalDeposit

type ProposalDeposit struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type ProposalFinalTallyResult

type ProposalFinalTallyResult struct {
	Yes        string `json:"yes_count"`
	Abstain    string `json:"abstain_count"`
	No         string `json:"no_count"`
	NoWithVeto string `json:"no_with_veto_count"`
}

type ProposalFinalTallyResultV8

type ProposalFinalTallyResultV8 struct {
	Yes        string `json:"yes_count"`
	Abstain    string `json:"abstain_count"`
	No         string `json:"no_count"`
	NoWithVeto string `json:"no_with_veto_count"`
}

type ProposalMessage

type ProposalMessage struct {
	Type  string `json:"type"`
	Value struct {
		Sender           string `json:"sender"`
		ValidatorAddress string `json:"validator_address"`
		Power            string `json:"power"`
		Unsafe           bool   `json:"unsafe"`
	} `json:"value"`
}

type ProposalMessageV8

type ProposalMessageV8 struct {
	Type  string `json:"type"`
	Value struct {
		Sender           string `json:"sender"`
		ValidatorAddress string `json:"validator_address"`
		Power            string `json:"power"`
		Unsafe           bool   `json:"unsafe"`
	} `json:"value"`
}

type ProposalResponse

type ProposalResponse struct {
	ProposalID       string                   `json:"proposal_id"`
	Content          ProposalContent          `json:"content"`
	Status           string                   `json:"status"`
	FinalTallyResult ProposalFinalTallyResult `json:"final_tally_result"`
	SubmitTime       string                   `json:"submit_time"`
	DepositEndTime   string                   `json:"deposit_end_time"`
	TotalDeposit     []ProposalDeposit        `json:"total_deposit"`
	VotingStartTime  string                   `json:"voting_start_time"`
	VotingEndTime    string                   `json:"voting_end_time"`
}

ProposalResponse is the proposal query response.

type ProposalResponseV8

type ProposalResponseV8 struct {
	Proposal struct {
		ID               string                     `json:"id"`
		Messages         []ProposalMessageV8        `json:"messages"`
		Status           int                        `json:"status"`
		FinalTallyResult ProposalFinalTallyResultV8 `json:"final_tally_result"`
		SubmitTime       time.Time                  `json:"submit_time"`
		DepositEndTime   time.Time                  `json:"deposit_end_time"`
		TotalDeposit     []ProposalDeposit          `json:"total_deposit"`
		VotingStartTime  time.Time                  `json:"voting_start_time"`
		VotingEndTime    time.Time                  `json:"voting_end_time"`
		Metadata         string                     `json:"metadata"`
		Title            string                     `json:"title"`
		Summary          string                     `json:"summary"`
		Proposer         string                     `json:"proposer"`
	} `json:"proposal"`
}

ProposalResponse is the proposal query response for IBC-Go v8 / SDK v50.

type ProtoMessage added in v8.1.0

type ProtoMessage interface {
	Reset()
	String() string
	ProtoMessage()
}

ProtoMessage is implemented by generated protocol buffer messages. Pulled from github.com/cosmos/gogoproto/proto.

type QueryContractResponse

type QueryContractResponse struct {
	Contracts []string `json:"contracts"`
}

type QueryDenomAuthorityMetadataResponse

type QueryDenomAuthorityMetadataResponse struct {
	AuthorityMetadata DenomAuthorityMetadata `` /* 128-byte string literal not displayed */
}

func TokenFactoryGetAdmin deprecated

func TokenFactoryGetAdmin(c *CosmosChain, ctx context.Context, fullDenom string) (*QueryDenomAuthorityMetadataResponse, error)

Deprecated: use TokenFactoryQueryAdmin instead

type SidecarProcess

type SidecarProcess struct {
	Index int
	Chain ibc.Chain

	ProcessName string
	TestName    string

	VolumeName   string
	DockerClient *dockerclient.Client
	NetworkID    string
	Image        ibc.DockerImage
	// contains filtered or unexported fields
}

SidecarProcess represents a companion process that may be required on a per chain or per validator basis.

func NewSidecar

func NewSidecar(
	log *zap.Logger,
	validatorProcess bool,
	preStart bool,
	chain ibc.Chain,
	dockerClient *dockerclient.Client,
	networkID, processName, testName string,
	image ibc.DockerImage,
	homeDir string,
	index int,
	ports []string,
	startCmd []string,
	env []string,
) *SidecarProcess

NewSidecar instantiates a new SidecarProcess.

func (*SidecarProcess) Bind

func (s *SidecarProcess) Bind() []string

Bind returns the home folder bind point for running the process.

func (*SidecarProcess) CopyFile

func (s *SidecarProcess) CopyFile(ctx context.Context, srcPath, dstPath string) error

CopyFile adds a file from the host filesystem to the docker filesystem relPath describes the location of the file in the docker volume relative to the home directory

func (*SidecarProcess) CreateContainer

func (s *SidecarProcess) CreateContainer(ctx context.Context) error

func (*SidecarProcess) Exec

func (s *SidecarProcess) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)

Exec enables the execution of arbitrary CLI cmds against the process.

func (*SidecarProcess) GetHostPorts

func (s *SidecarProcess) GetHostPorts(ctx context.Context, portIDs ...string) ([]string, error)

func (*SidecarProcess) HomeDir

func (s *SidecarProcess) HomeDir() string

HomeDir returns the path name where any configuration files will be written to the Docker filesystem.

func (*SidecarProcess) HostName

func (s *SidecarProcess) HostName() string

func (*SidecarProcess) Name

func (s *SidecarProcess) Name() string

Name returns a string identifier based on if this process is configured to run on a chain level or on a per validator level.

func (*SidecarProcess) PauseContainer

func (s *SidecarProcess) PauseContainer(ctx context.Context) error

func (*SidecarProcess) ReadFile

func (s *SidecarProcess) ReadFile(ctx context.Context, relPath string) ([]byte, error)

ReadFile reads the contents of a single file at the specified path in the docker filesystem. relPath describes the location of the file in the docker volume relative to the home directory.

func (*SidecarProcess) RemoveContainer

func (s *SidecarProcess) RemoveContainer(ctx context.Context) error

func (*SidecarProcess) StartContainer

func (s *SidecarProcess) StartContainer(ctx context.Context) error

func (*SidecarProcess) StopContainer

func (s *SidecarProcess) StopContainer(ctx context.Context) error

func (*SidecarProcess) UnpauseContainer

func (s *SidecarProcess) UnpauseContainer(ctx context.Context) error

func (*SidecarProcess) WriteFile

func (s *SidecarProcess) WriteFile(ctx context.Context, content []byte, relPath string) error

WriteFile accepts file contents in a byte slice and writes the contents to the docker filesystem. relPath describes the location of the file in the docker volume relative to the home directory

type SidecarProcesses

type SidecarProcesses []*SidecarProcess

type SoftwareUpgradeProposal

type SoftwareUpgradeProposal struct {
	Deposit     string
	Title       string
	Name        string
	Description string
	Height      int64
	Info        string // optional
}

SoftwareUpgradeProposal defines the required and optional parameters for submitting a software-upgrade proposal.

type TextProposal

type TextProposal struct {
	Deposit     string
	Title       string
	Description string
	Expedited   bool
}

SoftwareUpgradeProposal defines the required and optional parameters for submitting a software-upgrade proposal.

type TxProposal

type TxProposal struct {
	// The block height.
	Height int64
	// The transaction hash.
	TxHash string
	// Amount of gas charged to the account.
	GasSpent int64

	// Amount deposited for proposal.
	DepositAmount string
	// ID of proposal.
	ProposalID string
	// Type of proposal.
	ProposalType string
}

TxProposal contains chain proposal transaction details.

type TxProposalv1

type TxProposalv1 struct {
	Messages []json.RawMessage `json:"messages"`
	Metadata string            `json:"metadata"`
	Deposit  string            `json:"deposit"`
	Title    string            `json:"title"`
	Summary  string            `json:"summary"`

	// SDK v50 only
	Proposer  string `json:"proposer,omitempty"`
	Expedited bool   `json:"expedited,omitempty"`
}

TxProposalv1 contains chain proposal transaction detail for gov module v1 (sdk v0.46.0+)

type User

type User interface {
	KeyName() string
	FormattedAddress() string
}

type ValidatorWithIntPower

type ValidatorWithIntPower struct {
	Address      string
	Power        int64
	PubKeyBase64 string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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