chains

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 6 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

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 {
	ibc.Chain
	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)
	GetRelayConfig(ctx context.Context, rlyHome string, keyName string) ([]byte, error)
	SetupXCall(ctx context.Context, keyName string) error
	SetupConnection(ctx context.Context, keyName string, target Chain) error
	FindTargetXCallMessage(ctx context.Context, target Chain, height uint64, to string) (*XCallResponse, error)
	SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error)
	XCall(ctx context.Context, targetChain Chain, keyName, _to string, data, rollback []byte) (*XCallResponse, 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)
	GetContractAddress(key string) string
	DeployXCallMockApp(ctx context.Context, keyName string, connections []XCallConnection) error
	PauseNode(context.Context) error
	UnpauseNode(context.Context) error
	InitEventListener(ctx context.Context, contract string) EventListener

	BackupConfig() ([]byte, error)
	RestoreConfig([]byte) 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
}

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 {
	Connection    string
	Nid           string
	Destination   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