types

package
v12.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Bech32MainPrefix defines the main prefix for account addresses in the blockchain.
	Bech32MainPrefix = "sent"

	// PrefixValidator is the prefix used for validator keys.
	PrefixValidator = "val"

	// PrefixConsensus is the prefix used for consensus keys.
	PrefixConsensus = "cons"

	// PrefixPublic is the prefix used for public keys.
	PrefixPublic = "pub"

	// PrefixOperator is the prefix used for operator keys.
	PrefixOperator = "oper"

	// PrefixProvider is the prefix used for provider keys.
	PrefixProvider = "prov"

	// PrefixNode is the prefix used for node keys.
	PrefixNode = "node"

	// Bech32PrefixAccAddr defines the Bech32 prefix for an account address in the blockchain.
	Bech32PrefixAccAddr = Bech32MainPrefix

	// Bech32PrefixAccPub defines the Bech32 prefix for an account public key in the blockchain.
	Bech32PrefixAccPub = Bech32MainPrefix + PrefixPublic

	// Bech32PrefixValAddr defines the Bech32 prefix for a validator operator address in the blockchain.
	Bech32PrefixValAddr = Bech32MainPrefix + PrefixValidator + PrefixOperator

	// Bech32PrefixValPub defines the Bech32 prefix for a validator operator public key in the blockchain.
	Bech32PrefixValPub = Bech32MainPrefix + PrefixValidator + PrefixOperator + PrefixPublic

	// Bech32PrefixConsAddr defines the Bech32 prefix for a validator consensus address in the blockchain.
	Bech32PrefixConsAddr = Bech32MainPrefix + PrefixValidator + PrefixConsensus

	// Bech32PrefixConsPub defines the Bech32 prefix for a validator consensus public key in the blockchain.
	Bech32PrefixConsPub = Bech32MainPrefix + PrefixValidator + PrefixConsensus + PrefixPublic

	// Bech32PrefixProvAddr defines the Bech32 prefix for a provider address in the blockchain.
	Bech32PrefixProvAddr = Bech32MainPrefix + PrefixProvider

	// Bech32PrefixProvPub defines the Bech32 prefix for a provider public key in the blockchain.
	Bech32PrefixProvPub = Bech32MainPrefix + PrefixProvider + PrefixPublic

	// Bech32PrefixNodeAddr defines the Bech32 prefix for a node address in the blockchain.
	Bech32PrefixNodeAddr = Bech32MainPrefix + PrefixNode

	// Bech32PrefixNodePub defines the Bech32 prefix for a node public key in the blockchain.
	Bech32PrefixNodePub = Bech32MainPrefix + PrefixNode + PrefixPublic
)
View Source
const (
	FlagAccAddr        = "acc-addr"
	FlagNodeAddr       = "node-addr"
	FlagPlanID         = "plan-id"
	FlagProvAddr       = "prov-addr"
	FlagStatus         = "status"
	FlagSubscriptionID = "subscription-id"
)

Variables

View Source
var (
	Kilobyte = sdkmath.NewInt(1000)
	Megabyte = sdkmath.NewInt(1000).Mul(Kilobyte)
	Gigabyte = sdkmath.NewInt(1000).Mul(Megabyte)
)
View Source
var (
	TestTimeZero = time.Time{}
	TestTimeNow  = time.Now()

	TestAddrEmpty         = ""
	TestAddrInvalid       = "invalid"
	TestAddrInvalidPrefix = "invalid1qypqxpq9qcrsszgszyfpx9q4zct3sxfqe52gp4"

	TestBech32AccAddr10Bytes = "sent1qypqxpq9qcrsszgslawd5s"
	TestBech32AccAddr20Bytes = "sent1qypqxpq9qcrsszgszyfpx9q4zct3sxfq0fzduj"
	TestBech32AccAddr30Bytes = "sent1qypqxpq9qcrsszgszyfpx9q4zct3sxfqyy3zxfp9ycnjs2fszvfck8"

	TestBech32NodeAddr10Bytes = "sentnode1qypqxpq9qcrsszgse4wwrm"
	TestBech32NodeAddr20Bytes = "sentnode1qypqxpq9qcrsszgszyfpx9q4zct3sxfqelr5ey"
	TestBech32NodeAddr30Bytes = "sentnode1qypqxpq9qcrsszgszyfpx9q4zct3sxfqyy3zxfp9ycnjs2fsxqglcv"

	TestBech32ProvAddr10Bytes = "sentprov1qypqxpq9qcrsszgsutj8xr"
	TestBech32ProvAddr20Bytes = "sentprov1qypqxpq9qcrsszgszyfpx9q4zct3sxfq877k82"
	TestBech32ProvAddr30Bytes = "sentprov1qypqxpq9qcrsszgszyfpx9q4zct3sxfqyy3zxfp9ycnjs2fsh33zgx"

	TestDenomEmpty   = ""
	TestDenomInvalid = "i"
	TestDenomOne     = "one"
	TestDenomTwo     = "two"

	TestIntEmpty    = sdkmath.Int{}
	TestIntNegative = sdkmath.NewInt(-1000)
	TestIntZero     = sdkmath.NewInt(0)
	TestIntPositive = sdkmath.NewInt(1000)

	TestCoinEmpty          = sdk.Coin{}
	TestCoinEmptyDenom     = sdk.Coin{Denom: TestDenomEmpty, Amount: TestIntPositive}
	TestCoinInvalidDenom   = sdk.Coin{Denom: TestDenomInvalid, Amount: TestIntPositive}
	TestCoinEmptyAmount    = sdk.Coin{Denom: TestDenomOne, Amount: TestIntEmpty}
	TestCoinNegativeAmount = sdk.Coin{Denom: TestDenomOne, Amount: TestIntNegative}
	TestCoinZeroAmount     = sdk.Coin{Denom: TestDenomOne, Amount: TestIntZero}
	TestCoinPositiveAmount = sdk.Coin{Denom: TestDenomOne, Amount: TestIntPositive}

	TestCoinsNil            sdk.Coins = nil
	TestCoinsEmpty                    = sdk.Coins{}
	TestCoinsEmptyDenom               = sdk.Coins{TestCoinEmptyDenom}
	TestCoinsInvalidDenom             = sdk.Coins{TestCoinInvalidDenom}
	TestCoinsEmptyAmount              = sdk.Coins{TestCoinEmptyAmount}
	TestCoinsNegativeAmount           = sdk.Coins{TestCoinNegativeAmount}
	TestCoinsZeroAmount               = sdk.Coins{TestCoinZeroAmount}
	TestCoinsPositiveAmount           = sdk.Coins{TestCoinPositiveAmount}
)

Functions

func AccAddrFromFlags

func AccAddrFromFlags(flags *pflag.FlagSet) (sdk.AccAddress, error)

func PlanIDFromFlags

func PlanIDFromFlags(flags *pflag.FlagSet) (uint64, error)

func StatusFromFlags

func StatusFromFlags(flags *pflag.FlagSet) (v1.Status, error)

func SubscriptionIDFromFlags

func SubscriptionIDFromFlags(flags *pflag.FlagSet) (uint64, error)

Types

type Config

type Config struct {
	*sdk.Config
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() *Config

func (*Config) GetBech32NodeAddrPrefix

func (c *Config) GetBech32NodeAddrPrefix() string

func (*Config) GetBech32NodePubPrefix

func (c *Config) GetBech32NodePubPrefix() string

func (*Config) GetBech32ProviderAddrPrefix

func (c *Config) GetBech32ProviderAddrPrefix() string

func (*Config) GetBech32ProviderPubPrefix

func (c *Config) GetBech32ProviderPubPrefix() string

func (*Config) Seal

func (c *Config) Seal()

func (*Config) SetBech32PrefixForNode

func (c *Config) SetBech32PrefixForNode(addr, pub string)

func (*Config) SetBech32PrefixForProvider

func (c *Config) SetBech32PrefixForProvider(addr, pub string)

type NodeAddress

type NodeAddress []byte

func NodeAddrFromFlags

func NodeAddrFromFlags(flags *pflag.FlagSet) (NodeAddress, error)

func NodeAddressFromBech32

func NodeAddressFromBech32(str string) (NodeAddress, error)

func (NodeAddress) Bytes

func (n NodeAddress) Bytes() []byte

func (NodeAddress) Empty

func (n NodeAddress) Empty() bool

func (NodeAddress) Equals

func (n NodeAddress) Equals(addr sdk.Address) bool

func (NodeAddress) Format

func (n NodeAddress) Format(f fmt.State, c rune)

func (NodeAddress) Marshal

func (n NodeAddress) Marshal() ([]byte, error)

func (NodeAddress) MarshalJSON

func (n NodeAddress) MarshalJSON() ([]byte, error)

func (NodeAddress) MarshalYAML

func (n NodeAddress) MarshalYAML() (interface{}, error)

func (NodeAddress) String

func (n NodeAddress) String() string

func (*NodeAddress) Unmarshal

func (n *NodeAddress) Unmarshal(data []byte) error

func (*NodeAddress) UnmarshalJSON

func (n *NodeAddress) UnmarshalJSON(data []byte) (err error)

func (*NodeAddress) UnmarshalYAML

func (n *NodeAddress) UnmarshalYAML(data []byte) (err error)

type ProvAddress

type ProvAddress []byte

func ProvAddrFromFlags

func ProvAddrFromFlags(flags *pflag.FlagSet) (ProvAddress, error)

func ProvAddressFromBech32

func ProvAddressFromBech32(str string) (ProvAddress, error)

func (ProvAddress) Bytes

func (p ProvAddress) Bytes() []byte

func (ProvAddress) Empty

func (p ProvAddress) Empty() bool

func (ProvAddress) Equals

func (p ProvAddress) Equals(addr sdk.Address) bool

func (ProvAddress) Format

func (p ProvAddress) Format(f fmt.State, c rune)

func (ProvAddress) Marshal

func (p ProvAddress) Marshal() ([]byte, error)

func (ProvAddress) MarshalJSON

func (p ProvAddress) MarshalJSON() ([]byte, error)

func (ProvAddress) MarshalYAML

func (p ProvAddress) MarshalYAML() (interface{}, error)

func (ProvAddress) String

func (p ProvAddress) String() string

func (*ProvAddress) Unmarshal

func (p *ProvAddress) Unmarshal(data []byte) error

func (*ProvAddress) UnmarshalJSON

func (p *ProvAddress) UnmarshalJSON(data []byte) (err error)

func (*ProvAddress) UnmarshalYAML

func (p *ProvAddress) UnmarshalYAML(data []byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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