eth

package
v0.2.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CtxTimeout = 10 * time.Second
View Source
const TryGetGasPriceTimeInterval = 10 * time.Second

Variables

View Source
var (
	Uint64, _  = abi.NewType("uint64", "", nil)
	Bytes32, _ = abi.NewType("bytes32", "", nil)
	Bytes, _   = abi.NewType("bytes", "", nil)
	String, _  = abi.NewType("string", "", nil)
)

Functions

func NewEth

func NewEth(config *ChainConfig) (repostitory.IChain, error)

Types

type ChainConfig

type ChainConfig struct {
	ChainType             string
	ChainName             string
	UpdateClientFrequency uint64
	ChainURI              string
	ChainID               uint64

	Slot           int64
	TipCoefficient float64

	ContractCfgGroup    *ContractCfgGroup
	ContractBindOptsCfg *ContractBindOptsCfg
}

func NewChainConfig

func NewChainConfig() *ChainConfig

type ContractBindOptsCfg

type ContractBindOptsCfg struct {
	ClientPrivKey string
	PacketPrivKey string
	GasLimit      uint64
	MaxGasPrice   uint64
	ChainID       uint64
}

func NewContractBindOptsCfg

func NewContractBindOptsCfg() *ContractBindOptsCfg

type ContractCfg

type ContractCfg struct {
	Addr       string
	Topic      string
	OptPrivKey string
}

type ContractCfgGroup

type ContractCfgGroup struct {
	Client      ContractCfg
	Packet      ContractCfg
	AckPacket   ContractCfg
	CleanPacket ContractCfg
}

func NewContractCfgGroup

func NewContractCfgGroup() *ContractCfgGroup

type Eth

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

func (*Eth) ChainName

func (eth *Eth) ChainName() string

func (*Eth) ChainType

func (eth *Eth) ChainType() string

func (*Eth) GetBlockHeader

func (eth *Eth) GetBlockHeader(req *repotypes.GetBlockHeaderReq) (tibctypes.Header, error)

func (*Eth) GetBlockTimestamp

func (eth *Eth) GetBlockTimestamp(height uint64) (uint64, error)

func (*Eth) GetCommitmentsPacket

func (eth *Eth) GetCommitmentsPacket(sourChainName, destChainName string, sequence uint64) error

func (*Eth) GetLatestHeight

func (eth *Eth) GetLatestHeight() (uint64, error)

func (*Eth) GetLightClientConsensusState

func (eth *Eth) GetLightClientConsensusState(string, uint64) (tibctypes.ConsensusState, error)

func (*Eth) GetLightClientDelayHeight

func (eth *Eth) GetLightClientDelayHeight(chainName string) (uint64, error)

func (*Eth) GetLightClientDelayTime

func (eth *Eth) GetLightClientDelayTime(chainName string) (uint64, error)

func (*Eth) GetLightClientState

func (eth *Eth) GetLightClientState(chainName string) (tibctypes.ClientState, error)

func (*Eth) GetPackets

func (eth *Eth) GetPackets(height uint64, destChainType string) (*repotypes.Packets, error)

func (*Eth) GetProof

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

func (*Eth) GetReceiptPacket

func (eth *Eth) GetReceiptPacket(sourChainName, destChainName string, sequence uint64) (bool, error)

func (*Eth) GetResult

func (eth *Eth) GetResult(hash string) (uint64, error)

func (*Eth) RecvPackets

func (eth *Eth) RecvPackets(msgs types.Msgs) (*repotypes.ResultTx, types.Error)

func (*Eth) UpdateClient

func (eth *Eth) UpdateClient(header tibctypes.Header, chainName string) (string, error)

func (*Eth) UpdateClientFrequency

func (eth *Eth) UpdateClientFrequency() uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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