server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 27 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMsgs

func GetMsgs(anys []*types.Any) ([]sdk.Msg, error)

GetMsgs takes a slice of Any's and turn them into sdk.Msg's. This is similar to what is in the cosmos-sdk sdk.Tx and could eventually be merged in.

func SetMsgs

func SetMsgs(msgs []sdk.Msg) ([]*types.Any, error)

SetMsgs takes a slice of sdk.Msg's and turn them into Any's. This is similar to what is in the cosmos-sdk tx builder and could eventually be merged in.

func TypeURL

func TypeURL(req proto.Message) string

func UnpackInterfaces

func UnpackInterfaces(unpacker types.AnyUnpacker, anys []*types.Any) error

Types

type AuthorizationMiddleware

type AuthorizationMiddleware func(ctx sdk.Context, methodName string, req sdk.Msg, signer sdk.AccAddress) bool

AuthorizationMiddleware is a function that allows for more complex authorization than the default authorization scheme, such as delegated permissions. It will be called only if the default authorization fails.

type BeginBlockerModule added in v1.1.0

type BeginBlockerModule interface {
	BeginBlock(sdk.Context, abci.RequestBeginBlock)
}

BeginBlockerModule is a module exposing begin blocker for server module manager

type CallInfo

type CallInfo struct {
	Method string
	Caller types.ModuleID
}

type Configurator

type Configurator interface {
	sdkmodule.Configurator

	ModuleKey() RootModuleKey
	Marshaler() codec.Codec
	RequireServer(interface{})
	RegisterInvariantsHandler(registry RegisterInvariantsHandler)
	RegisterGenesisHandlers(module.InitGenesisHandler, module.ExportGenesisHandler)
	RegisterWeightedOperationsHandler(WeightedOperationsHandler)
	RegisterMigrationHandler(MigrationHandler)
}

type DerivedModuleKey

type DerivedModuleKey struct {
	// contains filtered or unexported fields
}

func (DerivedModuleKey) Address

func (d DerivedModuleKey) Address() sdk.AccAddress

func (DerivedModuleKey) Invoke

func (d DerivedModuleKey) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, _ ...grpc.CallOption) error

func (DerivedModuleKey) Invoker

func (d DerivedModuleKey) Invoker(methodName string) (types.Invoker, error)

func (DerivedModuleKey) ModuleID

func (d DerivedModuleKey) ModuleID() types.ModuleID

func (DerivedModuleKey) NewStream

type EndBlockerModule added in v1.1.0

type EndBlockerModule interface {
	EndBlock(sdk.Context, abci.RequestEndBlock) []abci.ValidatorUpdate
}

EndBlockerModule is a module exposing end blocker for server module manager

type FixtureFactory

type FixtureFactory struct {
	// contains filtered or unexported fields
}

func NewFixtureFactory

func NewFixtureFactory(t gocuke.TestingT, numSigners int) *FixtureFactory

func (*FixtureFactory) BaseApp

func (ff *FixtureFactory) BaseApp() *baseapp.BaseApp

BaseApp is exposed just for compatibility of these test suites with legacy modules and can be removed when everything has been migrated to ADR 033

func (*FixtureFactory) Codec

func (ff *FixtureFactory) Codec() *codec.ProtoCodec

Codec is exposed just for compatibility of these test suites with legacy modules and can be removed when everything has been migrated to ADR 033

func (*FixtureFactory) SetModules

func (ff *FixtureFactory) SetModules(modules []module.Module)

func (FixtureFactory) Setup

func (ff FixtureFactory) Setup() testutil.Fixture

type InvokerFactory

type InvokerFactory func(callInfo CallInfo) (types.Invoker, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is the server module manager It supports registration for begin and end blockers

func NewManager

func NewManager(baseApp *baseapp.BaseApp, cdc *codec.ProtoCodec) *Manager

NewManager creates a new Manager

func (*Manager) BeginBlock added in v1.1.0

func (mm *Manager) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) []abci.Event

func (*Manager) CompleteInitialization

func (mm *Manager) CompleteInitialization() error

CompleteInitialization should be the last function on the Manager called before the application starts to perform any necessary validation and initialization.

func (*Manager) EndBlock added in v1.1.0

func (mm *Manager) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) ([]abci.Event, []abci.ValidatorUpdate)

func (*Manager) ExportGenesis

func (mm *Manager) ExportGenesis(ctx sdk.Context) map[string]json.RawMessage

ExportGenesis performs export genesis functionality for modules.

func (*Manager) GetWeightedOperationsHandlers

func (mm *Manager) GetWeightedOperationsHandlers() []WeightedOperationsHandler

func (*Manager) InitGenesis

func (mm *Manager) InitGenesis(ctx sdk.Context, genesisData map[string]json.RawMessage, validatorUpdates []abci.ValidatorUpdate) abci.ResponseInitChain

InitGenesis performs init genesis functionality for modules. We pass in existing validatorUpdates from the sdk module Manager.InitGenesis.

func (*Manager) RegisterInvariants

func (mm *Manager) RegisterInvariants(ir sdk.InvariantRegistry)

RegisterInvariants registers all module routes and module querier routes

func (*Manager) RegisterModules

func (mm *Manager) RegisterModules(modules []module.Module) error

RegisterModules registers modules with the Manager and registers their services.

func (*Manager) RunMigrations added in v1.1.0

func (mm *Manager) RunMigrations(ctx sdk.Context, cdc codec.Codec) error

RunMigrations performs state migrations for registered modules.

func (*Manager) SetAuthorizationMiddleware

func (mm *Manager) SetAuthorizationMiddleware(authzFunc AuthorizationMiddleware)

SetAuthorizationMiddleware sets AuthorizationMiddleware for the Manager.

func (*Manager) WeightedOperations

func (mm *Manager) WeightedOperations(state sdkmodule.SimulationState, modules []sdkmodule.AppModuleSimulation) []simulation.WeightedOperation

WeightedOperations returns all the modules' weighted operations of an application

type MigrationHandler added in v1.1.0

type MigrationHandler func(ctx sdk.Context, cdc codec.Codec) error

type Module

type Module interface {
	module.TypeModule

	RegisterServices(Configurator)
}

Module is the module type that all server modules must satisfy

type ModuleKey

type ModuleKey interface {
	types.InvokerConn

	ModuleID() types.ModuleID
	Address() sdk.AccAddress
}

type RegisterInvariantsHandler

type RegisterInvariantsHandler func(ir sdk.InvariantRegistry)

type RootModuleKey

type RootModuleKey interface {
	ModuleKey
	sdk.StoreKey
	Derive(path []byte) DerivedModuleKey
}

type WeightedOperationsHandler

type WeightedOperationsHandler func(simstate sdkmodule.SimulationState) []simulation.WeightedOperation

Jump to

Keyboard shortcuts

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