Documentation ¶
Index ¶
- Constants
- Variables
- func NewQueryRouter() *queryrouter
- func NewRouter() *router
- type Protocol
- type ProtocolEngine
- func (pe *ProtocolEngine) Activate(version uint64) bool
- func (pe *ProtocolEngine) Add(p Protocol) Protocol
- func (pe *ProtocolEngine) GetByVersion(v uint64) (Protocol, bool)
- func (pe *ProtocolEngine) GetCurrentProtocol() Protocol
- func (pe *ProtocolEngine) GetCurrentVersion() uint64
- func (pe *ProtocolEngine) GetKVStoreKeys() []*sdk.KVStoreKey
- func (pe *ProtocolEngine) GetTransientStoreKeys() []*sdk.TransientStoreKey
- func (pe *ProtocolEngine) LoadCurrentProtocol(kvStore sdk.KVStore) (bool, uint64)
- type QueryRouter
- type Router
Constants ¶
View Source
const ( // all store name AccountStore = "acc" CoreStore = "hs" StakeStore = "staking" StakeTransientStore = "transient_stake" MintStore = "mint" DistrStore = "distr" DistrTransientStore = "transient_distr" SlashingStore = "slashing" GovStore = "gov" FeeStore = "fee" ParamsStore = "params" ParamsTransientStore = "transient_params" ServiceStore = "service" GuardianStore = "guardian" UpgradeStore = "upgrade" Storage = "storage" Code = "code" // all route for query and handler BankRoute = "bank" AccountRoute = AccountStore CoreRoute = CoreStore StakeRoute = StakeStore DistrRoute = DistrStore SlashingRoute = SlashingStore GovRoute = GovStore ParamsRoute = ParamsStore ServiceRoute = ServiceStore GuardianRoute = GuardianStore UpgradeRoute = UpgradeStore MintRoute = MintStore // junying-todo, 2020-02-05 )
Variables ¶
View Source
var ( KeyMain = sdk.NewKVStoreKey(sdk.MainStore) KeyAccount = sdk.NewKVStoreKey(AccountStore) KeyStake = sdk.NewKVStoreKey(StakeStore) TkeyStake = sdk.NewTransientStoreKey(StakeTransientStore) KeyMint = sdk.NewKVStoreKey(MintStore) KeyDistr = sdk.NewKVStoreKey(DistrStore) TkeyDistr = sdk.NewTransientStoreKey(DistrTransientStore) KeySlashing = sdk.NewKVStoreKey(SlashingStore) KeyGov = sdk.NewKVStoreKey(GovStore) KeyFee = sdk.NewKVStoreKey(FeeStore) KeyParams = sdk.NewKVStoreKey(ParamsStore) TkeyParams = sdk.NewTransientStoreKey(ParamsTransientStore) KeyService = sdk.NewKVStoreKey(ServiceStore) KeyGuardian = sdk.NewKVStoreKey(GuardianStore) KeyUpgrade = sdk.NewKVStoreKey(UpgradeStore) KeyStorage = sdk.NewKVStoreKey(Storage) // junying-todo KeyCode = sdk.NewKVStoreKey(Code) // junying-todo )
Functions ¶
func NewQueryRouter ¶
func NewQueryRouter() *queryrouter
nolint NewRouter - create new router TODO either make Function unexported or make return type (router) Exported
Types ¶
type Protocol ¶
type Protocol interface { GetVersion() uint64 GetRouter() Router GetQueryRouter() QueryRouter GetAnteHandler() sdk.AnteHandler // ante handler for fee and auth GetFeeRefundHandler() sdk.FeeRefundHandler // fee handler for fee refund GetFeePreprocessHandler() sdk.FeePreprocessHandler // fee handler for fee preprocessor ExportAppStateAndValidators(ctx sdk.Context, forZeroHeight bool, jailWhiteList []string) (appState json.RawMessage, validators []tmtypes.GenesisValidator, err error) ValidateTx(ctx sdk.Context, txBytes []byte, msgs []sdk.Msg) sdk.Error // may be nil GetInitChainer() sdk.InitChainer1 // initialize state with validators and state blob GetBeginBlocker() sdk.BeginBlocker // logic to run before any txs GetEndBlocker() sdk.EndBlocker // logic to run after all txs, and to determine valset changes GetKVStoreKeyList() []*sdk.KVStoreKey Load() Init() GetCodec() *codec.Codec InitMetrics(store sdk.CommitMultiStore) // init metrics }
type ProtocolEngine ¶
type ProtocolEngine struct { ProtocolKeeper sdk.ProtocolKeeper // contains filtered or unexported fields }
func NewProtocolEngine ¶
func NewProtocolEngine(protocolKeeper sdk.ProtocolKeeper) ProtocolEngine
func (*ProtocolEngine) Activate ¶
func (pe *ProtocolEngine) Activate(version uint64) bool
To be used for Protocol with version > 0
func (*ProtocolEngine) Add ¶
func (pe *ProtocolEngine) Add(p Protocol) Protocol
func (*ProtocolEngine) GetByVersion ¶
func (pe *ProtocolEngine) GetByVersion(v uint64) (Protocol, bool)
func (*ProtocolEngine) GetCurrentProtocol ¶
func (pe *ProtocolEngine) GetCurrentProtocol() Protocol
func (*ProtocolEngine) GetCurrentVersion ¶
func (pe *ProtocolEngine) GetCurrentVersion() uint64
func (*ProtocolEngine) GetKVStoreKeys ¶
func (pe *ProtocolEngine) GetKVStoreKeys() []*sdk.KVStoreKey
func (*ProtocolEngine) GetTransientStoreKeys ¶
func (pe *ProtocolEngine) GetTransientStoreKeys() []*sdk.TransientStoreKey
func (*ProtocolEngine) LoadCurrentProtocol ¶
func (pe *ProtocolEngine) LoadCurrentProtocol(kvStore sdk.KVStore) (bool, uint64)
type QueryRouter ¶
type QueryRouter interface { AddRoute(r string, h sdk.Querier) (rtr QueryRouter) Route(path string) (h sdk.Querier) }
QueryRouter provides queryables for each query path.
Click to show internal directories.
Click to hide internal directories.