Documentation ¶
Index ¶
- func Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, ...) error
- func GetBalance(chain *Client, address string) (sdk.Coins, error)
- func IBCTransferTokens(chain1, chain2 *Client, chain2Addr string, amount int) error
- func InstantiateContract(chain *Client, codeID uint64, label string, initMsg []byte, funds ...sdk.Coin) (map[uint64]string, error)
- func JustContracts(provider, consumer, configFile, wasmContractPath string, ...) error
- func MeshSecurity(provider, consumer, configFile, wasmContractPath string, ...) (*ProviderClient, *ConsumerClient, error)
- func Querier(chain *Client) func(contract string, query Query) map[string]any
- func SmartQuery(chain *Client, contractAddr string, queryMsg interface{}, response interface{}) error
- func StoreCode(chain *Client, byteCode []byte) (wasmtypes.MsgStoreCodeResponse, error)
- func StoreCodeFile(chain *Client, filename string) (wasmtypes.MsgStoreCodeResponse, error)
- type Chain
- type ChainClient
- func (c *ChainClient) CreateRandWallet(keyName string) (string, error)
- func (c *ChainClient) CreateWallet(keyName, mnemonic string) (string, error)
- func (c *ChainClient) CreditFromFaucet(address string) error
- func (c *ChainClient) CustomSendMsg(ctx context.Context, keyName string, msg sdk.Msg, memo string) (*sdk.TxResponse, error)
- func (c *ChainClient) CustomSendMsgs(ctx context.Context, keyName string, msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)
- func (c *ChainClient) GetChainAssets() ([]*pb.ChainAsset, error)
- func (c *ChainClient) GetChainDenom() (string, error)
- func (c *ChainClient) GetChainID() string
- func (c *ChainClient) GetChainKeys() (*pb.Keys, error)
- func (c *ChainClient) GetChainRegistry() (*pb.ChainRegistry, error)
- func (c *ChainClient) GetGenesisMnemonic() (string, error)
- func (c *ChainClient) GetHeight() (int64, error)
- func (c *ChainClient) GetIBCChannel(chain2 string) (*pb.ChannelData, error)
- func (c *ChainClient) GetIBCInfo(chain2 string) (*pb.IBCData, error)
- func (c *ChainClient) GetRPCAddr() string
- func (c *ChainClient) GetStatus() (*coretypes.ResultStatus, error)
- func (c *ChainClient) Initialize() error
- func (c *ChainClient) MustGetChainDenom() string
- func (c *ChainClient) SendMsg(ctx context.Context, msg sdk.Msg, memo string) (*sdk.TxResponse, error)
- func (c *ChainClient) SendMsgs(ctx context.Context, msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)
- type ChainClients
- type Client
- func (c *Client) CreateRandWallet(keyName string) (string, error)
- func (c *Client) CreateWallet(keyName, mnemonic string) (string, error)
- func (c *Client) GetChainDenom() (string, error)
- func (c *Client) GetChainID() string
- func (c *Client) GetHeight() (int64, error)
- func (c *Client) GetIBCChannel(chain2 string) (*pb.ChannelData, error)
- func (c *Client) GetIBCInfo(chain2 string) (*pb.IBCData, error)
- func (c *Client) Initialize() error
- func (c *Client) StakeTokens(valAddr string, amount int, denom string) error
- func (c *Client) WaitForHeight(t *testing.T, height int64)
- func (c *Client) WaitForTx(t *testing.T, txHex string)
- type CmdRunner
- type Config
- type ConsumerClient
- func (p *ConsumerClient) BootstrapContracts(remoteDenom string) (*ConsumerContract, error)
- func (p *ConsumerClient) ExecNewEpoch()
- func (p *ConsumerClient) MustExecGovProposal(msg *types.MsgSetVirtualStakingMaxCap)
- func (p *ConsumerClient) QueryMaxCap() types.QueryVirtualStakingMaxCapLimitResponse
- func (p *ConsumerClient) StoreContracts() ([]uint64, error)
- type ConsumerContract
- type Feature
- type HighLowType
- type Port
- type ProviderClient
- func (p *ProviderClient) BootstrapContracts(connId, portID, rewardDenom string) (*ProviderContracts, error)
- func (p ProviderClient) MustExecExtStaking(payload string, funds ...sdk.Coin) (*sdk.TxResponse, error)
- func (p ProviderClient) MustExecVault(payload string, funds ...sdk.Coin) (*sdk.TxResponse, error)
- func (p ProviderClient) MustFailExecVault(payload string, funds ...sdk.Coin) error
- func (p ProviderClient) QueryExtStaking(q Query) map[string]any
- func (p ProviderClient) QueryVault(q Query) map[string]any
- func (p ProviderClient) QueryVaultFreeBalance() int
- func (p *ProviderClient) StoreContracts() ([]uint64, error)
- type ProviderContracts
- type Query
- type Relayer
- type Upgrade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eventually ¶
func IBCTransferTokens ¶
IBCTransferTokens will transfer chain native token from chain1 to chain2 at given address
func InstantiateContract ¶
func JustContracts ¶
func MeshSecurity ¶
func MeshSecurity(provider, consumer, configFile, wasmContractPath string, wasmContractGZipped bool) (*ProviderClient, *ConsumerClient, error)
func SmartQuery ¶
func SmartQuery(chain *Client, contractAddr string, queryMsg interface{}, response interface{}) error
SmartQuery This will serialize the query message and submit it to the contract. The response is parsed into the provided interface. Usage: SmartQuery(addr, QueryMsg{Foo: 1}, &response)
func StoreCode ¶
func StoreCode(chain *Client, byteCode []byte) (wasmtypes.MsgStoreCodeResponse, error)
todo
func StoreCodeFile ¶
func StoreCodeFile(chain *Client, filename string) (wasmtypes.MsgStoreCodeResponse, error)
Types ¶
type Chain ¶
type Chain struct { Name string `name:"name" json:"name" yaml:"name"` Type string `name:"type" json:"type" yaml:"type"` NumValidators int `name:"num-validators" json:"num_validators" yaml:"numValidators"` Ports Port `name:"ports" json:"ports" yaml:"ports"` Upgrade Upgrade `name:"upgrade" json:"upgrade" yaml:"upgrade"` }
func (*Chain) GetRESTAddr ¶
func (*Chain) GetRPCAddr ¶
type ChainClient ¶
type ChainClient struct { Logger *zap.Logger Config *Config Address string ChainID string ChainConfig *lens.ChainClientConfig Client *lens.ChainClient }
func NewChainClient ¶
func (*ChainClient) CreateRandWallet ¶
func (c *ChainClient) CreateRandWallet(keyName string) (string, error)
func (*ChainClient) CreateWallet ¶
func (c *ChainClient) CreateWallet(keyName, mnemonic string) (string, error)
func (*ChainClient) CreditFromFaucet ¶
func (c *ChainClient) CreditFromFaucet(address string) error
func (*ChainClient) CustomSendMsg ¶
func (c *ChainClient) CustomSendMsg(ctx context.Context, keyName string, msg sdk.Msg, memo string) (*sdk.TxResponse, error)
func (*ChainClient) CustomSendMsgs ¶
func (c *ChainClient) CustomSendMsgs(ctx context.Context, keyName string, msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)
CustomSendMsgs wraps the msgs in a StdTx, signs and sends it. An error is returned if there was an issue sending the transaction. A successfully sent, but failed transaction will not return an error. If a transaction is successfully sent, the result of the execution of that transaction will be logged. A boolean indicating if a transaction was successfully sent and executed successfully is returned.
func (*ChainClient) GetChainAssets ¶
func (c *ChainClient) GetChainAssets() ([]*pb.ChainAsset, error)
GetChainAssets fetches the assets from chain registry at `/chains/{chain-id}/assets` endpoint
func (*ChainClient) GetChainDenom ¶
func (c *ChainClient) GetChainDenom() (string, error)
func (*ChainClient) GetChainID ¶
func (c *ChainClient) GetChainID() string
func (*ChainClient) GetChainKeys ¶
func (c *ChainClient) GetChainKeys() (*pb.Keys, error)
GetChainKeys fetches keys from the chain registry at `/chains/{chain-id}/keys` endpoint
func (*ChainClient) GetChainRegistry ¶
func (c *ChainClient) GetChainRegistry() (*pb.ChainRegistry, error)
GetChainRegistry fetches the chain registry from the registry at `/chains/{chain-id}` endpoint
func (*ChainClient) GetGenesisMnemonic ¶
func (c *ChainClient) GetGenesisMnemonic() (string, error)
GetGenesisMnemonic fetches the mnemonic from GetChainKeys and returns the first mnemonic in genesis list
func (*ChainClient) GetHeight ¶
func (c *ChainClient) GetHeight() (int64, error)
func (*ChainClient) GetIBCChannel ¶
func (c *ChainClient) GetIBCChannel(chain2 string) (*pb.ChannelData, error)
func (*ChainClient) GetIBCInfo ¶
func (c *ChainClient) GetIBCInfo(chain2 string) (*pb.IBCData, error)
func (*ChainClient) GetRPCAddr ¶
func (c *ChainClient) GetRPCAddr() string
func (*ChainClient) GetStatus ¶
func (c *ChainClient) GetStatus() (*coretypes.ResultStatus, error)
func (*ChainClient) Initialize ¶
func (c *ChainClient) Initialize() error
func (*ChainClient) MustGetChainDenom ¶
func (c *ChainClient) MustGetChainDenom() string
func (*ChainClient) SendMsg ¶
func (c *ChainClient) SendMsg(ctx context.Context, msg sdk.Msg, memo string) (*sdk.TxResponse, error)
func (*ChainClient) SendMsgs ¶
func (c *ChainClient) SendMsgs(ctx context.Context, msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)
SendMsgs wraps the msgs in a StdTx, signs and sends it. An error is returned if there was an issue sending the transaction. A successfully sent, but failed transaction will not return an error. If a transaction is successfully sent, the result of the execution of that transaction will be logged. A boolean indicating if a transaction was successfully sent and executed successfully is returned.
type ChainClients ¶
type ChainClients []*ChainClient
func NewChainClients ¶
func NewChainClients(logger *zap.Logger, config *Config) (ChainClients, error)
func (ChainClients) GetChainClient ¶
func (cc ChainClients) GetChainClient(chainID string) (*ChainClient, error)
GetChainClient returns a chain client pointer for the given chain id
type Client ¶
type Client struct { Logger *zap.Logger Config *Config Name string Address string ChainID string Denom string StarshipClient *ChainClient ChainConfig *lens.ChainClientConfig Client *lens.ChainClient }
func NewClient ¶
func NewClient(name string, logger *zap.Logger, starshipClient *ChainClient, modulesBasics []module.AppModuleBasic) (*Client, error)
func (*Client) CreateWallet ¶
func (*Client) GetChainDenom ¶
func (*Client) GetChainID ¶
func (*Client) GetIBCChannel ¶
func (c *Client) GetIBCChannel(chain2 string) (*pb.ChannelData, error)
func (*Client) GetIBCInfo ¶
GetIBCInfo will fetch Fetch IBC info from chain registry
func (*Client) Initialize ¶
func (*Client) StakeTokens ¶
StakeTokens self stakes tokens from the client address
func (*Client) WaitForHeight ¶
WaitForHeight will wait till the Chain reaches the block height
type CmdRunner ¶
type CmdRunner struct {
// contains filtered or unexported fields
}
CmdRunner will help you to run admin commands on
func (*CmdRunner) GetPodFromName ¶
GetPodFromName will return the full pod name from a given name by querying the kubernetes cluster for the given name
type Config ¶
type Config struct { Chains []*Chain `name:"chains" json:"chains" yaml:"chains"` Relayers []*Relayer `name:"relayers" json:"relayers" yaml:"relayers"` Explorer *Feature `name:"explorer" json:"explorer" yaml:"explorer"` Registry *Feature `name:"registry" json:"registry" yaml:"registry"` }
Config is the struct for the config.yaml setup file todo: move this to a more common place, outside just tests todo: can be moved to proto defination
func (*Config) HasChainId ¶
HasChainId returns true if chain id found in list of chains
type ConsumerClient ¶
type ConsumerClient struct { Chain *Client Contracts *ConsumerContract // contains filtered or unexported fields }
func NewConsumerClient ¶
func NewConsumerClient(chain *Client, wasmContractPath string, wasmContractGZipped bool) *ConsumerClient
func (*ConsumerClient) BootstrapContracts ¶
func (p *ConsumerClient) BootstrapContracts(remoteDenom string) (*ConsumerContract, error)
func (*ConsumerClient) ExecNewEpoch ¶
func (p *ConsumerClient) ExecNewEpoch()
func (*ConsumerClient) MustExecGovProposal ¶
func (p *ConsumerClient) MustExecGovProposal(msg *types.MsgSetVirtualStakingMaxCap)
MustExecGovProposal submit and vote yes on proposal
func (*ConsumerClient) QueryMaxCap ¶
func (p *ConsumerClient) QueryMaxCap() types.QueryVirtualStakingMaxCapLimitResponse
func (*ConsumerClient) StoreContracts ¶
func (p *ConsumerClient) StoreContracts() ([]uint64, error)
type ConsumerContract ¶
type Feature ¶
type Feature struct { Enabled bool `name:"enabled" json:"enabled" yaml:"enabled"` Image string `name:"image" json:"image" yaml:"image"` Ports Port `name:"ports" json:"ports" yaml:"ports"` }
func (*Feature) GetRESTAddr ¶
func (*Feature) GetRPCAddr ¶
type HighLowType ¶
type HighLowType struct {
High, Low int
}
func ParseHighLow ¶
func ParseHighLow(a any) HighLowType
type ProviderClient ¶
type ProviderClient struct { Chain *Client Contracts *ProviderContracts // contains filtered or unexported fields }
func NewProviderClient ¶
func NewProviderClient(chain *Client, wasmContractPath string, wasmContractGZipped bool) *ProviderClient
func (*ProviderClient) BootstrapContracts ¶
func (p *ProviderClient) BootstrapContracts(connId, portID, rewardDenom string) (*ProviderContracts, error)
func (ProviderClient) MustExecExtStaking ¶
func (p ProviderClient) MustExecExtStaking(payload string, funds ...sdk.Coin) (*sdk.TxResponse, error)
func (ProviderClient) MustExecVault ¶
func (p ProviderClient) MustExecVault(payload string, funds ...sdk.Coin) (*sdk.TxResponse, error)
func (ProviderClient) MustFailExecVault ¶
func (p ProviderClient) MustFailExecVault(payload string, funds ...sdk.Coin) error
func (ProviderClient) QueryExtStaking ¶
func (p ProviderClient) QueryExtStaking(q Query) map[string]any
func (ProviderClient) QueryVault ¶
func (p ProviderClient) QueryVault(q Query) map[string]any
func (ProviderClient) QueryVaultFreeBalance ¶
func (p ProviderClient) QueryVaultFreeBalance() int
func (*ProviderClient) StoreContracts ¶
func (p *ProviderClient) StoreContracts() ([]uint64, error)
type ProviderContracts ¶
type Upgrade ¶
type Upgrade struct { Enabled bool `name:"eanbled" json:"enabled" yaml:"enabled"` Type string `name:"type" json:"type" yaml:"type"` Genesis string `name:"genesis" json:"genesis" yaml:"genesis"` Upgrades []struct { Name string `name:"name" json:"name" yaml:"name"` Version string `name:"version" json:"version" yaml:"version"` } `name:"upgrades" json:"upgrades" yaml:"upgrades"` }