types

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 36

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 (
	FlagStatus = "status"
)

Variables

View Source
var (
	Kilobyte = sdk.NewInt(1000)
	Megabyte = sdk.NewInt(1000).Mul(Kilobyte)
	Gigabyte = sdk.NewInt(1000).Mul(Megabyte)
)
View Source
var (
	ErrInvalidLengthBandwidth        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBandwidth          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBandwidth = fmt.Errorf("proto: unexpected end of group")
)
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    = sdk.Int{}
	TestIntNegative = sdk.NewInt(-1000)
	TestIntZero     = sdk.NewInt(0)
	TestIntPositive = sdk.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}
)
View Source
var Status_name = map[int32]string{
	0: "STATUS_UNSPECIFIED",
	1: "STATUS_ACTIVE",
	2: "STATUS_INACTIVE_PENDING",
	3: "STATUS_INACTIVE",
}
View Source
var Status_value = map[string]int32{
	"STATUS_UNSPECIFIED":      0,
	"STATUS_ACTIVE":           1,
	"STATUS_INACTIVE_PENDING": 2,
	"STATUS_INACTIVE":         3,
}

Functions

This section is empty.

Types

type Bandwidth

type Bandwidth struct {
	Upload   github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=upload,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"upload"`
	Download github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=download,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"download"`
}

func NewBandwidth

func NewBandwidth(upload, download sdk.Int) Bandwidth

func NewBandwidthFromInt64

func NewBandwidthFromInt64(upload, download int64) Bandwidth

func (Bandwidth) Add

func (b Bandwidth) Add(v Bandwidth) Bandwidth

func (Bandwidth) CeilTo

func (b Bandwidth) CeilTo(pre sdk.Int) Bandwidth

func (*Bandwidth) Descriptor added in v0.6.0

func (*Bandwidth) Descriptor() ([]byte, []int)

func (Bandwidth) IsAllLTE added in v0.3.0

func (b Bandwidth) IsAllLTE(v Bandwidth) bool

func (Bandwidth) IsAllPositive added in v0.6.0

func (b Bandwidth) IsAllPositive() bool

func (Bandwidth) IsAllZero added in v0.3.0

func (b Bandwidth) IsAllZero() bool

func (Bandwidth) IsAnyGT added in v0.3.0

func (b Bandwidth) IsAnyGT(v Bandwidth) bool

func (Bandwidth) IsAnyNegative added in v0.3.0

func (b Bandwidth) IsAnyNegative() bool

func (Bandwidth) IsAnyNil added in v0.11.0

func (b Bandwidth) IsAnyNil() bool

func (Bandwidth) IsAnyZero added in v0.3.0

func (b Bandwidth) IsAnyZero() bool

func (*Bandwidth) Marshal added in v0.6.0

func (m *Bandwidth) Marshal() (dAtA []byte, err error)

func (*Bandwidth) MarshalTo added in v0.6.0

func (m *Bandwidth) MarshalTo(dAtA []byte) (int, error)

func (*Bandwidth) MarshalToSizedBuffer added in v0.6.0

func (m *Bandwidth) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Bandwidth) ProtoMessage added in v0.6.0

func (*Bandwidth) ProtoMessage()

func (*Bandwidth) Reset added in v0.6.0

func (m *Bandwidth) Reset()

func (*Bandwidth) Size added in v0.6.0

func (m *Bandwidth) Size() (n int)

func (*Bandwidth) String

func (m *Bandwidth) String() string

func (Bandwidth) Sub

func (b Bandwidth) Sub(v Bandwidth) Bandwidth

func (Bandwidth) Sum

func (b Bandwidth) Sum() sdk.Int

func (*Bandwidth) Unmarshal added in v0.6.0

func (m *Bandwidth) Unmarshal(dAtA []byte) error

func (*Bandwidth) XXX_DiscardUnknown added in v0.6.0

func (m *Bandwidth) XXX_DiscardUnknown()

func (*Bandwidth) XXX_Marshal added in v0.6.0

func (m *Bandwidth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Bandwidth) XXX_Merge added in v0.6.0

func (m *Bandwidth) XXX_Merge(src proto.Message)

func (*Bandwidth) XXX_Size added in v0.6.0

func (m *Bandwidth) XXX_Size() int

func (*Bandwidth) XXX_Unmarshal added in v0.6.0

func (m *Bandwidth) XXX_Unmarshal(b []byte) error

type Config added in v0.3.0

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

func GetConfig added in v0.3.0

func GetConfig() *Config

func (*Config) GetBech32NodeAddrPrefix added in v0.3.0

func (c *Config) GetBech32NodeAddrPrefix() string

func (*Config) GetBech32NodePubPrefix added in v0.3.0

func (c *Config) GetBech32NodePubPrefix() string

func (*Config) GetBech32ProviderAddrPrefix added in v0.3.0

func (c *Config) GetBech32ProviderAddrPrefix() string

func (*Config) GetBech32ProviderPubPrefix added in v0.3.0

func (c *Config) GetBech32ProviderPubPrefix() string

func (*Config) Seal added in v0.3.0

func (c *Config) Seal()

func (*Config) SetBech32PrefixForNode added in v0.3.0

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

func (*Config) SetBech32PrefixForProvider added in v0.3.0

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

type NodeAddress added in v0.3.0

type NodeAddress []byte

func NodeAddressFromBech32 added in v0.3.0

func NodeAddressFromBech32(str string) (NodeAddress, error)

func (NodeAddress) Bytes added in v0.3.0

func (n NodeAddress) Bytes() []byte

func (NodeAddress) Empty added in v0.3.0

func (n NodeAddress) Empty() bool

func (NodeAddress) Equals added in v0.3.0

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

func (NodeAddress) Format added in v0.3.0

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

func (NodeAddress) Marshal added in v0.3.0

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

func (NodeAddress) MarshalJSON added in v0.3.0

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

func (NodeAddress) MarshalYAML added in v0.3.0

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

func (NodeAddress) String added in v0.3.0

func (n NodeAddress) String() string

func (*NodeAddress) Unmarshal added in v0.3.0

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

func (*NodeAddress) UnmarshalJSON added in v0.3.0

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

func (*NodeAddress) UnmarshalYAML added in v0.3.0

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

type ProvAddress added in v0.3.0

type ProvAddress []byte

func ProvAddressFromBech32 added in v0.3.0

func ProvAddressFromBech32(str string) (ProvAddress, error)

func (ProvAddress) Bytes added in v0.3.0

func (p ProvAddress) Bytes() []byte

func (ProvAddress) Empty added in v0.3.0

func (p ProvAddress) Empty() bool

func (ProvAddress) Equals added in v0.3.0

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

func (ProvAddress) Format added in v0.3.0

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

func (ProvAddress) Marshal added in v0.3.0

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

func (ProvAddress) MarshalJSON added in v0.3.0

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

func (ProvAddress) MarshalYAML added in v0.3.0

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

func (ProvAddress) String added in v0.3.0

func (p ProvAddress) String() string

func (*ProvAddress) Unmarshal added in v0.3.0

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

func (*ProvAddress) UnmarshalJSON added in v0.3.0

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

func (*ProvAddress) UnmarshalYAML added in v0.3.0

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

type Status added in v0.3.0

type Status int32
const (
	StatusUnspecified     Status = 0
	StatusActive          Status = 1
	StatusInactivePending Status = 2
	StatusInactive        Status = 3
)

func StatusFromFlags added in v0.11.0

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

func StatusFromString added in v0.3.0

func StatusFromString(s string) Status

func (Status) EnumDescriptor added in v0.6.0

func (Status) EnumDescriptor() ([]byte, []int)

func (Status) Equal added in v0.3.0

func (s Status) Equal(v Status) bool

func (Status) IsOneOf added in v0.11.0

func (s Status) IsOneOf(items ...Status) bool

func (Status) IsValid added in v0.3.0

func (s Status) IsValid() bool

func (Status) String added in v0.3.0

func (s Status) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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