Documentation
¶
Index ¶
- func NewCosmosRemotenet(testName string, log *zap.Logger, chainConfig chains.ChainConfig, ...) (chains.Chain, error)
- func RlpEncodeRequest(request CallServiceMessageRequest, callType CallServiceMessageType) ([]byte, error)
- type CSMessageResponseType
- type CallServiceMessage
- type CallServiceMessageRequest
- type CallServiceMessageResponse
- type CallServiceMessageType
- type CodeInfo
- type CodeInfosResponse
- type CosmosRemotenet
- func (c *CosmosRemotenet) BinCommand(command ...string) []string
- func (c *CosmosRemotenet) Config() chains.ChainConfig
- func (c *CosmosRemotenet) DeployXCallMockApp(ctx context.Context, keyname string, connections []chains.XCallConnection) error
- func (an *CosmosRemotenet) Exec(ctx context.Context, cmd []string, env []string) (stdout []byte, stderr []byte, err error)
- func (c *CosmosRemotenet) ExecBin(ctx context.Context, command ...string) ([]byte, []byte, error)
- func (c *CosmosRemotenet) ExecQuery(ctx context.Context, command ...string) ([]byte, []byte, error)
- func (c *CosmosRemotenet) ExecTx(ctx context.Context, command ...string) (string, error)
- func (c *CosmosRemotenet) ExecuteContractRemote(ctx context.Context, contractAddress string, methodName, message string, ...) (res *TxResul, err error)
- func (c *CosmosRemotenet) FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error)
- func (c *CosmosRemotenet) FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error)
- func (c *CosmosRemotenet) FindEvent(ctx context.Context, startHeight uint64, contract, index string) (*ctypes.ResultEvent, error)
- func (c *CosmosRemotenet) FindRollbackExecutedMessage(ctx context.Context, startHeight uint64, sn string) (string, error)
- func (c *CosmosRemotenet) FindTargetXCallMessage(ctx context.Context, target chains.Chain, height uint64, to string) (*chains.XCallResponse, error)
- func (c *CosmosRemotenet) GetAPIAddress() string
- func (c *CosmosRemotenet) GetCommonArgs() []string
- func (c *CosmosRemotenet) GetContractAddress(key string) string
- func (c *CosmosRemotenet) GetGRPCAddress() string
- func (c *CosmosRemotenet) GetHostRPCAddress() string
- func (c *CosmosRemotenet) GetIBCAddress(key string) string
- func (c *CosmosRemotenet) GetRPCAddress() string
- func (c *CosmosRemotenet) GetRelayConfig(ctx context.Context, rlyHome string, keyName string) ([]byte, error)
- func (c *CosmosRemotenet) Height(ctx context.Context) (uint64, error)
- func (c *CosmosRemotenet) InstantiateContractRemote(ctx context.Context, codeID string, initMessage string, needsNoAdminFlag bool, ...) (string, error)
- func (c *CosmosRemotenet) NodeCommand(command ...string) []string
- func (c *CosmosRemotenet) QueryCommand(command ...string) []string
- func (c *CosmosRemotenet) QueryContractRemote(ctx context.Context, contractAddress string, queryMsg any, response any) error
- func (c *CosmosRemotenet) SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error)
- func (c *CosmosRemotenet) SetupConnection(ctx context.Context, target chains.Chain) error
- func (c *CosmosRemotenet) SetupXCall(ctx context.Context) error
- func (c *CosmosRemotenet) StoreContractRemote(ctx context.Context, fileName string, extraExecTxArgs ...string) (string, error)
- func (c *CosmosRemotenet) TxCommand(command ...string) []string
- func (c *CosmosRemotenet) TxHashToResponse(ctx context.Context, txHash string) (*sdk.TxResponse, error)
- func (c *CosmosRemotenet) XCall(ctx context.Context, targetChain chains.Chain, keyName, to string, ...) (*chains.XCallResponse, error)
- type CosmosTx
- type DappInit
- type GetAdmin
- type GetProtocolFee
- type LogEvent
- type MinimumGasPriceEntity
- type MockAppInit
- type Query
- type QueryContractResponse
- type Result
- type SetAdmin
- type TxResul
- type UpdateAdmin
- type XcallInit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCosmosRemotenet ¶
func NewCosmosRemotenet(testName string, log *zap.Logger, chainConfig chains.ChainConfig, client *dockerClient.Client, network string, testconfig *testconfig.Chain) (chains.Chain, error)
func RlpEncodeRequest ¶
func RlpEncodeRequest(request CallServiceMessageRequest, callType CallServiceMessageType) ([]byte, error)
Types ¶
type CSMessageResponseType ¶
type CSMessageResponseType int64
const ( SUCCESS CSMessageResponseType = 0 FAILURE CSMessageResponseType = -1 IBC_ERROR CSMessageResponseType = -2 )
type CallServiceMessage ¶
type CallServiceMessage struct { MessageType CallServiceMessageType Payload []byte }
func RlpDecode ¶
func RlpDecode(raw_data []byte) (CallServiceMessage, error)
type CallServiceMessageRequest ¶
type CallServiceMessageRequest struct { From string `json:"from"` To string `json:"to"` SequenceNo uint64 `json:"sequence_no"` Rollback bool `json:"rollback"` Data []byte `json:"data"` }
func (*CallServiceMessageRequest) RlpEncode ¶
func (cr *CallServiceMessageRequest) RlpEncode() ([]byte, error)
type CallServiceMessageResponse ¶
type CallServiceMessageResponse struct { SequenceNo uint64 Code CSMessageResponseType Msg string }
func (*CallServiceMessageResponse) RlpEncode ¶
func (csr *CallServiceMessageResponse) RlpEncode() ([]byte, error)
type CallServiceMessageType ¶
type CallServiceMessageType int64
const ( CallServiceRequest CallServiceMessageType = 0 CallServiceResponse CallServiceMessageType = 1 )
type CodeInfosResponse ¶
type CodeInfosResponse struct {
CodeInfos []CodeInfo `json:"code_infos"`
}
type CosmosRemotenet ¶
type CosmosRemotenet struct { IBCAddresses map[string]string `json:"addresses"` Wallets map[string]ibc.Wallet `json:"wallets"` DockerClient *client.Client Network string GrpcConn *grpc.ClientConn Rpcclient *rpchttp.HTTP // contains filtered or unexported fields }
func (*CosmosRemotenet) BinCommand ¶
func (c *CosmosRemotenet) BinCommand(command ...string) []string
func (*CosmosRemotenet) Config ¶
func (c *CosmosRemotenet) Config() chains.ChainConfig
func (*CosmosRemotenet) DeployXCallMockApp ¶
func (c *CosmosRemotenet) DeployXCallMockApp(ctx context.Context, keyname string, connections []chains.XCallConnection) error
func (*CosmosRemotenet) ExecBin ¶
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 (*CosmosRemotenet) ExecQuery ¶
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 (*CosmosRemotenet) ExecuteContractRemote ¶
func (c *CosmosRemotenet) ExecuteContractRemote(ctx context.Context, contractAddress string, methodName, message string, extraExecTxArgs ...string) (res *TxResul, err error)
ExecuteContract executes a contract transaction with a message using it's address.
func (*CosmosRemotenet) FindCallMessage ¶
func (*CosmosRemotenet) FindCallResponse ¶
func (*CosmosRemotenet) FindEvent ¶
func (c *CosmosRemotenet) FindEvent(ctx context.Context, startHeight uint64, contract, index string) (*ctypes.ResultEvent, error)
func (*CosmosRemotenet) FindRollbackExecutedMessage ¶
func (*CosmosRemotenet) FindTargetXCallMessage ¶
func (c *CosmosRemotenet) FindTargetXCallMessage(ctx context.Context, target chains.Chain, height uint64, to string) (*chains.XCallResponse, error)
FindTargetXCallMessage returns the request id and the data of the message sent to the target chain
func (*CosmosRemotenet) GetAPIAddress ¶
func (c *CosmosRemotenet) GetAPIAddress() string
Implements Chain interface
func (*CosmosRemotenet) GetCommonArgs ¶
func (c *CosmosRemotenet) GetCommonArgs() []string
func (*CosmosRemotenet) GetContractAddress ¶
func (c *CosmosRemotenet) GetContractAddress(key string) string
func (*CosmosRemotenet) GetGRPCAddress ¶
func (c *CosmosRemotenet) GetGRPCAddress() string
Implements Chain interface
func (*CosmosRemotenet) GetHostRPCAddress ¶
func (c *CosmosRemotenet) 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 (*CosmosRemotenet) GetIBCAddress ¶
func (c *CosmosRemotenet) GetIBCAddress(key string) string
func (*CosmosRemotenet) GetRPCAddress ¶
func (c *CosmosRemotenet) GetRPCAddress() string
func (*CosmosRemotenet) GetRelayConfig ¶
func (*CosmosRemotenet) Height ¶
func (c *CosmosRemotenet) Height(ctx context.Context) (uint64, error)
func (*CosmosRemotenet) InstantiateContractRemote ¶
func (c *CosmosRemotenet) InstantiateContractRemote(ctx context.Context, 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 (*CosmosRemotenet) NodeCommand ¶
func (c *CosmosRemotenet) NodeCommand(command ...string) []string
func (*CosmosRemotenet) QueryCommand ¶
func (c *CosmosRemotenet) 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 (*CosmosRemotenet) QueryContractRemote ¶
func (c *CosmosRemotenet) QueryContractRemote(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 (*CosmosRemotenet) SendPacketXCall ¶
func (*CosmosRemotenet) SetupConnection ¶
func (*CosmosRemotenet) SetupXCall ¶
func (c *CosmosRemotenet) SetupXCall(ctx context.Context) error
func (*CosmosRemotenet) StoreContractRemote ¶
func (*CosmosRemotenet) TxCommand ¶
func (c *CosmosRemotenet) TxCommand(command ...string) []string
func (*CosmosRemotenet) TxHashToResponse ¶
func (c *CosmosRemotenet) TxHashToResponse(ctx context.Context, txHash string) (*sdk.TxResponse, error)
TxHashToResponse returns the sdk transaction response struct for a given transaction hash.
type GetProtocolFee ¶
type GetProtocolFee struct{}
type MinimumGasPriceEntity ¶
type MockAppInit ¶
type Query ¶
type Query struct { GetClientState *map[string]interface{} `json:"get_client_state,omitempty"` GetAdmin *GetAdmin `json:"get_admin,omitempty"` GetProtocolFee *GetProtocolFee `json:"get_protocol_fee,omitempty"` GetNextClientSequence *map[string]interface{} `json:"get_next_client_sequence,omitempty"` HasPacketReceipt *map[string]interface{} `json:"has_packet_receipt,omitempty"` GetNextSequenceReceive *map[string]interface{} `json:"get_next_sequence_receive,omitempty"` GetConnection *map[string]interface{} `json:"get_connection,omitempty"` GetChannel *map[string]interface{} `json:"get_channel,omitempty"` GetNextConnectionSequence *map[string]interface{} `json:"get_next_connection_sequence,omitempty"` GetNextChannelSequence *map[string]interface{} `json:"get_next_channel_sequence,omitempty"` }
type QueryContractResponse ¶
type QueryContractResponse struct {
Contracts []string `json:"contracts"`
}
type Result ¶
type Result struct { NodeInfo struct { ProtocolVersion struct { P2P string `json:"p2p"` Block string `json:"block"` App string `json:"app"` } `json:"protocol_version"` ID string `json:"id"` ListenAddr string `json:"listen_addr"` Network string `json:"network"` Version string `json:"version"` Channels string `json:"channels"` Moniker string `json:"moniker"` Other struct { TxIndex string `json:"tx_index"` RPCAddress string `json:"rpc_address"` } `json:"other"` } `json:"NodeInfo"` SyncInfo struct { LatestBlockHash string `json:"latest_block_hash"` LatestAppHash string `json:"latest_app_hash"` LatestBlockHeight string `json:"latest_block_height"` LatestBlockTime time.Time `json:"latest_block_time"` EarliestBlockHash string `json:"earliest_block_hash"` EarliestAppHash string `json:"earliest_app_hash"` EarliestBlockHeight string `json:"earliest_block_height"` EarliestBlockTime time.Time `json:"earliest_block_time"` CatchingUp bool `json:"catching_up"` } `json:"SyncInfo"` ValidatorInfo struct { Address string `json:"Address"` PubKey struct { Type string `json:"type"` Value string `json:"value"` } `json:"PubKey"` VotingPower string `json:"VotingPower"` } `json:"ValidatorInfo"` }
type SetAdmin ¶
type SetAdmin struct { SetAdmin struct { Address string `json:"address"` } `json:"set_admin"` }
type TxResul ¶
type TxResul struct { Height string `json:"height"` Txhash string `json:"txhash"` Codespace string `json:"codespace"` Code int `json:"code"` Data string `json:"data"` RawLog string `json:"raw_log"` Logs []interface{} `json:"logs"` Info string `json:"info"` GasWanted string `json:"gas_wanted"` GasUsed string `json:"gas_used"` Tx interface{} `json:"tx"` Timestamp string `json:"timestamp"` Events []struct { Type string `json:"type"` Attributes []struct { Key string `json:"key"` Value string `json:"value"` Index bool `json:"index"` } `json:"attributes"` } `json:"events"` }
type UpdateAdmin ¶
type UpdateAdmin struct { UpdateAdmin struct { Address string `json:"address"` } `json:"update_admin"` }