repostitory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

README

repo 层

Documentation

Index

Constants

View Source
const AckProof = "ack"
View Source
const CleanProof = "clean"
View Source
const CommitmentPoof = "commitment"
View Source
const EventTypeSendCleanPacket = "send_clean_packet"
View Source
const EventTypeSendPacket = "send_packet"
View Source
const EventTypeWriteAck = "write_acknowledgement"

Variables

This section is empty.

Functions

This section is empty.

Types

type AckPacket

type AckPacket struct {
	Packet          packet.Packet
	Acknowledgement []byte
}

type GetBlockHeaderReq

type GetBlockHeaderReq struct {
	LatestHeight  uint64
	TrustedHeight uint64
}

type IChain

type IChain interface {
	GetPackets(height uint64) (*Packets, error)
	GetProof(sourChainName, destChainName string, sequence uint64, height uint64, typ string) ([]byte, error)
	RecvPackets(msgs types.Msgs) (types.ResultTx, types.Error)
	GetCommitmentsPacket(sourChainName, destChainName string, sequence uint64) (*packet.QueryPacketCommitmentResponse, error)
	GetReceiptPacket(sourChainName, destChianName string, sequence uint64) (*packet.QueryPacketReceiptResponse, error)
	GetBlockHeader(*GetBlockHeaderReq) (tibctypes.Header, error)
	GetLightClientState(string) (tibctypes.ClientState, error)
	GetLightClientConsensusState(string, uint64) (tibctypes.ConsensusState, error)
	GetStatus() (interface{}, error)
	GetLatestHeight() (uint64, error)
	GetLightClientDelayHeight(string) (uint64, error)
	GetLightClientDelayTime(string) (uint64, error)
	UpdateClient(header tibctypes.Header, chainName string) (string, error)
	ChainName() string
	UpdateClientFrequency() uint64
	ChainType() string
}

type IPacketRepo

type IPacketRepo interface {
}

type Packets

type Packets struct {
	BizPackets   []packet.Packet
	AckPackets   []AckPacket
	CleanPackets []packet.CleanPacket
}

type Tendermint

type Tendermint struct {
	// contains filtered or unexported fields
}

func NewTendermintClient

func NewTendermintClient(chainType, chaiName string, updateClientFrequency uint64, config *TerndermintConfig) (*Tendermint, error)

func (*Tendermint) ChainName

func (c *Tendermint) ChainName() string

func (*Tendermint) ChainType

func (c *Tendermint) ChainType() string

func (*Tendermint) GetBlockHeader

func (c *Tendermint) GetBlockHeader(req *GetBlockHeaderReq) (tibctypes.Header, error)

func (*Tendermint) GetCommitmentsPacket

func (c *Tendermint) GetCommitmentsPacket(sourceChainName, destChainName string, sequence uint64) (*packet.QueryPacketCommitmentResponse, error)

func (*Tendermint) GetLatestHeight

func (c *Tendermint) GetLatestHeight() (uint64, error)

func (*Tendermint) GetLightClientConsensusState

func (c *Tendermint) GetLightClientConsensusState(chainName string, height uint64) (tibctypes.ConsensusState, error)

func (*Tendermint) GetLightClientDelayHeight

func (c *Tendermint) GetLightClientDelayHeight(chainName string) (uint64, error)

func (*Tendermint) GetLightClientDelayTime

func (c *Tendermint) GetLightClientDelayTime(chainName string) (uint64, error)

func (*Tendermint) GetLightClientState

func (c *Tendermint) GetLightClientState(chainName string) (tibctypes.ClientState, error)

func (*Tendermint) GetPackets

func (c *Tendermint) GetPackets(height uint64) (*Packets, error)

func (*Tendermint) GetProof

func (c *Tendermint) GetProof(sourChainName, destChainName string, sequence uint64, height uint64, typ string) ([]byte, error)

func (*Tendermint) GetReceiptPacket

func (c *Tendermint) GetReceiptPacket(sourChainName, destChianName string, sequence uint64) (*packet.QueryPacketReceiptResponse, error)

func (*Tendermint) GetStatus

func (c *Tendermint) GetStatus() (interface{}, error)

func (*Tendermint) RecvPackets

func (c *Tendermint) RecvPackets(msgs types.Msgs) (types.ResultTx, types.Error)

func (*Tendermint) UpdateClient

func (c *Tendermint) UpdateClient(header tibctypes.Header, chainName string) (string, error)

func (*Tendermint) UpdateClientFrequency

func (c *Tendermint) UpdateClientFrequency() uint64

type TerndermintConfig

type TerndermintConfig struct {
	Options      []coretypes.Option
	BaseTx       types.BaseTx
	PrivKeyArmor string
	Name         string
	Password     string

	RPCAddr  string
	GrpcAddr string
	ChainID  string
}

func NewTerndermintConfig

func NewTerndermintConfig() *TerndermintConfig

Jump to

Keyboard shortcuts

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