cosmos

package
v12.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: LGPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Copyright 2022 Serv Foundation This file is part of the Serv Network packages.

Serv is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Serv packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Serv packages. If not, see https://github.com/twobitedd/serv/blob/main/LICENSE

Copyright 2022 Serv Foundation This file is part of the Serv Network packages.

Serv is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Serv packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Serv packages. If not, see https://github.com/twobitedd/serv/blob/main/LICENSE

Copyright 2022 Serv Foundation This file is part of the Serv Network packages.

Serv is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Serv packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Serv packages. If not, see https://github.com/twobitedd/serv/blob/main/LICENSE

Copyright 2022 Serv Foundation This file is part of the Serv Network packages.

Serv is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Serv packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Serv packages. If not, see https://github.com/twobitedd/serv/blob/main/LICENSE

Copyright 2022 Serv Foundation This file is part of the Serv Network packages.

Serv is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Serv packages are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Serv packages. If not, see https://github.com/twobitedd/serv/blob/main/LICENSE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifySignature

func VerifySignature(
	pubKey cryptotypes.PubKey,
	signerData authsigning.SignerData,
	sigData signing.SignatureData,
	_ authsigning.SignModeHandler,
	tx authsigning.Tx,
) error

VerifySignature verifies a transaction signature contained in SignatureData abstracting over different signing modes and single vs multi-signatures.

Types

type AuthzLimiterDecorator

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

AuthzLimiterDecorator blocks certain msg types from being granted or executed within the authorization module.

func NewAuthzLimiterDecorator

func NewAuthzLimiterDecorator(disabledMsgTypes ...string) AuthzLimiterDecorator

NewAuthzLimiterDecorator creates a decorator to block certain msg types from being granted or executed within authz.

func (AuthzLimiterDecorator) AnteHandle

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

type BankKeeper

type BankKeeper interface {
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	SendCoins(ctx sdk.Context, from, to sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
}

BankKeeper defines the exposed interface for using functionality of the bank keeper in the context of the cosmos AnteHandler package.

type DeductFeeDecorator

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

DeductFeeDecorator deducts fees from the first signer of the tx. If the first signer does not have the funds to pay for the fees, and does not have enough unclaimed staking rewards, then return with InsufficientFunds error. The next AnteHandler is called if fees are successfully deducted.

CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator

func NewDeductFeeDecorator

NewDeductFeeDecorator returns a new DeductFeeDecorator.

func (DeductFeeDecorator) AnteHandle

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

AnteHandle ensures that the transaction contains valid fee requirements and tries to deduct those from the account balance or unclaimed staking rewards, which the transaction sender might have.

type LegacyEip712SigVerificationDecorator deprecated

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

Deprecated: LegacyEip712SigVerificationDecorator Verify all signatures for a tx and return an error if any are invalid. Note, the LegacyEip712SigVerificationDecorator decorator will not get executed on ReCheck. NOTE: As of v10, EIP-712 signature verification is handled by the ethsecp256k1 public key (see ethsecp256k1.go)

CONTRACT: Pubkeys are set in context for all signers before this decorator runs CONTRACT: Tx must implement SigVerifiableTx interface

func NewLegacyEip712SigVerificationDecorator deprecated

func NewLegacyEip712SigVerificationDecorator(
	ak evmtypes.AccountKeeper,
	signModeHandler authsigning.SignModeHandler,
) LegacyEip712SigVerificationDecorator

Deprecated: NewLegacyEip712SigVerificationDecorator creates a new LegacyEip712SigVerificationDecorator

func (LegacyEip712SigVerificationDecorator) AnteHandle

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

AnteHandle handles validation of EIP712 signed cosmos txs. it is not run on RecheckTx

type MinGasPriceDecorator

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

MinGasPriceDecorator will check if the transaction's fee is at least as large as the MinGasPrices param. If fee is too low, decorator returns error and tx is rejected. This applies for both CheckTx and DeliverTx If fee is high enough, then call next AnteHandler CONTRACT: Tx must implement FeeTx to use MinGasPriceDecorator

func NewMinGasPriceDecorator

func NewMinGasPriceDecorator(fk evmante.FeeMarketKeeper, ek evmante.EVMKeeper) MinGasPriceDecorator

NewMinGasPriceDecorator creates a new MinGasPriceDecorator instance used only for Cosmos transactions.

func (MinGasPriceDecorator) AnteHandle

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

type RejectMessagesDecorator

type RejectMessagesDecorator struct{}

RejectMessagesDecorator prevents invalid msg types from being executed

func (RejectMessagesDecorator) AnteHandle

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

AnteHandle rejects messages that requires ethereum-specific authentication. For example `MsgEthereumTx` requires fee to be deducted in the antehandler in order to perform the refund.

type VestingDelegationDecorator

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

VestingDelegationDecorator validates delegation of vested coins

func NewVestingDelegationDecorator

NewVestingDelegationDecorator creates a new VestingDelegationDecorator

func (VestingDelegationDecorator) AnteHandle

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

AnteHandle checks if the tx contains a staking delegation. It errors if the coins are still locked or the bond amount is greater than the coins already vested

Jump to

Keyboard shortcuts

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