amo

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// versions
	AMOAppVersion      = "v1.7.0"
	AMOProtocolVersion = uint64(0x4)
)
View Source
const Migration string = "ProtocolMigration"

Variables

View Source
var (
	// TODO: remove these variables at protocol v5 release
	// configs from 'cmd/amod'
	DataDirPath string = ""
)

Functions

func FillGenesisState

func FillGenesisState(st *State, 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(checkpoint_interval int64, mdb, idxdb 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 - check availability of binding tx to block - check replay attack of txs which were processed before

func (*AMOApp) Close added in v1.6.5

func (app *AMOApp) Close()

func (*AMOApp) Commit

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

func (*AMOApp) DeliverTx

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

func (*AMOApp) EndBlock

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

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) MigrateTo4 added in v1.7.0

func (app *AMOApp) MigrateTo4()

func (*AMOApp) MigrateToX added in v1.5.1

func (app *AMOApp) MigrateToX()

func (*AMOApp) Query

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

TODO: return proof also

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 {
	State    State              `json:"state"`
	Config   types.AMOAppConfig `json:"config"`
	Balances []GenAccBalance    `json:"balances"`
	Stakes   []GenAccStake      `json:"stakes"`
}

func ParseGenesisStateBytes

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

type State

type State struct {
	ProtocolVersion uint64 `json:"-"`
	Height          int64  `json:"-"` // current block height
	LastHeight      int64  `json:"-"` // last completed block height
	LastAppHash     []byte `json:"-"`
	NextDraftID     uint32 `json:"-"`
}

func (*State) LoadFrom added in v1.2.0

func (s *State) LoadFrom(sto *store.Store, cfg types.AMOAppConfig)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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