protocol

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// all store name
	AccountStore         = "acc"
	StakeStore           = "stake"
	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"
	AssetStore           = "asset"
	RandStore            = "rand"

	// all route for query and handler
	BankRoute     = "bank"
	AccountRoute  = AccountStore
	StakeRoute    = StakeStore
	DistrRoute    = DistrStore
	SlashingRoute = SlashingStore
	GovRoute      = GovStore
	ParamsRoute   = ParamsStore
	ServiceRoute  = ServiceStore
	GuardianRoute = GuardianStore
	UpgradeRoute  = UpgradeStore
	AssetRoute    = AssetStore
	RandRoute     = RandStore
)

Variables

Functions

func NewQueryRouter

func NewQueryRouter() *queryrouter

nolint NewRouter - create new router TODO either make Function unexported or make return type (router) Exported

func NewRouter

func NewRouter() *router

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
	GetAnteHandlers() []sdk.AnteHandler                // ante handlers 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) (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(ctx sdk.Context)
	GetCodec() *codec.Codec
	InitMetrics(store sdk.MultiStore) // 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, ctx sdk.Context) 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)

func (*ProtocolEngine) LoadProtocol added in v0.15.0

func (pe *ProtocolEngine) LoadProtocol(version 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.

type Router

type Router interface {
	AddRoute(r string, h sdk.Handler) (rtr Router)
	Route(path string) (h sdk.Handler)
}

Router provides handlers for each transaction type.

Jump to

Keyboard shortcuts

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