app

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: BSD-2-Clause Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSpaceUnconfirmedLimit sdk.CodespaceType = "unconfirmed_limit"
	CodeTooManyUnconfirmedTx  sdk.CodeType      = 2100
)
View Source
const (
	SameTxExist      = 1
	OtherTxExist     = 2
	NoTxExist        = 3
	SweepPeriod      = 15 * 60 // 15 minutes
	DefaultLimitTime = 60      // a minute
)
View Source
const (
	DefaultMaxMemoCharacters      uint64 = 512
	DefaultTxSizeCostPerByte      uint64 = 20
	DefaultSigVerifyCostED25519   uint64 = 11800
	DefaultSigVerifyCostSecp256k1 uint64 = 20000
)

auth

View Source
const (
	// DefaultUnbondingTime reflects three weeks in seconds as the default
	// unbonding time.
	DefaultUnbondingTime = 21 * Day

	// Default maximum number of bonded validators
	DefaultMaxValidators uint16 = 42
)

staking

View Source
const (
	DefaultMaxEvidenceAge           = 21 * Day
	DefaultSignedBlocksWindow int64 = 10000
)

slashing

View Source
const (
	// Default period for deposits & voting
	DefaultPeriod = 14 * Day // TODO
	VotingPeriod  = 7 * Day
)

gov

View Source
const (
	//alias
	OpWeightMsgAliasUpdate = "op_weight_msg_alias_update"
	// asset
	OpWeightMsgIssueToken           = "op_weight_msg_issue_token"
	OpWeightMsgTransferOwnership    = "op_weight_msg_transfer_ownership"
	OpWeightMsgMintToken            = "op_weight_msg_mint_token"
	OpWeightMsgBurnToken            = "op_weight_msg_burn_token"
	OpWeightMsgForbidToken          = "op_weight_msg_forbid_token"
	OpWeightMsgUnForbidToken        = "op_weight_msg_unforbid_token"
	OpWeightMsgAddTokenWhitelist    = "op_weight_msg_add_token_whitelist"
	OpWeightMsgRemoveTokenWhitelist = "op_weight_msg_remove_token_whitelist"
	OpWeightMsgForbidAddr           = "op_weight_msg_forbid_addr"
	OpWeightMsgUnForbidAddr         = "op_weight_msg_unforbid_addr"
	OpWeightMsgModifyTokenInfo      = "op_weight_msg_modify_token_info"
	// bancorlite
	OpWeightMsgBancorInit   = "op_weight_msg_bancor_init"
	OpWeightMsgBancorTrade  = "op_weight_msg_bancor_trade"
	OpWeightMsgBancorCancel = "op_weight_msg_bancor_cancel"
	// bankx
	OpWeightMsgSetMemoRequired = "op_weight_msg_set_memo_required"
	//comment
	OpWeightCreateNewThread   = "op_weight_create_new_thread"
	OpWeightCreateCommentRefs = "op_weight_create_comment_refs"
	// distrx
	OpWeightMsgDonateToCommunityPool = "op_weight_msg_donate_to_community_pool"
	//market
	OpWeightMsgCreateTradingPair    = "op_weight_msg_create_trading_pair"
	OpWeightMsgCancelTradingPair    = "op_weight_msg_cancel_trading_pair"
	OpWeightMsgModifyPricePrecision = "op_weight_msg_modify_price_precision"
	OpWeightMsgCreateOrder          = "op_weight_msg_create_order"
	OpWeightMsgCancelOrder          = "op_weight_msg_cancel_order"
)
View Source
const Day = 24 * time.Hour
View Source
const (
	DefaultEvidenceMaxAge int64 = 1000000
)

consensus

View Source
const (

	// DefaultKeyPass contains the default key password for genesis transactions
	DefaultKeyPass = "12345678"
)
View Source
const (
	MinSelfDelegation = 1000000e8
)

staking

View Source
const (
	TSDirCfg = "dir"
)

Variables

View Source
var (
	// default home directories for cetcli
	DefaultCLIHome = os.ExpandEnv("$HOME/.cetcli")

	// default home directories for cetd
	DefaultNodeHome = os.ExpandEnv("$HOME/.cetd")

	// The ModuleBasicManager is in charge of setting up basic,
	// non-dependant module elements, such as codec registration
	// and genesis verification.
	ModuleBasics dex.OrderedBasicManager

	// account permissions
	MaccPerms = map[string][]string{
		auth.FeeCollectorName:     nil,
		distr.ModuleName:          nil,
		staking.BondedPoolName:    {supply.Burner, supply.Staking},
		staking.NotBondedPoolName: {supply.Burner, supply.Staking},
		gov.ModuleName:            {supply.Burner},
		authx.ModuleName:          nil,
		asset.ModuleName:          {supply.Burner, supply.Minter},
	}
)

default home directories for expected binaries

View Source
var (
	DefaultMinSignedPerWindow      = sdk.NewDecWithPrec(5, 2)             // 0.05
	DefaultSlashFractionDoubleSign = sdk.NewDec(1).Quo(sdk.NewDec(20))    // 0.05
	DefaultSlashFractionDowntime   = sdk.NewDec(1).Quo(sdk.NewDec(10000)) // 0.0001

	DefaultGovMinDeposit = sdk.NewInt(10000e8)

	DefaultCrisisConstantFee = sdk.NewInt(100000e8)
)

Functions

func CreateContextAndRegisterRoutes added in v0.2.17

func CreateContextAndRegisterRoutes(router *mux.Router)

func GetDefaultAuthGenesisState added in v0.0.20

func GetDefaultAuthGenesisState() auth.GenesisState

func MakeCodec

func MakeCodec() *codec.Codec

custom tx codec

Types

type Account2UnconfirmedTx added in v0.0.15

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

func NewAccount2UnconfirmedTx added in v0.0.15

func NewAccount2UnconfirmedTx(limitTime int64) *Account2UnconfirmedTx

func (*Account2UnconfirmedTx) Add added in v0.0.15

func (acc2unc *Account2UnconfirmedTx) Add(addr sdk.AccAddress, hashid []byte, timestamp int64)

func (*Account2UnconfirmedTx) AddToRemoveList added in v0.0.15

func (acc2unc *Account2UnconfirmedTx) AddToRemoveList(addrs []sdk.AccAddress)

func (*Account2UnconfirmedTx) ClearRemoveList added in v0.0.15

func (acc2unc *Account2UnconfirmedTx) ClearRemoveList()

func (*Account2UnconfirmedTx) CommitRemove added in v0.0.15

func (acc2unc *Account2UnconfirmedTx) CommitRemove(timestamp int64)

func (*Account2UnconfirmedTx) Lookup added in v0.0.15

func (acc2unc *Account2UnconfirmedTx) Lookup(addr sdk.AccAddress, hashid []byte, timestamp int64) int

type AuthModuleBasic added in v0.0.4

type AuthModuleBasic struct {
	auth.AppModuleBasic
}

func (AuthModuleBasic) DefaultGenesis added in v0.0.4

func (amb AuthModuleBasic) DefaultGenesis() json.RawMessage

type CetChainApp

type CetChainApp struct {
	*bam.BaseApp

	plugin.Holder
	// contains filtered or unexported fields
}

Extended ABCI application

func NewCetChainApp

func NewCetChainApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
	invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp)) *CetChainApp

NewCetChainApp returns a reference to an initialized CetChainApp.

func (*CetChainApp) CheckTx added in v0.0.13

func (*CetChainApp) Commit added in v0.0.4

func (app *CetChainApp) Commit() abci.ResponseCommit

func (*CetChainApp) DeliverTx added in v0.0.4

func (*CetChainApp) ExportAppStateAndValidators

func (app *CetChainApp) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string) (
	appState json.RawMessage, validators []tmtypes.GenesisValidator, err error)

export the state of CoinEx chain for a genesis file

func (*CetChainApp) ExportGenesisState added in v0.0.4

func (app *CetChainApp) ExportGenesisState(ctx sdk.Context) GenesisState

func (*CetChainApp) LoadHeight

func (app *CetChainApp) LoadHeight(height int64) error

load a particular height

func (*CetChainApp) ModuleAccountAddrs added in v0.0.4

func (app *CetChainApp) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

type CrisisModuleBasic added in v0.0.4

type CrisisModuleBasic struct {
	crisis.AppModuleBasic
}

func (CrisisModuleBasic) DefaultGenesis added in v0.0.4

func (CrisisModuleBasic) DefaultGenesis() json.RawMessage

type GenesisState

type GenesisState struct {
	Accounts     genaccounts.GenesisState  `json:"accounts"`
	AuthData     auth.GenesisState         `json:"auth"`
	AuthXData    authx.GenesisState        `json:"authx"`
	BankData     bank.GenesisState         `json:"bank"`
	BankXData    bankx.GenesisState        `json:"bankx"`
	StakingData  staking.GenesisState      `json:"staking"`
	StakingXData stakingx.GenesisState     `json:"stakingx"`
	DistrData    distribution.GenesisState `json:"distribution"`
	GovData      gov.GenesisState          `json:"gov"`
	CrisisData   crisis.GenesisState       `json:"crisis"`
	SlashingData slashing.GenesisState     `json:"slashing"`
	AssetData    asset.GenesisState        `json:"asset"`
	MarketData   market.GenesisState       `json:"market"`
	BancorData   bancorlite.GenesisState   `json:"bancorlite"`
	CommentData  comment.GenesisState      `json:"comment"`
	AliasData    alias.GenesisState        `json:"alias"`
	Incentive    incentive.GenesisState    `json:"incentive"`
	Supply       supply.GenesisState       `json:"supply"`
	GenUtil      genutil.GenesisState      `json:"genutil"`
}

State to Unmarshal

func FromMap added in v0.0.4

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

func NewDefaultGenesisState

func NewDefaultGenesisState() GenesisState

type GovModuleBasic added in v0.0.4

type GovModuleBasic struct {
	gov.AppModuleBasic
}

func (GovModuleBasic) DefaultGenesis added in v0.0.4

func (GovModuleBasic) DefaultGenesis() json.RawMessage

type NewHeightInfo added in v0.0.13

type NewHeightInfo struct {
	ChainID       string       `json:"chain_id"`
	Height        int64        `json:"height"`
	TimeStamp     int64        `json:"timestamp"`
	LastBlockHash cmn.HexBytes `json:"last_block_hash"`
}

type NotificationBeginRedelegation added in v0.0.4

type NotificationBeginRedelegation struct {
	Delegator      string `json:"delegator"`
	ValidatorSrc   string `json:"src"`
	ValidatorDst   string `json:"dst"`
	Amount         string `json:"amount"`
	CompletionTime int64  `json:"completion_time"`
}

type NotificationBeginUnbonding added in v0.0.4

type NotificationBeginUnbonding struct {
	Delegator      string `json:"delegator"`
	Validator      string `json:"validator"`
	Amount         string `json:"amount"`
	CompletionTime int64  `json:"completion_time"`
}

type NotificationCompleteRedelegation added in v0.0.4

type NotificationCompleteRedelegation struct {
	Delegator    string `json:"delegator"`
	ValidatorSrc string `json:"src"`
	ValidatorDst string `json:"dst"`
}

type NotificationCompleteUnbonding added in v0.0.4

type NotificationCompleteUnbonding struct {
	Delegator string `json:"delegator"`
	Validator string `json:"validator"`
}

type NotificationDelegatorRewards added in v0.2.0

type NotificationDelegatorRewards struct {
	Validator string `json:"validator"`
	Rewards   string `json:"rewards"`
}

type NotificationSlash added in v0.0.4

type NotificationSlash struct {
	Validator string `json:"validator"`
	Power     string `json:"power"`
	Reason    string `json:"reason"`
	Jailed    bool   `json:"jailed"`
}

type NotificationTx added in v0.0.4

type NotificationTx struct {
	Signers      []sdk.AccAddress `json:"signers"`
	Transfers    []TransferRecord `json:"transfers"`
	SerialNumber int64            `json:"serial_number"`
	MsgTypes     []string         `json:"msg_types"`
	TxJSON       string           `json:"tx_json"`
	Height       int64            `json:"height"`
	Hash         []byte           `json:"hash"`
	ExtraInfo    string           `json:"extra_info,omitempty"`
}

type NotificationValidatorCommission added in v0.2.0

type NotificationValidatorCommission struct {
	Validator  string `json:"validator"`
	Commission string `json:"commission"`
}

type PubMsg added in v0.0.4

type PubMsg struct {
	Key   []byte
	Value []byte
}

type SlashingModuleBasic added in v0.0.4

type SlashingModuleBasic struct {
	slashing.AppModuleBasic
}

func (SlashingModuleBasic) DefaultGenesis added in v0.0.4

func (SlashingModuleBasic) DefaultGenesis() json.RawMessage

type StakingModuleBasic added in v0.0.4

type StakingModuleBasic struct {
	staking.AppModuleBasic
}

func (StakingModuleBasic) DefaultGenesis added in v0.0.4

func (StakingModuleBasic) DefaultGenesis() json.RawMessage

type TransferRecord added in v0.0.4

type TransferRecord struct {
	Sender    string `json:"sender"`
	Recipient string `json:"recipient"`
	Amount    string `json:"amount"`
}

type TxExtraInfo added in v0.0.15

type TxExtraInfo struct {
	Code      uint32       `json:"code,omitempty"`
	Data      []byte       `json:"data,omitempty"`
	Log       string       `json:"log,omitempty"`
	Info      string       `json:"info,omitempty"`
	GasWanted int64        `json:"gas_wanted,omitempty"`
	GasUsed   int64        `json:"gas_used,omitempty"`
	Events    []abci.Event `json:"events,omitempty"`
	Codespace string       `json:"codespace,omitempty"`
}

type UnconfirmedTx added in v0.0.15

type UnconfirmedTx struct {
	HashID    []byte
	Timestamp int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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