server

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

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 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)
}

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 FixtureFactory

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

func NewFixtureFactory

func NewFixtureFactory(t *testing.T, 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

func NewManager

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

NewManager creates a new Manager

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) 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) 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 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