types

package
v0.0.0-...-5628e88 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default params constants used to create a TM client
	TrustingPeriod     time.Duration = time.Hour * 24 * 7 * 2
	UnbondingPeriod    time.Duration = time.Hour * 24 * 7 * 3
	MaxClockDrift      time.Duration = time.Second * 10
	DefaultDelayPeriod uint64        = 0

	DefaultChannelVersion = ibctransfertypes.Version
	DefaultPrefix         = "ibc"
	TransferPort          = ibctransfertypes.ModuleName

	RelayerKeyIndex uint32 = 0
)

Variables

View Source
var (
	DefaultOpenInitVersion *connectiontypes.Version

	// Default params variables used to create a TM client
	DefaultTrustLevel ibctmtypes.Fraction = ibctmtypes.DefaultTrustLevel
	TestCoin                              = sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))

	UpgradePath = []string{"upgrade", "upgradedIBCState"}

	ConnectionVersion = connectiontypes.ExportedVersionsToProto(connectiontypes.GetCompatibleVersions())[0]
)

Functions

This section is empty.

Types

type ChannelOrder

type ChannelOrder int32
const (
	NONE      ChannelOrder = 0
	UNORDERED ChannelOrder = 1
	ORDERED   ChannelOrder = 2
)

type ChannelState

type ChannelState int32
const (
	UNINITIALIZED ChannelState = 0
	INIT          ChannelState = 1
	TRYOPEN       ChannelState = 2
	OPEN          ChannelState = 3
	CLOSED        ChannelState = 4
)

type MockProver

type MockProver interface {
	MockConnectionProof(connectionID string, proof *Proof) (*Proof, error)
	MockChannelProof(portID string, channelID string, proof *Proof) (*Proof, error)
	MockPacketProof(packet exported.PacketI, proof *Proof) (*Proof, error)
	MockAcknowledgementProof(ack []byte, proof *Proof) (*Proof, error)
}

type MsgChannelOpenAck

type MsgChannelOpenAck struct {
	PortID                string
	ChannelID             string
	CounterpartyChannelID string
	CounterpartyVersion   string
	ProofTry              *Proof
	Signer                string
}

type MsgChannelOpenConfirm

type MsgChannelOpenConfirm struct {
	PortID    string
	ChannelID string
	ProofAck  *Proof
	Signer    string
}

type MsgChannelOpenInit

type MsgChannelOpenInit struct {
	PortID             string
	Order              ChannelOrder
	CounterpartyPortID string
	ConnectionHops     []string
	Version            string
	Signer             string
}

type MsgChannelOpenTry

type MsgChannelOpenTry struct {
	PortID                string
	PreviousChannelID     string
	Ordering              ChannelOrder
	CounterpartyChannelID string
	CounterpartyPortID    string
	ConnectionHops        []string
	Version               string
	CounterpartyVersion   string
	ProofInit             *Proof
	Signer                string
}

type MsgConnectionOpenAck

type MsgConnectionOpenAck struct {
	ConnectionID             string
	CounterpartyConnectionID string
	Version                  exported.Version
	ClientStateBytes         []byte
	ProofTry                 *Proof
	ProofClient              *Proof
	ProofConsensus           *Proof
	ConsensusHeight          exported.Height
	Signer                   string
}

type MsgConnectionOpenConfirm

type MsgConnectionOpenConfirm struct {
	ConnectionID string
	ProofAck     *Proof
	Signer       string
}

type MsgConnectionOpenInit

type MsgConnectionOpenInit struct {
	ClientID              string
	CounterpartyClientID  string
	CounterpartyKeyPrefix []byte
	DelayPeriod           uint64
	Version               exported.Version
	Signer                string
}

type MsgConnectionOpenTry

type MsgConnectionOpenTry struct {
	ClientID                 string
	PreviousConnectionID     string
	ClientStateBytes         []byte
	CounterpartyClientID     string
	CounterpartyConnectionID string
	CounterpartyKeyPrefix    []byte
	DelayPeriod              uint64
	Versions                 []exported.Version
	ProofInit                *Proof
	ProofClient              *Proof
	ProofConsensus           *Proof
	ConsensusHeight          exported.Height
	Signer                   string
}

type MsgCreateClient

type MsgCreateClient struct {
	ClientType          string
	Height              exported.Height
	ClientStateBytes    []byte
	ConsensusStateBytes []byte
}

type MsgUpdateClient

type MsgUpdateClient struct {
	ClientID string
	Header   []byte
}

type Proof

type Proof struct {
	Height exported.Height
	Data   []byte
}

type TestChainI

type TestChainI interface {
	T() *testing.T

	Init(chainID string) error

	ChainID() string
	GetCommitmentPrefix() []byte
	GetSenderAddress() string

	NextBlock()

	GetClientStateBytes(counterpartyClientID string) []byte
	GetLatestHeight(counterpartyClientID string, clientType string) exported.Height

	ConstructTendermintMsgCreateClient(
		trustLevel ibctmtypes.Fraction,
		trustingPeriod, unbondingPeriod, maxClockDrift time.Duration,
		upgradePath []string, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool) MsgCreateClient
	ConstructMockMsgCreateClient() MsgCreateClient
	ConstructTrustedEthereumMsgCreateClient(publicKey cryptotypes.PubKey, diversifier string) MsgCreateClient

	CreateClient(ctx context.Context, msg MsgCreateClient) (string, error)

	ConstructTendermintUpdateTMClientHeader(counterparty TestChainI, clientID string) MsgUpdateClient
	ConstructMockMsgUpdateClient(clientID string) MsgUpdateClient
	ConstructTrustedEthereumMsgUpdateClient(clientID string, privateKey cryptotypes.PrivKey, divisifier string) MsgUpdateClient

	UpdateClient(ctx context.Context, msg MsgUpdateClient) error

	ConnectionOpenInit(ctx context.Context, msg MsgConnectionOpenInit) (string, error)
	ConnectionOpenTry(ctx context.Context, msg MsgConnectionOpenTry) (string, error)
	ConnectionOpenAck(ctx context.Context, msg MsgConnectionOpenAck) error
	ConnectionOpenConfirm(ctx context.Context, msg MsgConnectionOpenConfirm) error

	ChannelOpenInit(ctx context.Context, msg MsgChannelOpenInit) (string, error)
	ChannelOpenTry(ctx context.Context, msg MsgChannelOpenTry) (string, error)
	ChannelOpenAck(ctx context.Context, msg MsgChannelOpenAck) error
	ChannelOpenConfirm(ctx context.Context, msg MsgChannelOpenConfirm) error

	HandlePacketRecv(ctx context.Context, packet exported.PacketI, proof *Proof) error
	HandlePacketAcknowledgement(
		ctx context.Context,
		packet exported.PacketI,
		acknowledgement []byte,
		proof *Proof,
	) error

	ClientStateCommitmentKey(clientID string) []byte
	ConsensusStateCommitmentKey(clientID string, height exported.Height) []byte
	ConnectionStateCommitmentKey(connectionID string) []byte
	ChannelStateCommitmentKey(portID, channelID string) []byte
	PacketCommitmentKey(portID, channelID string, sequence uint64) []byte
	PacketAcknowledgementCommitmentKey(portID, channelID string, sequence uint64) []byte

	QueryProofAtHeight(key []byte, height exported.Height, clientType string) (*Proof, error)
}

Jump to

Keyboard shortcuts

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