amo

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// versions
	AMOAppVersion      = "v1.1.0-dev"
	AMOProtocolVersion = 0x2
)

Variables

This section is empty.

Functions

func FillGenesisState

func FillGenesisState(s *store.Store, genState *GenAmoAppState) error

Types

type AMOApp

type AMOApp struct {
	// app scaffold
	abci.BaseApplication
	// contains filtered or unexported fields
}

func NewAMOApp

func NewAMOApp(stateFile *os.File, mdb, idxdb, incdb tmdb.DB, l log.Logger) *AMOApp

func (*AMOApp) BeginBlock

func (app *AMOApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)

func (*AMOApp) CheckTx

func (app *AMOApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx

Invariant checks. Do not consider app's store. - check signature - check parameter format

func (*AMOApp) Commit

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

func (*AMOApp) DeliverTx

func (app *AMOApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx

func (*AMOApp) DistributeIncentive added in v1.2.0

func (app *AMOApp) DistributeIncentive() error

func (*AMOApp) EndBlock

func (app *AMOApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock)

TODO: use req.Height

func (*AMOApp) Info

func (app *AMOApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo)

func (*AMOApp) InitChain

func (app *AMOApp) InitChain(req abci.RequestInitChain) abci.ResponseInitChain

func (*AMOApp) Query

func (app *AMOApp) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)

TODO: return proof also

type AMOAppConfig added in v1.2.0

type AMOAppConfig struct {
	MaxValidators   uint64 `json:"max_validators"`
	WeightValidator int64  `json:"weight_validator"`
	WeightDelegator int64  `json:"weight_delegator"`
	BlkReward       uint64 `json:"blk_reward"`
	TxReward        uint64 `json:"tx_reward"`
	LockupPeriod    uint64 `json:"lockup_period"`
}

type GenAccBalance

type GenAccBalance struct {
	Owner  crypto.Address `json:"owner"`
	Amount types.Currency `json:"amount"`
}

type GenAccStake

type GenAccStake struct {
	Holder    crypto.Address `json:"holder"`
	Amount    types.Currency `json:"amount"`
	Validator []byte         `json:"validator"`
}

type GenAmoAppState

type GenAmoAppState struct {
	Config   AMOAppConfig    `json:"config"`
	Balances []GenAccBalance `json:"balances"`
	Stakes   []GenAccStake   `json:"stakes"`
}

func ParseGenesisStateBytes

func ParseGenesisStateBytes(data []byte) (*GenAmoAppState, error)

type State

type State struct {
	MerkleVersion int64  `json:"merkle_version"`
	Height        int64  `json:"height"` // current block height
	AppHash       []byte `json:"app_hash"`
	LastHeight    int64  `json:"last_height"` // last completed block height
	LastAppHash   []byte `json:"last_app_hash"`
}

func (*State) LoadFrom added in v1.2.0

func (s *State) LoadFrom(f *os.File) error

func (*State) SaveTo added in v1.2.0

func (s *State) SaveTo(f *os.File) error

Directories

Path Synopsis
encoding

Jump to

Keyboard shortcuts

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