Documentation
¶
Index ¶
- func DeductFees(supplyKeeper types.SupplyKeeper, ctx sdk.Context, acc exported.Account, ...) sdk.Result
- func DefaultSigVerificationGasConsumer(meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params types.Params) sdk.Result
- func EnsureSufficientMempoolFees(ctx sdk.Context, stdFee types.StdFee) sdk.Result
- func GetSignBytes(chainID string, stdTx types.StdTx, acc exported.Account, genesis bool) []byte
- func GetSignerAcc(ctx sdk.Context, ak keeper.AccountKeeper, addr sdk.AccAddress) (exported.Account, sdk.Result)
- func NewAnteHandler(ak keeper.AccountKeeper, supplyKeeper types.SupplyKeeper, ...) sdk.AnteHandler
- func ProcessPubKey(acc exported.Account, sig types.StdSignature, simulate bool) (crypto.PubKey, sdk.Result)
- func SetGasMeter(simulate bool, ctx sdk.Context, gasLimit uint64) sdk.Context
- func ValidateMemo(stdTx types.StdTx, params types.Params) sdk.Result
- func ValidateSigCount(stdTx types.StdTx, params types.Params) sdk.Result
- type SignatureVerificationGasConsumer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeductFees ¶
func DeductFees(supplyKeeper types.SupplyKeeper, ctx sdk.Context, acc exported.Account, fees sdk.Coins) sdk.Result
DeductFees deducts fees from the given account.
NOTE: We could use the CoinKeeper (in addition to the AccountKeeper, because the CoinKeeper doesn't give us accounts), but it seems easier to do this.
func DefaultSigVerificationGasConsumer ¶
func DefaultSigVerificationGasConsumer( meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params types.Params, ) sdk.Result
DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type.
func EnsureSufficientMempoolFees ¶
EnsureSufficientMempoolFees verifies that the given transaction has supplied enough fees to cover a proposer's minimum fees. A result object is returned indicating success or failure.
Contract: This should only be called during CheckTx as it cannot be part of consensus.
func GetSignBytes ¶
GetSignBytes returns a slice of bytes to sign over for a given transaction and an account.
func GetSignerAcc ¶
func GetSignerAcc(ctx sdk.Context, ak keeper.AccountKeeper, addr sdk.AccAddress) (exported.Account, sdk.Result)
GetSignerAcc returns an account for a given address that is expected to sign a transaction.
func NewAnteHandler ¶
func NewAnteHandler(ak keeper.AccountKeeper, supplyKeeper types.SupplyKeeper, sigGasConsumer 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 ProcessPubKey ¶
func ProcessPubKey(acc exported.Account, sig types.StdSignature, simulate bool) (crypto.PubKey, sdk.Result)
ProcessPubKey verifies that the given account address matches that of the StdSignature. In addition, it will set the public key of the account if it has not been set.
func SetGasMeter ¶
SetGasMeter returns a new context with a gas meter set from a given context.
func ValidateMemo ¶
ValidateMemo validates the memo size.
Types ¶
type SignatureVerificationGasConsumer ¶
type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params types.Params) sdk.Result
SignatureVerificationGasConsumer is the type of function that is used to both consume gas when verifying signatures and also to accept or reject different types of PubKey's. This is where apps can define their own PubKey