chains

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNumValidators = 1
	DefaultNumFullNodes  = 1
)
View Source
const (
	//read only method
	HasPacketReceipt          = "has-packet-receipt"
	GetNextSequenceReceive    = "get-next-sequence-receive"
	GetClientState            = "get-client-state"
	GetNextClientSequence     = "get-next-client-sequence"
	GetConnection             = "get-connection"
	GetNextConnectionSequence = "get-next-connection-sequence"
	GetChannel                = "get-channel"
	GetNextChannelSequence    = "get-next-channel-sequence"

	//execute methods
	BindPort = "bind_port"

	//mock dapp
	SendMessage = "send_message"
)
View Source
const (
	BASE_PATH = "BASE_PATH"
)

Variables

View Source
var Response interface{}

Functions

func GetEnvOrDefault

func GetEnvOrDefault(key, defaultValue string) string

func HexBytesToProtoUnmarshal

func HexBytesToProtoUnmarshal(encoded types.HexBytes, v proto.Message) error

func ProcessContractResponse

func ProcessContractResponse(p *wasmtypes.QuerySmartContractStateResponse) ([]byte, error)

func ProtoMarshalToHexBytes

func ProtoMarshalToHexBytes(v proto.Message) (string, error)

Types

type AdminKey

type AdminKey string

type Admins

type Admins struct {
	Admin map[string]string
}

type BufferArray

type BufferArray []byte

func (BufferArray) MarshalJSON

func (u BufferArray) MarshalJSON() ([]byte, error)

type Chain

type Chain interface {
	DeployContract(ctx context.Context, keyName string) (context.Context, error)
	QueryContract(ctx context.Context, contractAddress, methodName string, params map[string]interface{}) (context.Context, error)
	ExecuteContract(ctx context.Context, contractAddress, keyName, methodName string, param map[string]interface{}) (context.Context, error)
	GetLastBlock(ctx context.Context) (context.Context, error)
	GetBlockByHeight(ctx context.Context) (context.Context, error)
	FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx, error)
	BuildWallets(ctx context.Context, keyName string) (ibc.Wallet, error)
	SetupIBC(ctx context.Context, keyName string) (context.Context, error)
	SetupXCall(ctx context.Context, portId, keyName string) error
	FindTargetXCallMessage(ctx context.Context, target Chain, height uint64, to string) (*XCallResponse, error)
	ConfigureBaseConnection(ctx context.Context, connection XCallConnection) (context.Context, error)
	SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error)
	IsPacketReceived(ctx context.Context, params map[string]interface{}, order ibc.Order) bool
	XCall(ctx context.Context, targetChain Chain, keyName, _to string, data, rollback []byte) (*XCallResponse, error)
	CheckForTimeout(ctx context.Context, src Chain, params map[string]interface{}, listener EventListener) (context.Context, error)
	EOAXCall(ctx context.Context, targetChain Chain, keyName, _to string, data []byte, sources, destinations []string) (string, string, string, error)
	ExecuteCall(ctx context.Context, reqId, data string) (context.Context, error)
	ExecuteRollback(ctx context.Context, sn string) (context.Context, error)
	FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error)
	FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error)
	OverrideConfig(key string, value any)
	GetIBCAddress(key string) string
	DeployXCallMockApp(ctx context.Context, connection XCallConnection) error
	PreGenesis() error
	GetClientState(context.Context, int) (any, error)
	GetClientName(int) string
	GetClientsCount(context.Context) (int, error)
	GetConnectionState(context.Context, int) (*conntypes.ConnectionEnd, error)
	GetNextConnectionSequence(context.Context) (int, error)
	GetChannel(context.Context, int, string) (*chantypes.Channel, error)
	GetNextChannelSequence(context.Context) (int, error)
	PauseNode(context.Context) error
	UnpauseNode(context.Context) error
	InitEventListener(ctx context.Context, contract string) EventListener

	BackupConfig() ([]byte, error)
	RestoreConfig([]byte) error
	//integration test specific
	SendPacketMockDApp(ctx context.Context, targetChain Chain, keyName string, params map[string]interface{}) (PacketTransferResponse, error)
}

type ChainConfig

type ChainConfig struct {
	Type           string      `mapstructure:"type"`
	Name           string      `mapstructure:"name"`
	ChainID        string      `mapstructure:"chain_id"`
	Images         DockerImage `mapstructure:"image"`
	Bin            string      `mapstructure:"bin"`
	Bech32Prefix   string      `mapstructure:"bech32_prefix"`
	Denom          string      `mapstructure:"denom"`
	SkipGenTx      bool        `mapstructure:"skip_gen_tx"`
	CoinType       string      `mapstructure:"coin_type"`
	GasPrices      string      `mapstructure:"gas_prices"`
	GasAdjustment  float64     `mapstructure:"gas_adjustment"`
	TrustingPeriod string      `mapstructure:"trusting_period"`
	NoHostMount    bool        `mapstructure:"no_host_mount"`
	BlockInterval  int         `mapstructure:"block_interval"`
}

func (*ChainConfig) GetIBCChainConfig

func (c *ChainConfig) GetIBCChainConfig(chain *Chain) ibc.ChainConfig

type ContractKey

type ContractKey struct {
	ContractAddress map[string]string
	ContractOwner   map[string]string
}

type ContractName

type ContractName struct {
	ContractName string
}

type DockerImage

type DockerImage struct {
	Repository string `mapstructure:"repository"`
	Version    string `mapstructure:"version"`
	UidGid     string `mapstructure:"uid_gid"`
}

type Event

type Event map[string][]string

type EventListener

type EventListener interface {
	Start()
	Stop()
	FindEvent(filters Filter) (Event, error)
}

type Filter

type Filter map[string]interface{}

type InitMessage

type InitMessage struct {
	Message map[string]interface{}
}

type InitMessageKey

type InitMessageKey string

type LastBlock

type LastBlock struct{}

type MinimumGasPriceEntity

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

type Mykey

type Mykey string

type PacketTransferResponse

type PacketTransferResponse struct {
	IsPacketSent              bool
	IsPacketReceiptEventFound bool
	Packet                    chantypes.Packet
}

type Param

type Param struct {
	Data string
}

type Query

type Query struct {
	Method string
	Param  string
}

type TimeoutResponse

type TimeoutResponse struct {
	HasTimeout        bool
	IsPacketFound     bool
	HasRollbackCalled bool
}

type XCallConnection

type XCallConnection struct {
	KeyName                string
	ConnectionId           string
	ClientId               string
	CounterpartyNid        string
	PortId                 string
	CounterPartyPortId     string
	CounterPartyConnection string
	TimeoutHeight          int `default:"100"`
}

type XCallResponse

type XCallResponse struct {
	SerialNo  string
	RequestID string
	Data      string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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