baseabci

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 26 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 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 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)

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) Commit

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

Implements ABCI

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) 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) 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) 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 GasHandler added in v0.1.0

type GasHandler func(ctx ctx.Context, payer types.AccAddress) (gasUsed uint64, err types.Error)

type GasPreHandler added in v0.2.4

type GasPreHandler func(ctx ctx.Context, payer types.AccAddress) types.Error

gas-fee 处理

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{})

TxQcpResultHandler qcpTx result 回调函数,在TxQcpResult.Exec中调用 Important!: txQcpResult 类型为 *txs.QcpTxResult Important!: 该方法panic时,在其中保存的数据将会被丢弃

Jump to

Keyboard shortcuts

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