ibcasset

package
Version: v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName        = types.ModuleName
	StoreKey          = types.StoreKey
	FeeCollectorName  = types.FeeCollectorName
	QuerierRoute      = types.QuerierRoute
	DefaultParamspace = types.DefaultParamspace
)

Variables

View Source
var (

	// variable aliases
	ModuleCdc           = types.ModuleCdc
	ProtoBaseCUIBCAsset = types.ProtoBaseCUIBCAsset
	RegisterCodec       = types.RegisterCodec
)

Functions

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)

InitGenesis sets distribution information for genesis.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

creates a querier for auth REST endpoints

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis performs basic validation of bank genesis data returning an error for any failed validation criteria.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

___________________________ app module object

func NewAppModule

func NewAppModule(keeper Keeper, cuKeeper internal.CUKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

module begin-block

func (AppModule) EndBlock

module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

module export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

module init-genesis

func (AppModule) Name

func (AppModule) Name() string

module name

func (AppModule) NewHandler

func (AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RegisterInvariants

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

register invariants

func (AppModule) Route

func (AppModule) Route() string

module message route name

type AppModuleBasic

type AppModuleBasic struct{}

app module basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

module validate genesis

type GenesisState

type GenesisState struct {
}

GenesisState is the bank state that must be provided at genesis.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

func NewGenesisState

func NewGenesisState() GenesisState

NewGenesisState creates a new genesis state.

type IBCAssetKeeperI

type IBCAssetKeeperI interface {
	// CU functions
	NewCUIBCAssetWithAddress(ctx sdk.Context, cuType sdk.CUType, cuaddr sdk.CUAddress) exported.CUIBCAsset

	GetCUIBCAsset(context sdk.Context, addresses sdk.CUAddress) exported.CUIBCAsset

	GetOrNewCUIBCAsset(context sdk.Context, cuType sdk.CUType, addresses sdk.CUAddress) exported.CUIBCAsset

	SetCUIBCAsset(ctx sdk.Context, cu exported.CUIBCAsset)

	Logger(ctx sdk.Context) log.Logger

	GetDepositList(ctx sdk.Context, symbol string, address sdk.CUAddress) sdk.DepositList
	GetDepositListByHash(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string) sdk.DepositList
	SetDepositList(ctx sdk.Context, symbol string, address sdk.CUAddress, list sdk.DepositList)
	SaveDeposit(ctx sdk.Context, symbol string, address sdk.CUAddress, deposit sdk.DepositItem) error
	DelDeposit(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64)
	SetDepositStatus(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64, status sdk.DepositItemStatus) error
	GetDeposit(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64) sdk.DepositItem
	IsDepositExist(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64) bool
}

type Keeper

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

Keeper encodes/decodes CUs using the go-amino (binary) encoding/decoding library.

func NewKeeper

func NewKeeper(
	cdc *codec.Codec, key sdk.StoreKey, ck internal.CUKeeper, tk internal.TokenKeeper, proto func() exported.CUIBCAsset) Keeper

NewKeeper returns a new Keeper that uses go-amino to (binary) encode and decode concrete sdk.CustodianUnits. nolint

func (Keeper) DelDeposit

func (keeper Keeper) DelDeposit(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64)

DelDeposit delete deposit item from store

func (Keeper) GetCUIBCAsset

func (keeper Keeper) GetCUIBCAsset(context sdk.Context, addr sdk.CUAddress) exported.CUIBCAsset

func (Keeper) GetDeposit

func (keeper Keeper) GetDeposit(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64) sdk.DepositItem

GetDeposit get deposit item from store

func (Keeper) GetDepositList

func (keeper Keeper) GetDepositList(ctx sdk.Context, symbol string, address sdk.CUAddress) sdk.DepositList

---------------------------------------------------------------------- DepositList funcs

func (Keeper) GetDepositListByHash

func (keeper Keeper) GetDepositListByHash(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string) sdk.DepositList

func (Keeper) GetOpCUsAstInfo

func (keeper Keeper) GetOpCUsAstInfo(ctx sdk.Context, symbol string) []sdk.OpCUAstInfo

GetOpCUsAstInfo returns all operation custodian units and depositList of the symbol. if symbol empty ,return all operation custodian units and depositList.

func (Keeper) GetOrNewCUIBCAsset

func (keeper Keeper) GetOrNewCUIBCAsset(context sdk.Context, cuType sdk.CUType, addr sdk.CUAddress) exported.CUIBCAsset

func (Keeper) GetPendingDepositList

func (keeper Keeper) GetPendingDepositList(ctx sdk.Context, address sdk.CUAddress) map[string]sdk.DepositList

func (Keeper) Hooks

func (ck Keeper) Hooks() hooks

func (Keeper) IsDepositExist

func (keeper Keeper) IsDepositExist(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64) bool

func (Keeper) IterateCUAssets

func (keeper Keeper) IterateCUAssets(ctx sdk.Context, process func(asset exported.CUIBCAsset) (stop bool))

IterateCUs implements sdk.Keeper.

func (Keeper) Logger

func (keeper Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) NewCUIBCAssetWithAddress

func (keeper Keeper) NewCUIBCAssetWithAddress(ctx sdk.Context, cuType sdk.CUType, address sdk.CUAddress) exported.CUIBCAsset

func (Keeper) SaveDeposit

func (keeper Keeper) SaveDeposit(ctx sdk.Context, symbol string, address sdk.CUAddress, depositItem sdk.DepositItem) error

SaveDeposit save deposit item to store

func (Keeper) SetCUIBCAsset

func (keeper Keeper) SetCUIBCAsset(ctx sdk.Context, cuAst exported.CUIBCAsset)

SetCU implements sdk.Keeper.

func (Keeper) SetDepositList

func (keeper Keeper) SetDepositList(ctx sdk.Context, symbol string, address sdk.CUAddress, list sdk.DepositList)

func (Keeper) SetDepositStatus

func (keeper Keeper) SetDepositStatus(ctx sdk.Context, symbol string, address sdk.CUAddress, hash string, index uint64, stautus sdk.DepositItemStatus) error

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL