types

package
v0.0.0-...-1237470 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeValueCategory = ModuleName

	EventTypeCreateDenom         = "create_denom"
	AttributeKeySourceAssetDenom = "source_asset_denom"
	AttributeKeyFromAssetHash    = "from_asset_hash"
	AttributeKeyRedeemScript     = "redeem_script"

	EventTypeBindAsset      = "bind_asset_hash"
	AttributeKeyCreator     = "creator"
	AttributeKeyToChainId   = "to_chain_id"
	AttributeKeyToAssetHash = "to_asset_hash"

	EventTypeLock           = "lock"
	AttributeKeyFromAddress = "from_address"
	AttributeKeyToAddress   = "to_address"
	AttributeKeyAmount      = "amount"

	EventTypeUnlock = "unlock"
)

Btcx module event types

View Source
const (
	// module name
	ModuleName = "btcx"

	// default paramspace for params keeper
	DefaultParamspace = ModuleName

	// StoreKey is the default store key for mint
	StoreKey = ModuleName

	// QuerierRoute is the querier route for the minting store.
	QuerierRoute = StoreKey

	// RouterKey is the message route for gov
	RouterKey = ModuleName

	// Query endpoints supported by the minting querier
	QueryParameters = "parameters"
)

nolint

View Source
const (
	TypeMsgBindAssetHash = "bind_asset_hash"
	TypeMsgLock          = "lock"
	TypeMsgCreateDenom   = "create_coin"
)

Governance message types and routes

View Source
const (
	QueryDenomInfo           = "denom_info"
	QueryDenomCrossChainInfo = "denom_cc_info"
)
View Source
const (
	BtcChainId = uint64(1)
)

Variables

View Source
var (
	ErrInvalidChainIdType      = sdkerrors.Register(ModuleName, 1, "ErrInvalidChainIdType")
	ErrInvalidRedeemScriptType = sdkerrors.Register(ModuleName, 2, "ErrInvalidRedeemScriptType")
	ErrEmptyToAssetHashType    = sdkerrors.Register(ModuleName, 3, "ErrEmptyToAssetHashType")
	ErrCreateDenomType         = sdkerrors.Register(ModuleName, 4, "ErrCreateDenomType")
	ErrBindAssetHashType       = sdkerrors.Register(ModuleName, 5, "ErrBindAssetHashType")
	ErrLockType                = sdkerrors.Register(ModuleName, 6, "ErrLockType")
	ErrUnLockType              = sdkerrors.Register(ModuleName, 7, "ErrUnLockType")
	ErrBurnCoinsType           = sdkerrors.Register(ModuleName, 8, "ErrBurnCoinsType")
	ErrMintCoinsType           = sdkerrors.Register(ModuleName, 9, "ErrMintCoinsType")
)
View Source
var ModuleCdc *codec.Codec

generic sealed codec to be used throughout this module

Functions

func ErrBindAssetHash

func ErrBindAssetHash(reason string) error

func ErrBurnCoins

func ErrBurnCoins(reason string) error

func ErrCreateDenom

func ErrCreateDenom(reason string) error

func ErrEmptyToAssetHash

func ErrEmptyToAssetHash(toHashStr string) error

func ErrInvalidChainId

func ErrInvalidChainId(chainId uint64) error

func ErrInvalidRedeemScript

func ErrInvalidRedeemScript(reason string) error

func ErrLock

func ErrLock(reason string) error

func ErrMintCoins

func ErrMintCoins(reason string) error

func ErrUnLock

func ErrUnLock(reason string) error

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authexported.Account

	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
	GetAllAccounts(ctx sdk.Context) []authexported.Account
	SetAccount(ctx sdk.Context, acc authexported.Account)

	IterateAccounts(ctx sdk.Context, process func(authexported.Account) bool)
}

type BTCArgs

type BTCArgs struct {
	ToBtcAddress []byte
	Amount       uint64
}

func (*BTCArgs) Deserialization

func (this *BTCArgs) Deserialization(source *polycommon.ZeroCopySource) error

func (*BTCArgs) Serialization

func (this *BTCArgs) Serialization(sink *polycommon.ZeroCopySink) error

type BankKeeper

type BankKeeper interface {
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
	DelegateCoins(ctx sdk.Context, fromAdd, toAddr sdk.AccAddress, amt sdk.Coins) error
	UndelegateCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error

	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error)
	AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error)
}

type CCMKeeper

type CCMKeeper interface {
	CreateCrossChainTx(ctx sdk.Context, fromAddr sdk.AccAddress, toChainId uint64, fromContractHash, toContractHash []byte, method string, args []byte) error
	SetDenomCreator(ctx sdk.Context, denom string, creator sdk.AccAddress)
	GetDenomCreator(ctx sdk.Context, denom string) sdk.AccAddress
	ExistDenom(ctx sdk.Context, denom string) (string, bool)
}

type DenomCrossChainInfo

type DenomCrossChainInfo struct {
	DenomInfo
	ToChainId   uint64
	ToAssetHash string
}

func (DenomCrossChainInfo) String

func (msg DenomCrossChainInfo) String() string

type DenomInfo

type DenomInfo struct {
	Creator          string
	Denom            string
	AssetHash        string
	TotalSupply      sdk.Int
	RedeemScipt      string
	RedeemScriptHash string
}

func (DenomInfo) String

func (msg DenomInfo) String() string

type MsgBindAssetHash

type MsgBindAssetHash struct {
	Creator          sdk.AccAddress
	SourceAssetDenom string
	ToChainId        uint64
	ToAssetHash      []byte
}

func NewMsgBindAssetHash

func NewMsgBindAssetHash(creator sdk.AccAddress, sourceAssetDenom string, toChainId uint64, toAssetHash []byte) MsgBindAssetHash

func (MsgBindAssetHash) GetSignBytes

func (msg MsgBindAssetHash) GetSignBytes() []byte

Implements Msg.

func (MsgBindAssetHash) GetSigners

func (msg MsgBindAssetHash) GetSigners() []sdk.AccAddress

Implements Msg.

func (MsgBindAssetHash) Route

func (msg MsgBindAssetHash) Route() string

nolint

func (MsgBindAssetHash) String

func (msg MsgBindAssetHash) String() string

func (MsgBindAssetHash) Type

func (msg MsgBindAssetHash) Type() string

func (MsgBindAssetHash) ValidateBasic

func (msg MsgBindAssetHash) ValidateBasic() error

Implements Msg.

type MsgCreateDenom

type MsgCreateDenom struct {
	Creator      sdk.AccAddress
	Denom        string
	RedeemScript string
}

func NewMsgCreateDenom

func NewMsgCreateDenom(creator sdk.AccAddress, denom string, redeemScript string) MsgCreateDenom

func (MsgCreateDenom) GetSignBytes

func (msg MsgCreateDenom) GetSignBytes() []byte

Implements Msg.

func (MsgCreateDenom) GetSigners

func (msg MsgCreateDenom) GetSigners() []sdk.AccAddress

Implements Msg.

func (MsgCreateDenom) Route

func (msg MsgCreateDenom) Route() string

nolint

func (MsgCreateDenom) String

func (msg MsgCreateDenom) String() string

func (MsgCreateDenom) Type

func (msg MsgCreateDenom) Type() string

func (MsgCreateDenom) ValidateBasic

func (msg MsgCreateDenom) ValidateBasic() error

Implements Msg.

type MsgLock

type MsgLock struct {
	FromAddress      sdk.AccAddress
	SourceAssetDenom string
	ToChainId        uint64
	ToAddressBs      []byte
	Value            sdk.Int
}

func NewMsgLock

func NewMsgLock(fromAddress sdk.AccAddress, sourceAssetDenom string, toChainId uint64, toAddress []byte, value sdk.Int) MsgLock

func (MsgLock) GetSignBytes

func (msg MsgLock) GetSignBytes() []byte

Implements Msg.

func (MsgLock) GetSigners

func (msg MsgLock) GetSigners() []sdk.AccAddress

Implements Msg.

func (MsgLock) Route

func (msg MsgLock) Route() string

nolint

func (MsgLock) String

func (msg MsgLock) String() string

func (MsgLock) Type

func (msg MsgLock) Type() string

func (MsgLock) ValidateBasic

func (msg MsgLock) ValidateBasic() error

Implements Msg.

type QueryDenomCrossChainInfoParam

type QueryDenomCrossChainInfoParam struct {
	Denom   string
	ChainId uint64
}

func NewQueryDenomCrossChainInfoParam

func NewQueryDenomCrossChainInfoParam(denom string, toChainId uint64) QueryDenomCrossChainInfoParam

NewQueryBalanceParams creates a new instance of QueryBalanceParams.

type QueryDenomInfoParam

type QueryDenomInfoParam struct {
	Denom string
}

QueryBalanceParams defines the params for querying an account balance.

func NewQueryDenomInfoParam

func NewQueryDenomInfoParam(denom string) QueryDenomInfoParam

NewQueryBalanceParams creates a new instance of QueryBalanceParams.

type SupplyKeeper

type SupplyKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI
	// TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862
	SetModuleAccount(sdk.Context, exported.ModuleAccountI)

	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	SetSupply(ctx sdk.Context, supply exported.SupplyI)
	GetSupply(ctx sdk.Context) (supply exported.SupplyI)
}

SupplyKeeper defines the expected supply keeper

type ToBTCArgs

type ToBTCArgs struct {
	ToBtcAddress []byte
	Amount       uint64
	RedeemScript []byte
}

func (*ToBTCArgs) Deserialization

func (this *ToBTCArgs) Deserialization(source *polycommon.ZeroCopySource) error

func (*ToBTCArgs) Serialization

func (this *ToBTCArgs) Serialization(sink *polycommon.ZeroCopySink) error

Jump to

Keyboard shortcuts

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