app

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: GPL-3.0 Imports: 37 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// AppName denotes app name
	AppName = "Heimdall"
	// ABCIPubKeyTypeSecp256k1 denotes pub key type
	ABCIPubKeyTypeSecp256k1 = "secp256k1"
)

Variables

View Source
var (
	// ModuleBasics defines the module BasicManager is in charge of setting up basic,
	// non-dependant module elements, such as codec registration
	// and genesis verification.
	ModuleBasics = module.NewBasicManager(
		params.AppModuleBasic{},
		auth.AppModuleBasic{},
		bank.AppModuleBasic{},
		supply.AppModuleBasic{},
		staking.AppModuleBasic{},
		checkpoint.AppModuleBasic{},
		bor.AppModuleBasic{},
		clerk.AppModuleBasic{},
		topup.AppModuleBasic{},
		gov.NewAppModuleBasic(paramsClient.ProposalHandler),
	)
)

Functions

func GetMaccPerms

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func MakeCodec

func MakeCodec() *codec.Codec

MakeCodec create codec

func MakePulp

func MakePulp() *authTypes.Pulp

MakePulp creates pulp codec and registers custom types for decoder

Types

type GenesisState

type GenesisState map[string]json.RawMessage

GenesisState the genesis state of the blockchain is represented here as a map of raw json messages key'd by a identifier string

func NewDefaultGenesisState

func NewDefaultGenesisState() GenesisState

NewDefaultGenesisState generates the default state for the application.

type HeimdallApp

type HeimdallApp struct {
	*bam.BaseApp

	// keepers
	AccountKeeper    auth.AccountKeeper
	BankKeeper       bank.Keeper
	SupplyKeeper     supply.Keeper
	GovKeeper        gov.Keeper
	CheckpointKeeper checkpoint.Keeper
	StakingKeeper    staking.Keeper
	BorKeeper        bor.Keeper
	ClerkKeeper      clerk.Keeper
	TopupKeeper      topup.Keeper
	// param keeper
	ParamsKeeper params.Keeper

	//  total coins supply
	TotalCoinsSupply types.Coins
	// contains filtered or unexported fields
}

HeimdallApp main heimdall app

func NewHeimdallApp

func NewHeimdallApp(logger log.Logger, db dbm.DB, baseAppOptions ...func(*bam.BaseApp)) *HeimdallApp

NewHeimdallApp creates heimdall app

func (*HeimdallApp) BeginBlocker

func (app *HeimdallApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock

BeginBlocker application updates every begin block

func (*HeimdallApp) Codec

func (app *HeimdallApp) Codec() *codec.Codec

Codec returns HeimdallApp's codec.

NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.

func (*HeimdallApp) EndBlocker

func (app *HeimdallApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock

EndBlocker executes on each end block

func (*HeimdallApp) ExportAppStateAndValidators

func (app *HeimdallApp) ExportAppStateAndValidators() (
	appState json.RawMessage,
	validators []tmTypes.GenesisValidator,
	err error,
)

ExportAppStateAndValidators exports the state of heimdall for a genesis file

func (*HeimdallApp) GetKey

func (app *HeimdallApp) GetKey(storeKey string) *sdk.KVStoreKey

GetKey returns the KVStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*HeimdallApp) GetSubspace

func (app *HeimdallApp) GetSubspace(moduleName string) subspace.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) *sdk.TransientStoreKey

GetTKey returns the TransientStoreKey for the provided store key.

NOTE: This is solely to be used for testing purposes.

func (*HeimdallApp) InitChainer

func (app *HeimdallApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain

InitChainer initializes chain

func (*HeimdallApp) LoadHeight

func (app *HeimdallApp) LoadHeight(height int64) error

LoadHeight loads a particular height

func (*HeimdallApp) ModuleAccountAddrs

func (app *HeimdallApp) ModuleAccountAddrs() map[string]bool

ModuleAccountAddrs returns all the app's module account addresses.

func (*HeimdallApp) Name

func (app *HeimdallApp) Name() string

Name returns the name of the App

type ModuleCommunicator

type ModuleCommunicator struct {
	App *HeimdallApp
}

ModuleCommunicator retriever

func (ModuleCommunicator) AddFeeToDividendAccount

func (d ModuleCommunicator) AddFeeToDividendAccount(ctx sdk.Context, valID types.ValidatorID, fee *big.Int) sdk.Error

AddFeeToDividendAccount add fee to dividend account

func (ModuleCommunicator) GetACKCount

func (d ModuleCommunicator) GetACKCount(ctx sdk.Context) uint64

GetACKCount returns ack count

func (ModuleCommunicator) GetCoins

GetCoins gets coins

func (ModuleCommunicator) GetValidatorFromValID

func (d ModuleCommunicator) GetValidatorFromValID(ctx sdk.Context, valID types.ValidatorID) (validator types.Validator, ok bool)

GetValidatorFromValID get validator from validator id

func (ModuleCommunicator) IsCurrentValidatorByAddress

func (d ModuleCommunicator) IsCurrentValidatorByAddress(ctx sdk.Context, address []byte) bool

IsCurrentValidatorByAddress check if validator is current validator

func (ModuleCommunicator) SendCoins

func (d ModuleCommunicator) SendCoins(ctx sdk.Context, fromAddr types.HeimdallAddress, toAddr types.HeimdallAddress, amt types.Coins) sdk.Error

SendCoins transfers coins

func (ModuleCommunicator) SetCoins

func (d ModuleCommunicator) SetCoins(ctx sdk.Context, addr types.HeimdallAddress, amt types.Coins) sdk.Error

SetCoins sets coins

Jump to

Keyboard shortcuts

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