types

package
v0.0.0-...-25b3476 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "accounts"

ModuleName is "accounts"

Variables

View Source
var ModuleCdc *codec.Codec

ModuleCdc - generic sealed codec to be used throughout this module

Functions

func SetGenesisStateInAppState

func SetGenesisStateInAppState(cdc *codec.Codec,
	appState map[string]json.RawMessage, genesisState GenesisState) map[string]json.RawMessage

set the genesis state within the expected app state

func ValidateGenesis

func ValidateGenesis(genesisState GenesisState) error

ValidateGenesis performs validation of genesis accounts. It ensures that there are no duplicate accounts in the genesis state and any provided vesting accounts are valid.

Types

type CUKeeper

type CUKeeper interface {
	NewCU(sdk.Context, authexported.CustodianUnit) authexported.CustodianUnit
	SetCU(sdk.Context, authexported.CustodianUnit)
	IterateCUs(ctx sdk.Context, process func(authexported.CustodianUnit) (stop bool))
}

CUKeeper defines the expected CustodianUnit keeper (noalias)

type GenesisCU

type GenesisCU struct {
	Type           sdk.CUType    `json:"cu_type" yaml:"cu_type"`
	PubKey         crypto.PubKey `json:"public_key" yaml:"public_key"`
	CoinsHold      sdk.Coins     `json:"coins_hold" yaml:"coins_hold"`
	Assets         []sdk.Asset   `json:"assets" yaml:"assets"`
	AssetCoins     sdk.Coins     `json:"asset_coins" yaml:"asset_coins"`
	AssetCoinsHold sdk.Coins     `json:"asset_coins_hold" yaml:"asset_coins_hold"`
	DisableSendTx  []sdk.Symbol  `json:"disable_send_tx" yaml:"disable_send_tx"`
	AssetPubkey    []byte        `json:"asset_pubkey" yaml:"asset_pubkey"`
	GasUsed        sdk.Coins     `json:"gas_used" yaml:"gas_used"`
	GasReceived    sdk.Coins     `json:"gas_received" yaml:"gas_received"`
	Address        sdk.CUAddress `json:"address" yaml:"address"`
	Coins          sdk.Coins     `json:"coins" yaml:"coins"`
	Sequence       uint64        `json:"sequence_number" yaml:"sequence_number"`

	// module CustodianUnit fields
	ModuleName        string   `json:"module_name" yaml:"module_name"`               // name of the module CustodianUnit
	ModulePermissions []string `json:"module_permissions" yaml:"module_permissions"` // permissions of module CustodianUnit
}

GenesisCU is a struct for CustodianUnit initialization used exclusively during genesis

func NewGenesisCU

func NewGenesisCU(cu *custodianunit.BaseCU) GenesisCU

NewGenesisCU creates a GenesisCU instance from a BaseCU.

func NewGenesisCUI

func NewGenesisCUI(cu cuexported.CustodianUnit) (GenesisCU, error)

NewGenesisCUI creates a GenesisCU instance from an CustodianUnit interface.

func NewGenesisCURaw

func NewGenesisCURaw(cutype sdk.CUType, pubkey crypto.PubKey, assetpubkey []byte, address sdk.CUAddress,
	coins, coinshold, assetcoins, assetcoinshold, gasreceived, gasused sdk.Coins, assets []sdk.Asset,
	module string, permissions ...string) GenesisCU

NewGenesisCURaw creates a new GenesisCU object

func (*GenesisCU) ToCU

func (ga *GenesisCU) ToCU() custodianunit.CU

ToCU converts a GenesisCU to an CustodianUnit interface

func (GenesisCU) Validate

func (ga GenesisCU) Validate() error

Validate checks for errors on the vesting and module CustodianUnit parameters

type GenesisCUs

type GenesisCUs []GenesisCU

___________________________________

func (GenesisCUs) Contains

func (gcus GenesisCUs) Contains(cu sdk.CUAddress) bool

genesis accounts contain an address

type GenesisState

type GenesisState GenesisCUs

State to Unmarshal

func GetGenesisStateFromAppState

func GetGenesisStateFromAppState(cdc *codec.Codec, appState map[string]json.RawMessage) GenesisState

get the genesis state from the expected app state

func (GenesisState) Sanitize

func (gs GenesisState) Sanitize()

Sanitize sorts accounts and coin sets. TODO sort not use CUNmuber

type TransferKeeper

type TransferKeeper interface {
	AddCoins(sdk.Context, sdk.CUAddress, sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
	AddCoinsHold(sdk.Context, sdk.CUAddress, sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error)
}

Jump to

Keyboard shortcuts

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