ibc

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = 3

	CodeDuplicatedSequence    sdk.CodeType = 101
	CodeFeeParamMismatch      sdk.CodeType = 102
	CodeInvalidChainId        sdk.CodeType = 103
	CodeWritePackageForbidden sdk.CodeType = 104
)

IBC errors reserve 200 ~ 299.

View Source
const (
	DefaultRelayerFeeParam int64 = 1e6 // decimal is 8
	// Default parameter namespace
	DefaultParamspace = "ibc"
)

Variables

View Source
var (
	PrefixForIbcPackageKey = []byte{0x00}
	PrefixForSequenceKey   = []byte{0x01}
)
View Source
var (
	ParamRelayerFee = []byte("relayerFee")
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, keeper Keeper)

func ErrDuplicatedSequence

func ErrDuplicatedSequence(codespace sdk.CodespaceType, msg string) sdk.Error

func ErrFeeParamMismatch

func ErrFeeParamMismatch(codespace sdk.CodespaceType, msg string) sdk.Error

func ErrInvalidChainId

func ErrInvalidChainId(codespace sdk.CodespaceType, msg string) sdk.Error

func ErrWritePackageForbidden

func ErrWritePackageForbidden(codespace sdk.CodespaceType, msg string) sdk.Error

func ParamTypeTable

func ParamTypeTable() param.TypeTable

func RegisterWire

func RegisterWire(cdc *codec.Codec)

Types

type Keeper

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

IBC Keeper

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, paramSpace param.Subspace, codespace sdk.CodespaceType, sideKeeper sidechain.Keeper) Keeper

func (*Keeper) CleanupIBCPackage

func (k *Keeper) CleanupIBCPackage(ctx sdk.Context, destChainName string, channelName string, confirmedSequence uint64)

func (*Keeper) CreateIBCSyncPackage

func (k *Keeper) CreateIBCSyncPackage(ctx sdk.Context, destChainName string, channelName string, packageLoad []byte) (uint64, sdk.Error)

func (*Keeper) CreateRawIBCPackage

func (k *Keeper) CreateRawIBCPackage(ctx sdk.Context, destChainName string, channelName string,
	packageType sdk.CrossChainPackageType, packageLoad []byte, relayerFee big.Int) (uint64, sdk.Error)

func (*Keeper) CreateRawIBCPackageById

func (k *Keeper) CreateRawIBCPackageById(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID,
	packageType sdk.CrossChainPackageType, packageLoad []byte) (uint64, sdk.Error)

func (*Keeper) CreateRawIBCPackageByIdWithFee

func (k *Keeper) CreateRawIBCPackageByIdWithFee(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID,
	packageType sdk.CrossChainPackageType, packageLoad []byte, relayerFee big.Int) (uint64, sdk.Error)

func (*Keeper) GetIBCPackage

func (k *Keeper) GetIBCPackage(ctx sdk.Context, destChainName string, channelName string, sequence uint64) ([]byte, error)

func (*Keeper) GetIBCPackageById

func (k *Keeper) GetIBCPackageById(ctx sdk.Context, destChainID sdk.ChainID, channelId sdk.ChannelID, sequence uint64) ([]byte, error)

func (Keeper) GetRelayerFeeParam

func (k Keeper) GetRelayerFeeParam(ctx sdk.Context, destChainName string) (relaterFee *big.Int, err error)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params Params)

func (*Keeper) SubscribeParamChange

func (k *Keeper) SubscribeParamChange(hub types.ParamChangePublisher)

type Params

type Params struct {
	RelayerFee int64 `json:"relayer_fee"`
}

func (*Params) GetParamAttribute

func (p *Params) GetParamAttribute() (string, bool)

func (*Params) KeyValuePairs

func (p *Params) KeyValuePairs() params.KeyValuePairs

func (*Params) UpdateCheck

func (p *Params) UpdateCheck() error

Jump to

Keyboard shortcuts

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