Documentation
¶
Overview ¶
Package baseapp contains data structures that provide basic data storage functionality and act as a bridge between the ABCI interface and the SDK abstractions.
BaseApp has no state except the CommitMultiStore you provide upon init.
See examples/basecoin/app/* for usage.
Index ¶
- func IsTestAppTx(tx sdk.Tx) bool
- func NewRouter() *router
- type BaseApp
- func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
- func (app *BaseApp) CheckTx(txBytes []byte) (res abci.ResponseCheckTx)
- func (app *BaseApp) Commit() (res abci.ResponseCommit)
- func (app *BaseApp) DeliverTx(txBytes []byte) (res abci.ResponseDeliverTx)
- func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock)
- func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo
- func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain)
- func (app *BaseApp) LastBlockHeight() int64
- func (app *BaseApp) LastCommitID() sdk.CommitID
- func (app *BaseApp) LoadLatestVersion(mainKey sdk.StoreKey) error
- func (app *BaseApp) LoadVersion(version int64, mainKey sdk.StoreKey) error
- func (app *BaseApp) MountStore(key sdk.StoreKey, typ sdk.StoreType)
- func (app *BaseApp) Name() string
- func (app *BaseApp) NewContext(isCheckTx bool, txBytes []byte) sdk.Context
- func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery)
- func (app *BaseApp) Router() Router
- func (app *BaseApp) SetDefaultAnteHandler(ah sdk.AnteHandler)
- func (app *BaseApp) SetInitStater(initStater sdk.InitStater)
- func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOption)
- func (app *BaseApp) SetTxDecoder(txDecoder sdk.TxDecoder)
- type GenesisDoc
- type Router
- type TestApp
- func (tapp *TestApp) CommitMultiStore() sdk.CommitMultiStore
- func (tapp *TestApp) MultiStoreCheck() sdk.MultiStore
- func (tapp *TestApp) MultiStoreDeliver() sdk.MultiStore
- func (tapp *TestApp) RunBeginBlock()
- func (tapp *TestApp) RunCheckMsg(msg sdk.Msg) sdk.Result
- func (tapp *TestApp) RunCheckTx(tx sdk.Tx) sdk.Result
- func (tapp *TestApp) RunDeliverMsg(msg sdk.Msg) sdk.Result
- func (tapp *TestApp) RunDeliverTx(tx sdk.Tx) sdk.Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTestAppTx ¶
Types ¶
type BaseApp ¶
type BaseApp struct { // unmarshal rawjsonbytes to initialize the application // TODO unexpose and call from InitChain InitStater sdk.InitStater // contains filtered or unexported fields }
The ABCI application
func (*BaseApp) BeginBlock ¶
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock)
Implements ABCI
func (*BaseApp) CheckTx ¶
func (app *BaseApp) CheckTx(txBytes []byte) (res abci.ResponseCheckTx)
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)
Implements ABCI
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
func (*BaseApp) LastBlockHeight ¶
The last commited block height.
func (*BaseApp) LastCommitID ¶
The last CommitID of the multistore.
func (*BaseApp) LoadLatestVersion ¶
TODO add description
func (*BaseApp) LoadVersion ¶
Load application version
func (*BaseApp) MountStore ¶
Mount a store to the provided key in the BaseApp multistore
func (*BaseApp) NewContext ¶
NewContext returns a new Context suitable for AnteHandler (and indirectly Handler) processing. NOTE: txBytes may be nil to support TestApp.RunCheckTx and TestApp.RunDeliverTx.
func (*BaseApp) Query ¶
func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery)
Implements ABCI. Delegates to CommitMultiStore if it implements Queryable
func (*BaseApp) SetDefaultAnteHandler ¶
func (app *BaseApp) SetDefaultAnteHandler(ah sdk.AnteHandler)
func (*BaseApp) SetInitStater ¶
func (app *BaseApp) SetInitStater(initStater sdk.InitStater)
func (*BaseApp) SetOption ¶
func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOption)
Implements ABCI
type GenesisDoc ¶
type GenesisDoc struct {
AppState json.RawMessage `json:"app_state,omitempty"`
}
GenesisDoc defines the initial conditions for a tendermint blockchain, in particular its validator set.
func GenesisDocFromFile ¶
func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error)
GenesisDocFromFile reads JSON data from a file and unmarshalls it into a GenesisDoc.
type TestApp ¶
type TestApp struct { *BaseApp // These get set as we receive them. *abci.ResponseBeginBlock *abci.ResponseEndBlock }
TestApp wraps BaseApp with helper methods, and exposes more functionality than otherwise needed.
func NewTestApp ¶
func (*TestApp) CommitMultiStore ¶
func (tapp *TestApp) CommitMultiStore() sdk.CommitMultiStore
return the commited multistore
func (*TestApp) MultiStoreCheck ¶
func (tapp *TestApp) MultiStoreCheck() sdk.MultiStore
return a cache-wrap CheckTx state of multistore
func (*TestApp) MultiStoreDeliver ¶
func (tapp *TestApp) MultiStoreDeliver() sdk.MultiStore
return a cache-wrap DeliverTx state of multistore
func (*TestApp) RunCheckMsg ¶
run tx through CheckTx of TestApp NOTE: Skips authentication by wrapping msg in testTx{}.
func (*TestApp) RunCheckTx ¶
run tx through CheckTx of TestApp
func (*TestApp) RunDeliverMsg ¶
run tx through DeliverTx of TestApp NOTE: Skips authentication by wrapping msg in testTx{}.