pkg

package
v1.0.0-rc06 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoinIsZero

func CoinIsZero(coin sdk.Coin) bool

CoinIsZero checks if sdk.Coin is set (not panics in case Amount is nil).

func DecCoinIsNegative

func DecCoinIsNegative(coin sdk.DecCoin) bool

DecCoinIsNegative checks if sdk.DecCoin is negative (not panics in case Amount is nil).

func DecCoinIsZero

func DecCoinIsZero(coin sdk.DecCoin) bool

DecCoinIsZero checks if sdk.DecCoin is set (not panics in case Amount is nil).

func ExecuteWithGasLimit

func ExecuteWithGasLimit(ctx sdk.Context, gasLimit uint64, f func(ctx sdk.Context) error) (gasUsed uint64, err error)

ExecuteWithGasLimit executes a function with a gas limit. Taken from: https://github.com/cosmos/cosmos-sdk/pull/18475

func GetStringSliceFlag

func GetStringSliceFlag(cmd *cobra.Command, flagName string, canBeEmpty bool) ([]string, error)

GetStringSliceFlag is a helper function to get a slice of strings CLI flag.

func GetUint64Flag

func GetUint64Flag(cmd *cobra.Command, flagName string, canBeEmpty bool) (uint64, error)

GetUint64Flag is a helper function to get a uint64 CLI flag.

func GetUint64SliceFlag

func GetUint64SliceFlag(cmd *cobra.Command, flagName string, canBeEmpty bool) ([]uint64, error)

GetUint64SliceFlag is a helper function to get a slice of uint64 CLI flag.

func NewDecFromUint64

func NewDecFromUint64(v uint64) sdk.Dec

NewDecFromUint64 converts a uint64 value to the sdk.Dec.

func ParseAccAddressArg

func ParseAccAddressArg(argName, argValue string) (sdk.AccAddress, error)

ParseAccAddressArg is a helper function to parse an account address CLI argument.

func ParseAccAddressFlag

func ParseAccAddressFlag(cmd *cobra.Command, flagName string, isRequired bool) (*sdk.AccAddress, error)

ParseAccAddressFlag is a helper function to parse an account address CLI flag.

func ParseCoinArg

func ParseCoinArg(argName, argValue string) (sdk.Coin, error)

ParseCoinArg is a helper function to parse uint64 CLI argument.

func ParseInt64Arg

func ParseInt64Arg(argName, argValue string) (int64, error)

ParseInt64Arg is a helper function to parse int64 CLI argument.

func ParseUint64Arg

func ParseUint64Arg(argName, argValue string) (uint64, error)

ParseUint64Arg is a helper function to parse uint64 CLI argument.

func ReadPageRequest

func ReadPageRequest(flagSet *pflag.FlagSet) (*query.PageRequest, error)

ReadPageRequest reads and builds the necessary page request flags for pagination. This is fixed version of the client.ReadPageRequest function. The original version uses the "--page-key" flag as is, instead of base64 decoding it.

func SplitCoins

func SplitCoins(coins sdk.Coins, ratio sdk.Dec) (stack1, stack2 sdk.Coins)

SplitCoins splits coins in a proportion defined by the ratio. CONTRACT: inputs must be valid.

func Uint64Ptr

func Uint64Ptr(v uint64) *uint64

Uint64Ptr returns a pointer to the given uint64 value.

func ValidateCoin

func ValidateCoin(coin sdk.Coin) error

ValidateCoin performs a stricter validation of sdk.Coin comparing to the SDK version.

func ValidateDecCoin

func ValidateDecCoin(coin sdk.DecCoin) error

ValidateDecCoin performs a stricter validation of sdk.DecCoin comparing to the SDK version.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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