Documentation
¶
Index ¶
- Constants
- Variables
- func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, ...) (map[string]json.RawMessage, error)
- func GetMaccPerms() map[string][]string
- func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
- func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router, swaggerEnabled bool) interface{}
- func RequestFinalizeBlock(t *testing.T, app *HeimdallApp, height int64)
- func RequestFinalizeBlockWithTxs(t *testing.T, app *HeimdallApp, height int64, txs ...[]byte) *abci.ResponseFinalizeBlock
- func ValidateNonRpVoteExtension(ctx sdk.Context, height int64, extension []byte, ...) error
- func ValidateNonRpVoteExtensions(ctx sdk.Context, height int64, extVoteInfo []abciTypes.ExtendedVoteInfo, ...) error
- func ValidateVoteExtensions(ctx sdk.Context, reqHeight int64, extVoteInfo []abciTypes.ExtendedVoteInfo, ...) error
- type EmptyAppOptions
- type GenesisState
- type HandlerOptions
- type HeimdallApp
- func (app *HeimdallApp) AppCodec() codec.Codec
- func (app *HeimdallApp) AutoCliOpts() autocli.AppOptions
- func (app *HeimdallApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *HeimdallApp) BlockedModuleAccountAddrs(modAccAddrs map[string]bool) map[string]bool
- func (app *HeimdallApp) DefaultGenesis() map[string]json.RawMessage
- func (app *HeimdallApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *HeimdallApp) ExportAppStateAndValidators(_ bool, _ []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *HeimdallApp) ExtendVoteHandler() sdk.ExtendVoteHandler
- func (app *HeimdallApp) GetBaseApp() *baseapp.BaseApp
- func (app *HeimdallApp) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *HeimdallApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *HeimdallApp) GetStoreKeys() []storetypes.StoreKey
- func (app *HeimdallApp) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *HeimdallApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *HeimdallApp) GetTxConfig() client.TxConfig
- func (app *HeimdallApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *HeimdallApp) InterfaceRegistry() types.InterfaceRegistry
- func (app *HeimdallApp) LegacyAmino() *codec.LegacyAmino
- func (app *HeimdallApp) LoadHeight(height int64) error
- func (app *HeimdallApp) ModuleAccountAddrs() map[string]bool
- func (app *HeimdallApp) Name() string
- func (app *HeimdallApp) NewPrepareProposalHandler() sdk.PrepareProposalHandler
- func (app *HeimdallApp) NewProcessProposalHandler() sdk.ProcessProposalHandler
- func (app *HeimdallApp) OnTxFailed(_ sdk.Context, _, _ string, _ []byte, _ []byte)
- func (app *HeimdallApp) OnTxSucceeded(_ sdk.Context, _, _ string, _ []byte, _ []byte)
- func (app *HeimdallApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *HeimdallApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *HeimdallApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *HeimdallApp) RegisterSideMsgServices(cfg sidetxs.SideTxConfigurator)
- func (app *HeimdallApp) RegisterTendermintService(clientCtx client.Context)
- func (app *HeimdallApp) RegisterTxService(clientCtx client.Context)
- func (app *HeimdallApp) SimulationManager() *module.SimulationManager
- func (app *HeimdallApp) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
- type SetupAppResult
Constants ¶
const ( VoteExtBlockHeight = 2 CurrentHeight = 3 TxHash1 = "000000000000000000000000000000000000000000000000000000000001dead" TxHash2 = "000000000000000000000000000000000000000000000000000000000002dead" TxHash3 = "000000000000000000000000000000000000000000000000000000000003dead" ValAddr1 = "0x000000000000000000000000000000000001dEaD" ValAddr2 = "0x000000000000000000000000000000000002dEaD" ValAddr3 = "0x000000000000000000000000000000000003dEaD" )
const (
HeimdallAppName = "heimdallapp"
)
Variables ¶
var (
DefaultNodeHome string
)
Functions ¶
func GenesisStateWithValSet ¶
func GenesisStateWithValSet(codec codec.Codec, genesisState map[string]json.RawMessage, valSet *stakeTypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) (map[string]json.RawMessage, error)
GenesisStateWithValSet returns a new genesis state with the validator set
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func NewAnteHandler ¶
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)
NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.
func RegisterSwaggerAPI ¶
func RequestFinalizeBlock ¶
func RequestFinalizeBlock(t *testing.T, app *HeimdallApp, height int64)
func RequestFinalizeBlockWithTxs ¶
func RequestFinalizeBlockWithTxs(t *testing.T, app *HeimdallApp, height int64, txs ...[]byte) *abci.ResponseFinalizeBlock
func ValidateNonRpVoteExtension ¶
func ValidateNonRpVoteExtension( ctx sdk.Context, height int64, extension []byte, chainManagerKeeper chainManagerKeeper.Keeper, checkpointKeeper checkpointKeeper.Keeper, contractCaller helper.IContractCaller, ) error
ValidateNonRpVoteExtension validates the non-rp vote extension
func ValidateNonRpVoteExtensions ¶
func ValidateNonRpVoteExtensions( ctx sdk.Context, height int64, extVoteInfo []abciTypes.ExtendedVoteInfo, stakeKeeper stakeKeeper.Keeper, chainManagerKeeper chainManagerKeeper.Keeper, checkpointKeeper checkpointKeeper.Keeper, contractCaller helper.IContractCaller, logger log.Logger, ) error
ValidateNonRpVoteExtensions validates the non-rp vote extensions
func ValidateVoteExtensions ¶
func ValidateVoteExtensions(ctx sdk.Context, reqHeight int64, extVoteInfo []abciTypes.ExtendedVoteInfo, round int32, stakeKeeper stakeKeeper.Keeper) error
ValidateVoteExtensions verifies the vote extension correctness It checks the signature of each vote extension with its signer's public key Also, it checks if the vote extensions are enabled, valid and have >2/3 voting power It returns an error in case the validation fails
Types ¶
type EmptyAppOptions ¶
type EmptyAppOptions struct{}
func (EmptyAppOptions) Get ¶
func (ao EmptyAppOptions) Get(_ string) interface{}
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState of the blockchain is represented here as a map of raw json messages keyed by an identifier string. The identifier is used to determine which module genesis information belongs to, so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.
type HandlerOptions ¶
type HandlerOptions struct { ante.HandlerOptions SideTxConfig sidetxs.SideTxConfigurator }
HandlerOptions are the options required for constructing a default SDK AnteHandler.
type HeimdallApp ¶
type HeimdallApp struct { *baseapp.BaseApp // keepers AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper GovKeeper govkeeper.Keeper ParamsKeeper paramskeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper // Custom Keepers ClerkKeeper clerkkeeper.Keeper StakeKeeper stakeKeeper.Keeper TopupKeeper topupKeeper.Keeper ChainManagerKeeper chainmanagerkeeper.Keeper CheckpointKeeper checkpointKeeper.Keeper MilestoneKeeper milestoneKeeper.Keeper BorKeeper borKeeper.Keeper ModuleManager *module.Manager BasicManager module.BasicManager // contains filtered or unexported fields }
func NewHeimdallApp ¶
func NewHeimdallApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *HeimdallApp
func (*HeimdallApp) AppCodec ¶
func (app *HeimdallApp) AppCodec() codec.Codec
func (*HeimdallApp) AutoCliOpts ¶
func (app *HeimdallApp) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*HeimdallApp) BeginBlocker ¶
func (app *HeimdallApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
BeginBlocker application updates every begin block
func (*HeimdallApp) BlockedModuleAccountAddrs ¶
func (app *HeimdallApp) BlockedModuleAccountAddrs(modAccAddrs map[string]bool) map[string]bool
func (*HeimdallApp) DefaultGenesis ¶
func (app *HeimdallApp) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*HeimdallApp) EndBlocker ¶
EndBlocker application updates every end block
func (*HeimdallApp) ExportAppStateAndValidators ¶
func (app *HeimdallApp) ExportAppStateAndValidators( _ bool, _ []string, modulesToExport []string, ) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*HeimdallApp) ExtendVoteHandler ¶
func (app *HeimdallApp) ExtendVoteHandler() sdk.ExtendVoteHandler
ExtendVoteHandler extends pre-commit vote
func (*HeimdallApp) GetBaseApp ¶
func (app *HeimdallApp) GetBaseApp() *baseapp.BaseApp
func (*HeimdallApp) GetKey ¶
func (app *HeimdallApp) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*HeimdallApp) GetMemKey ¶
func (app *HeimdallApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
func (*HeimdallApp) GetStoreKeys ¶
func (app *HeimdallApp) GetStoreKeys() []storetypes.StoreKey
GetStoreKeys returns all the stored store keys.
func (*HeimdallApp) GetSubspace ¶
func (app *HeimdallApp) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
NOTE: This is solely to be used for testing purposes.
func (*HeimdallApp) GetTKey ¶
func (app *HeimdallApp) GetTKey(storeKey string) *storetypes.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*HeimdallApp) GetTxConfig ¶
func (app *HeimdallApp) GetTxConfig() client.TxConfig
func (*HeimdallApp) InitChainer ¶
func (app *HeimdallApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*HeimdallApp) InterfaceRegistry ¶
func (app *HeimdallApp) InterfaceRegistry() types.InterfaceRegistry
func (*HeimdallApp) LegacyAmino ¶
func (app *HeimdallApp) LegacyAmino() *codec.LegacyAmino
func (*HeimdallApp) LoadHeight ¶
func (app *HeimdallApp) LoadHeight(height int64) error
func (*HeimdallApp) ModuleAccountAddrs ¶
func (app *HeimdallApp) ModuleAccountAddrs() map[string]bool
func (*HeimdallApp) Name ¶
func (app *HeimdallApp) Name() string
func (*HeimdallApp) NewPrepareProposalHandler ¶
func (app *HeimdallApp) NewPrepareProposalHandler() sdk.PrepareProposalHandler
NewPrepareProposalHandler prepares the proposal after validating the vote extensions
func (*HeimdallApp) NewProcessProposalHandler ¶
func (app *HeimdallApp) NewProcessProposalHandler() sdk.ProcessProposalHandler
NewProcessProposalHandler processes the proposal, validates the vote extensions, and reject the proposal in case there's no majority. It is implemented by all the validators.
func (*HeimdallApp) OnTxFailed ¶
func (*HeimdallApp) OnTxSucceeded ¶
func (*HeimdallApp) PreBlocker ¶
func (app *HeimdallApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
PreBlocker application updates every pre block
func (*HeimdallApp) RegisterAPIRoutes ¶
func (app *HeimdallApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
func (*HeimdallApp) RegisterNodeService ¶
func (app *HeimdallApp) RegisterNodeService(clientCtx client.Context, cfg config.Config)
func (*HeimdallApp) RegisterSideMsgServices ¶
func (app *HeimdallApp) RegisterSideMsgServices(cfg sidetxs.SideTxConfigurator)
func (*HeimdallApp) RegisterTendermintService ¶
func (app *HeimdallApp) RegisterTendermintService(clientCtx client.Context)
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*HeimdallApp) RegisterTxService ¶
func (app *HeimdallApp) RegisterTxService(clientCtx client.Context)
func (*HeimdallApp) SimulationManager ¶
func (app *HeimdallApp) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
func (*HeimdallApp) VerifyVoteExtensionHandler ¶
func (app *HeimdallApp) VerifyVoteExtensionHandler() sdk.VerifyVoteExtensionHandler
VerifyVoteExtensionHandler performs some sanity checks on the VE received from other validators