Documentation ¶
Index ¶
- func ConvertTxQcpResult(txQcpResult interface{}) (*txs.QcpTxResult, bool)
- func GetAccountMapper(ctx context.Context) *account.AccountMapper
- func GetConsMapper(ctx context.Context) *consensus.ConsensusMapper
- func GetConsParams(ctx context.Context) *abci.ConsensusParams
- func GetQcpMapper(ctx context.Context) *qcp.QcpMapper
- func MakeQBaseCodec() *go_amino.Codec
- func RegisterCodec(cdc *go_amino.Codec)
- func SetPruning(opts store.PruningOptions) func(*BaseApp)
- type BaseApp
- func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
- func (app *BaseApp) CheckTx(req abci.RequestCheckTx) (res abci.ResponseCheckTx)
- func (app *BaseApp) Commit() (res abci.ResponseCommit)
- func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx)
- func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock)
- func (app *BaseApp) GetCdc() *go_amino.Codec
- func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo
- func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)
- func (app *BaseApp) IsSealed() bool
- func (app *BaseApp) LastBlockHeight() int64
- func (app *BaseApp) LastCommitID() store.CommitID
- func (app *BaseApp) LoadLatestVersion() error
- func (app *BaseApp) LoadVersion(version int64) error
- func (app *BaseApp) Name() string
- func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) ctx.Context
- func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery)
- func (app *BaseApp) RegisterAccountProto(proto func() account.Account)
- func (app *BaseApp) RegisterCustomQueryHandler(handler CustomQueryHandler)
- func (app *BaseApp) RegisterMapper(mapper mapper.IMapper)
- func (app *BaseApp) RegisterTxQcpResultHandler(txQcpResultHandler TxQcpResultHandler)
- func (app *BaseApp) RegisterTxQcpSigner(signer crypto.PrivKey)
- func (app *BaseApp) Seal()
- func (app *BaseApp) SetBeginBlocker(beginBlocker BeginBlockHandler)
- func (app *BaseApp) SetCommitMultiStoreTracer(w io.Writer)
- func (app *BaseApp) SetEndBlocker(endBlocker EndBlockHandler)
- func (app *BaseApp) SetGasHandler(handler GasHandler)
- func (app *BaseApp) SetGasPreHandler(handler GasPreHandler)
- func (app *BaseApp) SetInitChainer(initChainer InitChainHandler)
- func (app *BaseApp) SetName(name string)
- func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOption)
- type BeginBlockHandler
- type CustomQueryHandler
- type EndBlockHandler
- type GasHandler
- type GasPreHandler
- type InitChainHandler
- type TxQcpResultHandler
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 GetConsMapper ¶ added in v0.0.8
func GetConsMapper(ctx context.Context) *consensus.ConsensusMapper
func GetConsParams ¶ added in v0.0.8
func GetConsParams(ctx context.Context) *abci.ConsensusParams
func MakeQBaseCodec ¶ added in v0.0.2
func RegisterCodec ¶
func SetPruning ¶ added in v0.2.0
func SetPruning(opts store.PruningOptions) func(*BaseApp)
SetPruning sets a pruning option on the multistore associated with the app
Types ¶
type BaseApp ¶
type BaseApp struct { // initialized on creation Config *cfg.Config Logger log.Logger // contains filtered or unexported fields }
BaseApp reflects the ABCI application implementation.
func NewBaseApp ¶
func NewBaseApp(name string, cfg *cfg.Config, 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(req abci.RequestCheckTx) (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) DeliverTx ¶
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (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) 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) LastBlockHeight ¶
the last committed block height
func (*BaseApp) LastCommitID ¶
the last CommitID of the multistore
func (*BaseApp) LoadLatestVersion ¶
load latest application version
func (*BaseApp) LoadVersion ¶
load application version
func (*BaseApp) NewContext ¶
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 ¶
RegisterQcpMapper 注册AccountMapper
func (*BaseApp) RegisterCustomQueryHandler ¶ added in v0.0.2
func (app *BaseApp) RegisterCustomQueryHandler(handler CustomQueryHandler)
func (*BaseApp) RegisterMapper ¶
func (*BaseApp) RegisterTxQcpResultHandler ¶
func (app *BaseApp) RegisterTxQcpResultHandler(txQcpResultHandler TxQcpResultHandler)
func (*BaseApp) RegisterTxQcpSigner ¶ added in v0.0.2
func (*BaseApp) SetBeginBlocker ¶
func (app *BaseApp) SetBeginBlocker(beginBlocker BeginBlockHandler)
func (*BaseApp) SetCommitMultiStoreTracer ¶
SetCommitMultiStoreTracer sets the store tracer on the BaseApp's underlying CommitMultiStore.
func (*BaseApp) SetEndBlocker ¶
func (app *BaseApp) SetEndBlocker(endBlocker EndBlockHandler)
func (*BaseApp) SetGasHandler ¶ added in v0.1.0
func (app *BaseApp) SetGasHandler(handler GasHandler)
func (*BaseApp) SetGasPreHandler ¶ added in v0.2.4
func (app *BaseApp) SetGasPreHandler(handler GasPreHandler)
func (*BaseApp) SetInitChainer ¶
func (app *BaseApp) SetInitChainer(initChainer InitChainHandler)
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 GasHandler ¶ added in v0.1.0
type GasPreHandler ¶ added in v0.2.4
gas-fee 处理
type InitChainHandler ¶
type InitChainHandler func(ctx ctx.Context, req abci.RequestInitChain) abci.ResponseInitChain
initialize application state at genesis
type TxQcpResultHandler ¶
TxQcpResultHandler qcpTx result 回调函数,在TxQcpResult.Exec中调用 Important!: txQcpResult 类型为 *txs.QcpTxResult Important!: 该方法panic时,在其中保存的数据将会被丢弃