Documentation ¶
Index ¶
- Constants
- Variables
- func GetLeaseForInactiveAtKeyPrefix(at time.Time) []byte
- func GetLeaseForNodeByProviderKeyPrefix(nodeAddr base.NodeAddress, provAddr base.ProvAddress) []byte
- func GetLeaseForNodeKeyPrefix(addr base.NodeAddress) []byte
- func GetLeaseForPayoutAtKeyPrefix(at time.Time) []byte
- func GetLeaseForProviderKeyPrefix(addr base.ProvAddress) []byte
- func GetLeaseForRenewalAtKeyPrefix(at time.Time) []byte
- func IDFromLeaseForInactiveAtKey(key []byte) uint64
- func IDFromLeaseForNodeByProviderKey(key []byte) uint64
- func IDFromLeaseForPayoutAtKey(key []byte) uint64
- func IDFromLeaseForProviderKey(key []byte) uint64
- func IDFromLeaseForRenewalAtKey(key []byte) uint64
- func LeaseForInactiveAtKey(at time.Time, id uint64) []byte
- func LeaseForNodeByProviderKey(nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64) []byte
- func LeaseForPayoutAtKey(at time.Time, id uint64) []byte
- func LeaseForProviderKey(addr base.ProvAddress, id uint64) []byte
- func LeaseForRenewalAtKey(at time.Time, id uint64) []byte
- func LeaseKey(id uint64) []byte
- func NewErrorDuplicateLease(nodeAddr base.NodeAddress, provAddr base.ProvAddress) error
- func NewErrorInvalidHours(hours int64) error
- func NewErrorInvalidNodeStatus(addr base.NodeAddress, status v1base.Status) error
- func NewErrorInvalidProviderStatus(addr base.ProvAddress, status v1base.Status) error
- func NewErrorLeaseNotFound(id uint64) error
- func NewErrorNodeNotFound(addr base.NodeAddress) error
- func NewErrorPriceNotFound(denom string) error
- func NewErrorProviderNotFound(addr base.ProvAddress) error
- func NewErrorUnauthorized(addr string) error
Constants ¶
const (
ModuleName = "lease"
)
Variables ¶
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") )
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 GetLeaseForNodeByProviderKeyPrefix ¶
func GetLeaseForNodeByProviderKeyPrefix(nodeAddr base.NodeAddress, provAddr base.ProvAddress) []byte
func GetLeaseForNodeKeyPrefix ¶
func GetLeaseForNodeKeyPrefix(addr base.NodeAddress) []byte
func GetLeaseForProviderKeyPrefix ¶
func GetLeaseForProviderKeyPrefix(addr base.ProvAddress) []byte
func LeaseForNodeByProviderKey ¶
func LeaseForNodeByProviderKey(nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64) []byte
func LeaseForProviderKey ¶
func LeaseForProviderKey(addr base.ProvAddress, 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 ¶
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 ¶
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 ¶
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 ¶
NewErrorUnauthorized returns an error indicating that the specified address is not authorized.
Types ¶
This section is empty.