baseabci

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 23 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTxQcpResult added in v0.0.4

func ConvertTxQcpResult(txQcpResult interface{}) (*txs.QcpTxResult, bool)

see: handler.go: TxQcpResultHandler

func GetAccountMapper added in v0.0.4

func GetAccountMapper(ctx context.Context) *account.AccountMapper

func GetQcpMapper added in v0.0.4

func GetQcpMapper(ctx context.Context) *qcp.QcpMapper

func MakeQBaseCodec added in v0.0.2

func MakeQBaseCodec() *go_amino.Codec

func RegisterCodec

func RegisterCodec(cdc *go_amino.Codec)

Types

type BaseApp

type BaseApp struct {
	// initialized on creation
	Logger log.Logger
	// contains filtered or unexported fields
}

BaseApp reflects the ABCI application implementation.

func NewBaseApp

func NewBaseApp(name string, logger log.Logger, db dbm.DB, registerCodecFunc func(*go_amino.Codec), options ...func(*BaseApp)) *BaseApp

NewBaseApp returns a reference to an initialized BaseApp.

func (*BaseApp) BeginBlock

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

BeginBlock implements the ABCI application interface.

func (*BaseApp) CheckTx

func (app *BaseApp) CheckTx(txBytes []byte) (res abci.ResponseCheckTx)

CheckTx implements ABCI CheckTx runs the "basic checks" to see whether or not a transaction can possibly be executed, first decoding, then the ante handler (which checks signatures/fees/ValidateBasic), then finally the route match to see whether a handler exists. CheckTx does not run the actual Msg handler function(s).

func (*BaseApp) Commit

func (app *BaseApp) Commit() (res abci.ResponseCommit)

Implements ABCI

func (*BaseApp) DeliverTx

func (app *BaseApp) DeliverTx(txBytes []byte) (res abci.ResponseDeliverTx)

Implements ABCI

func (*BaseApp) EndBlock

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

EndBlock implements the ABCI application interface.

func (*BaseApp) GetCdc

func (app *BaseApp) GetCdc() *go_amino.Codec

func (*BaseApp) Info

func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo

Implements ABCI

func (*BaseApp) InitChain

func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)

Implements ABCI InitChain runs the initialization logic directly on the CommitMultiStore and commits it.

func (*BaseApp) IsSealed

func (app *BaseApp) IsSealed() bool

func (*BaseApp) LastBlockHeight

func (app *BaseApp) LastBlockHeight() int64

the last committed block height

func (*BaseApp) LastCommitID

func (app *BaseApp) LastCommitID() store.CommitID

the last CommitID of the multistore

func (*BaseApp) LoadLatestVersion

func (app *BaseApp) LoadLatestVersion() error

load latest application version

func (*BaseApp) LoadVersion

func (app *BaseApp) LoadVersion(version int64) error

load application version

func (*BaseApp) Name

func (app *BaseApp) Name() string

BaseApp Name

func (*BaseApp) NewContext

func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) ctx.Context

NewContext returns a new Context with the correct store, the given header, and nil txBytes.

func (*BaseApp) Query

func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery)

Implements ABCI. Delegates to CommitMultiStore if it implements Queryable

func (*BaseApp) RegisterAccountProto

func (app *BaseApp) RegisterAccountProto(proto func() account.Account)

RegisterQcpMapper 注册AccountMapper

func (*BaseApp) RegisterCustomQueryHandler added in v0.0.2

func (app *BaseApp) RegisterCustomQueryHandler(handler CustomQueryHandler)

func (*BaseApp) RegisterMapper

func (app *BaseApp) RegisterMapper(mapper mapper.IMapper)

func (*BaseApp) RegisterTxQcpResultHandler

func (app *BaseApp) RegisterTxQcpResultHandler(txQcpResultHandler TxQcpResultHandler)

func (*BaseApp) RegisterTxQcpSigner added in v0.0.2

func (app *BaseApp) RegisterTxQcpSigner(signer crypto.PrivKey)

func (*BaseApp) Seal

func (app *BaseApp) Seal()

func (*BaseApp) SetBeginBlocker

func (app *BaseApp) SetBeginBlocker(beginBlocker BeginBlockHandler)

func (*BaseApp) SetCommitMultiStoreTracer

func (app *BaseApp) SetCommitMultiStoreTracer(w io.Writer)

SetCommitMultiStoreTracer sets the store tracer on the BaseApp's underlying CommitMultiStore.

func (*BaseApp) SetEndBlocker

func (app *BaseApp) SetEndBlocker(endBlocker EndBlockHandler)

func (*BaseApp) SetInitChainer

func (app *BaseApp) SetInitChainer(initChainer InitChainHandler)

func (*BaseApp) SetName

func (app *BaseApp) SetName(name string)

func (*BaseApp) SetOption

func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOption)

Implements ABCI

type BeginBlockHandler

type BeginBlockHandler func(ctx ctx.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

run code before the transactions in a block

type CustomQueryHandler added in v0.0.2

type CustomQueryHandler func(ctx ctx.Context, route []string, req abci.RequestQuery) (res []byte, err types.Error)

------------------------------------------------------------------------------------------------------------------------- CustomQueryHandler 自定义路径查询 ex: path: "/custom/qcp/a/b/c": 调用app.RegisterCustomQueryHandler(handler) handler中route为切片:[qcp,a,b,c]

type EndBlockHandler

type EndBlockHandler func(ctx ctx.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

run code after the transactions in a block and return updates to the validator set

type InitChainHandler

type InitChainHandler func(ctx ctx.Context, req abci.RequestInitChain) abci.ResponseInitChain

initialize application state at genesis

type TxQcpResultHandler

type TxQcpResultHandler func(ctx ctx.Context, txQcpResult interface{}) types.Result

TxQcpResultHandler qcpTx result 回调函数,在TxQcpResult.Exec中调用 Important!: txQcpResult 类型为 *txs.QcpTxResult

Jump to

Keyboard shortcuts

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