core

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Implements custom AnteHandler.

Implements AppMsModule interface (inherits from AppModule) to manage also multisignature modules.

MsManager implements Manager functional, but also allows to manage multisignature modules.

Multisignature router implementation.

Index

Constants

View Source
const (
	Codespace sdk.CodespaceType = "core"

	CodeFeeRequired   sdk.CodeType = 101
	CodeWrongFeeDenom sdk.CodeType = 102
)

Variables

View Source
var (
	DefaultFees = sdk.Coins{sdk.NewCoin(config.MainDenom, sdk.NewInt(1))}
)

Functions

func AuthAnteHandler

func AuthAnteHandler(ak vmauth.VMAccountKeeper, supplyKeeper types.SupplyKeeper, sigGasConsumer auth.SignatureVerificationGasConsumer) sdk.AnteHandler

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures & account numbers, and deducts fees from the first signer.

func ErrFeeRequired

func ErrFeeRequired() sdk.Error

StdTx Fee.Amount is empty

func ErrWrongFeeDenom

func ErrWrongFeeDenom(denom string) sdk.Error

StdTx Fee.Amount wrong denom

func NewAnteHandler

func NewAnteHandler(ak vmauth.VMAccountKeeper, supplyKeeper types.SupplyKeeper, sigGasConsumer auth.SignatureVerificationGasConsumer) sdk.AnteHandler

Custom antehandler catches and prevents transactions without fees and fees not in "dfi" currency After execution of custom logic, call standard auth.AnteHandler.

Types

type AppMsModule

type AppMsModule interface {
	module.AppModule
	NewMsHandler() MsHandler
}

Message handle for multisignature calls

type MsHandler

type MsHandler func(ctx sdk.Context, msg MsMsg) sdk.Error

Multisignature handler.

type MsManager

type MsManager struct {
	*module.Manager
	MsModules map[string]AppMsModule
}

Multisignature modules manager.

func NewMsManager

func NewMsManager(modules ...interface{}) *MsManager

New multisignature module manager.

func (*MsManager) RegisterMsRoutes

func (m *MsManager) RegisterMsRoutes(router Router)

Registering multisignature routes.

type MsMsg

type MsMsg interface {
	Route() string
	Type() string
	ValidateBasic() sdk.Error
}

Base message interface, using to execute by call, once call confirmed

type Router

type Router interface {
	AddRoute(r string, h MsHandler) (rtr Router)
	HasRoute(r string) bool
	GetRoute(path string) (h MsHandler)
	Seal()
}

Router implements a governance Handler router.

TODO: Use generic router (ref #3976).

func NewRouter

func NewRouter() Router

Jump to

Keyboard shortcuts

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