Documentation ¶
Index ¶
- Constants
- Variables
- func AccAddrFromSubscriptionForAccountKey(key []byte) sdk.AccAddress
- func AllocationKey(id uint64, addr sdk.AccAddress) []byte
- func GetAllocationForSubscriptionKeyPrefix(id uint64) []byte
- func GetSubscriptionForAccountKeyPrefix(addr sdk.AccAddress) []byte
- func GetSubscriptionForInactiveAtKeyPrefix(at time.Time) []byte
- func GetSubscriptionForPlanKeyPrefix(id uint64) []byte
- func GetSubscriptionForRenewalAtKeyPrefix(at time.Time) []byte
- func IDFromSubscriptionForAccountKey(key []byte) uint64
- func IDFromSubscriptionForInactiveAtKey(key []byte) uint64
- func IDFromSubscriptionForPlanKey(key []byte) uint64
- func IDFromSubscriptionForRenewalAtKey(key []byte) uint64
- func NewErrorAllocationNotFound(id uint64, addr sdk.AccAddress) error
- func NewErrorInsufficientBytes(id uint64, bytes sdkmath.Int) error
- func NewErrorInvalidAllocation(id uint64, addr sdk.AccAddress) error
- func NewErrorInvalidNodeStatus(addr base.NodeAddress, status v1base.Status) error
- func NewErrorInvalidPlanStatus(id uint64, status v1base.Status) error
- func NewErrorInvalidSessionStatus(id uint64, status v1base.Status) error
- func NewErrorInvalidSubscriptionStatus(id uint64, status v1base.Status) error
- func NewErrorNodeNotFound(addr base.NodeAddress) error
- func NewErrorPlanNotFound(id uint64) error
- func NewErrorPriceNotFound(denom string) error
- func NewErrorSessionNotFound(id uint64) error
- func NewErrorSubscriptionNotFound(id uint64) error
- func NewErrorUnauthorized(addr string) error
- func SubscriptionForAccountKey(addr sdk.AccAddress, id uint64) []byte
- func SubscriptionForInactiveAtKey(at time.Time, id uint64) []byte
- func SubscriptionForPlanKey(planID, subscriptionID uint64) []byte
- func SubscriptionForRenewalAtKey(at time.Time, id uint64) []byte
- func SubscriptionKey(id uint64) []byte
Constants ¶
const (
ModuleName = "subscription"
)
Variables ¶
var ( ErrInvalidMessage = sdkerrors.Register(ModuleName, 101, "invalid message") ErrAllocationNotFound = sdkerrors.Register(ModuleName, 201, "allocation not found") ErrInsufficientBytes = sdkerrors.Register(ModuleName, 202, "insufficient bytes") ErrInvalidAllocation = sdkerrors.Register(ModuleName, 203, "invalid allocation") ErrInvalidNodeStatus = sdkerrors.Register(ModuleName, 204, "invalid node status") ErrInvalidPlanStatus = sdkerrors.Register(ModuleName, 205, "invalid plan status") ErrInvalidRenewalPolicy = sdkerrors.Register(ModuleName, 206, "invalid renewal policy") ErrInvalidSessionStatus = sdkerrors.Register(ModuleName, 207, "invalid session status") ErrInvalidSubscriptionStatus = sdkerrors.Register(ModuleName, 208, "invalid subscription status") ErrNodeNotFound = sdkerrors.Register(ModuleName, 209, "node not found") ErrPlanNotFound = sdkerrors.Register(ModuleName, 210, "plan not found") ErrPriceNotFound = sdkerrors.Register(ModuleName, 211, "price not found") ErrSessionNotFound = sdkerrors.Register(ModuleName, 212, "session not found") ErrSubscriptionNotFound = sdkerrors.Register(ModuleName, 213, "subscription not found") )
var ( CountKey = []byte{0x00} ParamsKey = []byte{0x01} SubscriptionKeyPrefix = []byte{0x10} SubscriptionForAccountKeyPrefix = []byte{0x11} SubscriptionForPlanKeyPrefix = []byte{0x12} SubscriptionForInactiveAtKeyPrefix = []byte{0x13} SubscriptionForRenewalAtKeyPrefix = []byte{0x14} AllocationKeyPrefix = []byte{0x20} )
Functions ¶
func AccAddrFromSubscriptionForAccountKey ¶
func AccAddrFromSubscriptionForAccountKey(key []byte) sdk.AccAddress
func AllocationKey ¶
func AllocationKey(id uint64, addr sdk.AccAddress) []byte
func GetSubscriptionForAccountKeyPrefix ¶
func GetSubscriptionForAccountKeyPrefix(addr sdk.AccAddress) []byte
func NewErrorAllocationNotFound ¶
func NewErrorAllocationNotFound(id uint64, addr sdk.AccAddress) error
NewErrorAllocationNotFound returns an error indicating that the specified allocation does not exist.
func NewErrorInsufficientBytes ¶
NewErrorInsufficientBytes returns an error indicating that there are insufficient bytes for the specified subscription.
func NewErrorInvalidAllocation ¶
func NewErrorInvalidAllocation(id uint64, addr sdk.AccAddress) error
NewErrorInvalidAllocation returns an error indicating that the allocation is 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 node.
func NewErrorInvalidPlanStatus ¶
NewErrorInvalidPlanStatus returns an error indicating that the provided status is invalid for the plan.
func NewErrorInvalidSessionStatus ¶
NewErrorInvalidSessionStatus returns an error indicating that the provided status is invalid for the session.
func NewErrorInvalidSubscriptionStatus ¶
NewErrorInvalidSubscriptionStatus returns an error indicating that the provided status is invalid for the subscription.
func NewErrorNodeNotFound ¶
func NewErrorNodeNotFound(addr base.NodeAddress) error
NewErrorNodeNotFound returns an error indicating that the specified node does not exist.
func NewErrorPlanNotFound ¶
NewErrorPlanNotFound returns an error indicating that the specified plan does not exist.
func NewErrorPriceNotFound ¶
NewErrorPriceNotFound returns an error indicating that the price for the specified denomination does not exist.
func NewErrorSessionNotFound ¶
NewErrorSessionNotFound returns an error indicating that the specified session does not exist.
func NewErrorSubscriptionNotFound ¶
NewErrorSubscriptionNotFound returns an error indicating that the specified subscription does not exist.
func NewErrorUnauthorized ¶
NewErrorUnauthorized returns an error indicating that the specified address is not authorized.
func SubscriptionForAccountKey ¶
func SubscriptionForAccountKey(addr sdk.AccAddress, id uint64) []byte
func SubscriptionForPlanKey ¶
func SubscriptionKey ¶
Types ¶
This section is empty.