basket

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const BasketSubModuleName = ecocredit.ModuleName + "-basket"

Variables

View Source
var (
	// RegexBasketName requires the first character to be alphabetic, the rest can be alphanumeric. We
	// reduce length constraints by one to account for the first character being forced to alphabetic.
	RegexBasketName = fmt.Sprintf(`[a-zA-Z][a-zA-Z0-9]{%d,%d}`, nameMinLen-1, nameMaxLen-1)
	// RegexBasketDenom requires the first part to match the denom prefix, the second part to match the
	// format for a credit type abbreviation (with or without an exponent prefix), and the third part to
	// satisfy the basket name. Each of the three parts must also be separated by a ".".
	RegexBasketDenom = fmt.Sprintf(`%s.[a-zA-Z]{1,4}.%s`, denomPrefix, RegexBasketName)
)
View Source
var (
	ErrCantDisableRetire = errors.Register(codespace, 2, "can't disable retirement when taking from this basket")
)

Functions

func FormatBasketDenom

func FormatBasketDenom(name, creditTypeAbbrev string, exponent uint32) (string, string, error)

FormatBasketDenom formats denom and display denom: - denom: eco.<exponent-prefix><credit-type-abbrev>.<name> - display denom: eco.<credit-type-abbrev>.<name>

func ValidateBasketDenom

func ValidateBasketDenom(denom string) error

ValidateBasketDenom validates a basket denom. The denom must conform to the format described in FormatBasketDenom. The return is nil if the denom is valid.

func ValidateBasketName

func ValidateBasketName(name string) error

ValidateBasketName validates a basket name. The name must conform to the format described in FormatBasketName. The return is nil if the name is valid.

Types

This section is empty.

Directories

Path Synopsis
types
v1
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.

Jump to

Keyboard shortcuts

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