validator

package
v1.6.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IoAddrLen defines length of IoTeX address
	IoAddrLen = 41
)

Variables

View Source
var (
	// ErrInvalidAddr indicates error for an invalid address
	ErrInvalidAddr = errors.New("invalid IoTeX address")
	// ErrLongAlias indicates error for a long alias more than 40 characters
	ErrLongAlias = errors.New("invalid long alias that is more than 40 characters")
	// ErrNonPositiveNumber indicates error for a non-positive number
	ErrNonPositiveNumber = errors.New("invalid number that is not positive")
	// ErrInvalidStakeDuration indicates error for invalid stake duration
	ErrInvalidStakeDuration = errors.New("stake duration must be within 0 and 1050 and in multiples of 7")
	// ErrInvalidCandidateName indicates error for invalid candidate name
	ErrLongCandidateName = errors.New("invalid length of candidate name that is more than 12 ")
	// ErrInvalidCandidateName indicates error for invalid candidate name (for ioctl stake2 command)
	ErrStake2CandidateName = errors.New("the candidate name string is not valid")
)

Errors

Functions

func ValidateAddress

func ValidateAddress(addr string) error

ValidateAddress validates IoTeX address

func ValidateAlias

func ValidateAlias(alias string) error

ValidateAlias validates alias for account

func ValidateCandidateNameForStake2 added in v1.0.0

func ValidateCandidateNameForStake2(candidateName string) error

ValidateCandidateNameForStake2 validates candidate name for native staking 2

func ValidatePositiveNumber

func ValidatePositiveNumber(number int64) error

ValidatePositiveNumber validates positive Number for action

func ValidateStakeDuration added in v0.11.0

func ValidateStakeDuration(stakeDuration *big.Int) error

ValidateStakeDuration validates stake duration for native staking

Types

This section is empty.

Jump to

Keyboard shortcuts

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