Documentation ¶
Index ¶
- Constants
- type PurchaseValidator
- func (v *PurchaseValidator) NodeSaleExists(ctx context.Context, qtx datagateway.NodeSaleDataGatewayWithTx, ...) (bool, *entity.NodeSale, error)
- func (v *PurchaseValidator) ValidPaidAmount(payload *protobuf.PurchasePayload, deploy *entity.NodeSale, txPaid uint64, ...) (bool, *entity.MetadataEventPurchase)
- func (v *PurchaseValidator) ValidTiers(payload *protobuf.PurchasePayload, deploy *entity.NodeSale) (bool, TierMap)
- func (v *PurchaseValidator) ValidTimestamp(deploy *entity.NodeSale, timestamp time.Time) bool
- func (v *PurchaseValidator) ValidUnpurchasedNodes(ctx context.Context, qtx datagateway.NodeSaleDataGatewayWithTx, ...) (bool, error)
- func (v *PurchaseValidator) VerifySignature(purchase *protobuf.ActionPurchase, deploy *entity.NodeSale) bool
- func (v *PurchaseValidator) WithinLimit(ctx context.Context, qtx datagateway.NodeSaleDataGatewayWithTx, ...) (bool, error)
- func (v *PurchaseValidator) WithinTimeoutBlock(timeOutBlock uint64, blockHeight uint64) bool
- type TierMap
Constants ¶
View Source
const ( DEPLOYID_NOT_FOUND = "Depoloy ID not found." PURCHASE_TIMEOUT = "Purchase timeout." BLOCK_HEIGHT_TIMEOUT = "Block height over timeout block" INVALID_SIGNATURE_FORMAT = "Cannot parse signature." INVALID_SIGNATURE = "Invalid Signature." INVALID_TIER_JSON = "Invalid Tier format" INVALID_NODE_ID = "Invalid NodeId." NODE_ALREADY_PURCHASED = "Some node has been purchased." INVALID_SELLER_ADDR_FORMAT = "Invalid seller address." INVALID_PAYMENT = "Total amount paid less than reported price" INSUFFICIENT_FUND = "Insufficient fund" OVER_LIMIT_PER_ADDR = "Purchase over limit per address." OVER_LIMIT_PER_TIER = "Purchase over limit per tier." )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PurchaseValidator ¶
func New ¶
func New() *PurchaseValidator
func (*PurchaseValidator) NodeSaleExists ¶
func (v *PurchaseValidator) NodeSaleExists(ctx context.Context, qtx datagateway.NodeSaleDataGatewayWithTx, payload *protobuf.PurchasePayload) (bool, *entity.NodeSale, error)
func (*PurchaseValidator) ValidPaidAmount ¶
func (v *PurchaseValidator) ValidPaidAmount( payload *protobuf.PurchasePayload, deploy *entity.NodeSale, txPaid uint64, tiers []protobuf.Tier, buyingTiersCount []uint32, network *chaincfg.Params, ) (bool, *entity.MetadataEventPurchase)
func (*PurchaseValidator) ValidTiers ¶
func (v *PurchaseValidator) ValidTiers( payload *protobuf.PurchasePayload, deploy *entity.NodeSale, ) (bool, TierMap)
func (*PurchaseValidator) ValidTimestamp ¶
func (*PurchaseValidator) ValidUnpurchasedNodes ¶
func (v *PurchaseValidator) ValidUnpurchasedNodes( ctx context.Context, qtx datagateway.NodeSaleDataGatewayWithTx, payload *protobuf.PurchasePayload, ) (bool, error)
func (*PurchaseValidator) VerifySignature ¶
func (v *PurchaseValidator) VerifySignature(purchase *protobuf.ActionPurchase, deploy *entity.NodeSale) bool
func (*PurchaseValidator) WithinLimit ¶
func (v *PurchaseValidator) WithinLimit( ctx context.Context, qtx datagateway.NodeSaleDataGatewayWithTx, payload *protobuf.PurchasePayload, deploy *entity.NodeSale, tiers []protobuf.Tier, buyingTiersCount []uint32, ) (bool, error)
func (*PurchaseValidator) WithinTimeoutBlock ¶
func (v *PurchaseValidator) WithinTimeoutBlock(timeOutBlock uint64, blockHeight uint64) bool
Click to show internal directories.
Click to hide internal directories.