* Add height in exported genesis * +1 * Add test * Refactor ctx in setupApp * Use amino in export * Use tmjson * Add custom initialVersion (set to 0 for now) * Add comment * Add mount in initChainer * app.LastBlockheight * InitializeAndSeal in InitChain? * Revert create store with initial version * Update to latest iavl * Check height in test * Make it work * Add more tests * Rename interface * Use struct isntead of 6 args * Fix lint * Remove stray fmt * Revert go mod/sum * Install iavl rc3 * Update comments * Add fee in network * Typo * Fix logic in commit * Fix tests * Only set initial version on > 1 * Genesis block num = 1 * Fresh chain, genesis block = 0 * Add comments * Revert Mutable/ImmutableTree * Allow for zero height * Fix restart * Add comments * Add comments, fix test * Fix remaining one test * Add panic test * Update comment * Add test for --height * No cast * Add check that genesis file exists * Remove duplicate imports * Fail early Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com> Co-authored-by: Cory <cjlevinson@gmail.com>
45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
package simapp
|
|
|
|
import (
|
|
abci "github.com/tendermint/tendermint/abci/types"
|
|
|
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
"github.com/cosmos/cosmos-sdk/server/types"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/cosmos/cosmos-sdk/types/module"
|
|
)
|
|
|
|
// App implements the common methods for a Cosmos SDK-based application
|
|
// specific blockchain.
|
|
type App interface {
|
|
// The assigned name of the app.
|
|
Name() string
|
|
|
|
// The application types codec.
|
|
// NOTE: This shoult be sealed before being returned.
|
|
LegacyAmino() *codec.LegacyAmino
|
|
|
|
// Application updates every begin block.
|
|
BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
|
|
|
|
// Application updates every end block.
|
|
EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
|
|
|
|
// Application update at chain (i.e app) initialization.
|
|
InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
|
|
|
|
// Loads the app at a given height.
|
|
LoadHeight(height int64) error
|
|
|
|
// Exports the state of the application for a genesis file.
|
|
ExportAppStateAndValidators(
|
|
forZeroHeight bool, jailAllowedAddrs []string,
|
|
) (types.ExportedApp, error)
|
|
|
|
// All the registered module account addreses.
|
|
ModuleAccountAddrs() map[string]bool
|
|
|
|
// Helper for the simulation framework.
|
|
SimulationManager() *module.SimulationManager
|
|
}
|