types

package
v12.0.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "lease"
)

Variables

View Source
var (
	ErrInvalidMessage = sdkerrors.Register(ModuleName, 101, "invalid message")

	ErrDuplicateLease        = sdkerrors.Register(ModuleName, 201, "duplicate lease")
	ErrInvalidHours          = sdkerrors.Register(ModuleName, 202, "invalid hours")
	ErrInvalidNodeStatus     = sdkerrors.Register(ModuleName, 203, "invalid node status")
	ErrInvalidProviderStatus = sdkerrors.Register(ModuleName, 204, "invalid provider status")
	ErrInvalidRenewalPolicy  = sdkerrors.Register(ModuleName, 205, "invalid renewal policy")
	ErrLeaseNotFound         = sdkerrors.Register(ModuleName, 206, "lease not found")
	ErrNodeNotFound          = sdkerrors.Register(ModuleName, 207, "node not found")
	ErrPriceNotFound         = sdkerrors.Register(ModuleName, 208, "price not found")
	ErrProviderNotFound      = sdkerrors.Register(ModuleName, 209, "provider not found")
	ErrUnauthorized          = sdkerrors.Register(ModuleName, 210, "unauthorized")
)
View Source
var (
	CountKey                    = []byte{0x00}
	ParamsKey                   = []byte{0x01}
	LeaseKeyPrefix              = []byte{0x10}
	LeaseForNodeKeyPrefix       = []byte{0x11}
	LeaseForProviderKeyPrefix   = []byte{0x12}
	LeaseForInactiveAtKeyPrefix = []byte{0x13}
	LeaseForPayoutAtKeyPrefix   = []byte{0x14}
	LeaseForRenewalAtKeyPrefix  = []byte{0x15}
)

Functions

func GetLeaseForInactiveAtKeyPrefix

func GetLeaseForInactiveAtKeyPrefix(at time.Time) []byte

func GetLeaseForNodeByProviderKeyPrefix

func GetLeaseForNodeByProviderKeyPrefix(nodeAddr base.NodeAddress, provAddr base.ProvAddress) []byte

func GetLeaseForNodeKeyPrefix

func GetLeaseForNodeKeyPrefix(addr base.NodeAddress) []byte

func GetLeaseForPayoutAtKeyPrefix

func GetLeaseForPayoutAtKeyPrefix(at time.Time) []byte

func GetLeaseForProviderKeyPrefix

func GetLeaseForProviderKeyPrefix(addr base.ProvAddress) []byte

func GetLeaseForRenewalAtKeyPrefix

func GetLeaseForRenewalAtKeyPrefix(at time.Time) []byte

func IDFromLeaseForInactiveAtKey

func IDFromLeaseForInactiveAtKey(key []byte) uint64

func IDFromLeaseForNodeByProviderKey

func IDFromLeaseForNodeByProviderKey(key []byte) uint64

func IDFromLeaseForPayoutAtKey

func IDFromLeaseForPayoutAtKey(key []byte) uint64

func IDFromLeaseForProviderKey

func IDFromLeaseForProviderKey(key []byte) uint64

func IDFromLeaseForRenewalAtKey

func IDFromLeaseForRenewalAtKey(key []byte) uint64

func LeaseForInactiveAtKey

func LeaseForInactiveAtKey(at time.Time, id uint64) []byte

func LeaseForNodeByProviderKey

func LeaseForNodeByProviderKey(nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64) []byte

func LeaseForPayoutAtKey

func LeaseForPayoutAtKey(at time.Time, id uint64) []byte

func LeaseForProviderKey

func LeaseForProviderKey(addr base.ProvAddress, id uint64) []byte

func LeaseForRenewalAtKey

func LeaseForRenewalAtKey(at time.Time, id uint64) []byte

func LeaseKey

func LeaseKey(id uint64) []byte

func NewErrorDuplicateLease

func NewErrorDuplicateLease(nodeAddr base.NodeAddress, provAddr base.ProvAddress) error

NewErrorDuplicateLease returns an error indicating that a lease for the specified node and provider already exists.

func NewErrorInvalidHours

func NewErrorInvalidHours(hours int64) error

NewErrorInvalidHours returns an error indicating that the provided hours are invalid.

func NewErrorInvalidNodeStatus

func NewErrorInvalidNodeStatus(addr base.NodeAddress, status v1base.Status) error

NewErrorInvalidNodeStatus returns an error indicating that the provided status is invalid for the given node.

func NewErrorInvalidProviderStatus

func NewErrorInvalidProviderStatus(addr base.ProvAddress, status v1base.Status) error

NewErrorInvalidProviderStatus returns an error indicating that the provided status is invalid for the given provider.

func NewErrorLeaseNotFound

func NewErrorLeaseNotFound(id uint64) error

NewErrorLeaseNotFound returns an error indicating that the specified lease does not exist.

func NewErrorNodeNotFound

func NewErrorNodeNotFound(addr base.NodeAddress) error

NewErrorNodeNotFound returns an error indicating that the specified node does not exist.

func NewErrorPriceNotFound

func NewErrorPriceNotFound(denom string) error

NewErrorPriceNotFound returns an error indicating that the price for the specified denom does not exist.

func NewErrorProviderNotFound

func NewErrorProviderNotFound(addr base.ProvAddress) error

NewErrorProviderNotFound returns an error indicating that the specified provider does not exist.

func NewErrorUnauthorized

func NewErrorUnauthorized(addr string) error

NewErrorUnauthorized returns an error indicating that the specified address is not authorized.

Types

This section is empty.

Directories

Path Synopsis
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