ante

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnteHandler

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error)

func NewFixedGasMeter

func NewFixedGasMeter(consumed, limit sdk.Gas) sdk.GasMeter

NewFixedGasMeter returns a reference to a new basicGasMeter.

Types

type AccountKeeper

type AccountKeeper interface {
	ante.AccountKeeper

	HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool
}

type BankKeeper

type BankKeeper interface {
	authtypes.BankKeeper

	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
}

type CheckAddressesDecorator

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

CheckAddressesDecorator checks if all addresses are registered

func NewCheckAddressesDecorator

func NewCheckAddressesDecorator(ak AccountKeeper, sk ScorumKeeper) CheckAddressesDecorator

func (CheckAddressesDecorator) AnteHandle

func (d CheckAddressesDecorator) AnteHandle(
	ctx sdk.Context,
	tx sdk.Tx,
	simulate bool,
	next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

type DeductFeeDecorator

type DeductFeeDecorator struct {
	ante.DeductFeeDecorator
}

DeductFeeDecorator deducts fees from the first signer of the tx This decorator ALLOWS zero fees CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator

func (DeductFeeDecorator) AnteHandle

func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)

type HandlerOptions

type HandlerOptions struct {
	ante.HandlerOptions

	ScorumKeeper  ScorumKeeper
	AccountKeeper AccountKeeper
	BankKeeper    BankKeeper
}

type ScorumKeeper

type ScorumKeeper interface {
	GetParams(ctx sdk.Context) (params types.Params)
	IsSupervisor(ctx sdk.Context, addr string) bool

	SetAddressToRestoreGas(ctx sdk.Context, addr sdk.AccAddress)

	Mint(ctx sdk.Context, addr sdk.AccAddress, coin sdk.Coin) error
}

type SigVerificationDecorator added in v0.0.4

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

SigVerificationDecorator is a copy of cosmos original SigVerificationDecorator Own implementation is needed to skip signature checking for supervisors to allow use the same key from many integrated services in parallel.

func NewSigVerificationDecorator added in v0.0.4

func NewSigVerificationDecorator(ak AccountKeeper, sk ScorumKeeper, signModeHandler authsigning.SignModeHandler) SigVerificationDecorator

func (SigVerificationDecorator) AnteHandle added in v0.0.4

func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

type TrackGasConsumedDecorator

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

func (TrackGasConsumedDecorator) AnteHandle

func (d TrackGasConsumedDecorator) AnteHandle(
	ctx sdk.Context,
	tx sdk.Tx,
	simulate bool,
	next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

type ZeroGasTxDecorator

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

func NewZeroGasTxDecorator

func NewZeroGasTxDecorator(sk ScorumKeeper) ZeroGasTxDecorator

func (ZeroGasTxDecorator) AnteHandle

func (d ZeroGasTxDecorator) AnteHandle(
	ctx sdk.Context,
	tx sdk.Tx,
	simulate bool,
	next sdk.AnteHandler,
) (newCtx sdk.Context, err error)

Jump to

Keyboard shortcuts

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