-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconstants.go
More file actions
144 lines (129 loc) · 6.66 KB
/
Copy pathconstants.go
File metadata and controls
144 lines (129 loc) · 6.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package common
import "time"
// DefaultDirPermission represents the default directory permissions
const DefaultDirPermission = 0750
// FileModeUserReadWrite represents the permission for a file which allows the user for reading and writing
const FileModeUserReadWrite = 0600
// BaseOperationCost represents the field name for base operation costs
const BaseOperationCost = "BaseOperationCost"
// BuiltInCost represents the field name for built-in operation costs
const BuiltInCost = "BuiltInCost"
// BaseOpsAPICost represents the field name of the SC API (EEI) gas costs
const BaseOpsAPICost = "BaseOpsAPICost"
// MaxPerTransaction represents the field name of max counts per transaction in block chain hook
const MaxPerTransaction = "MaxPerTransaction"
const EmptyJSonMarshalData = "{}"
// Error receipt field constants for consistent error tracking in transaction receipts.
// These are used as the first parameter in ctx.Receipts().AddError(contractID, field, reason)
// to identify which field/aspect of a transaction caused the error.
const (
// Account/Transfer errors
ErrFieldAddressNotPayable = "AddressNotPayable"
ErrFieldAssetPaused = "AssetPaused"
ErrFieldTransferNotAllowed = "TransferNotAllowed"
ErrFieldUninitializedContract = "UninitializedContract"
ErrFieldInvalidAddress = "InvalidAddress"
ErrFieldInvalidToAddress = "InvalidToAddress"
ErrFieldSameAddress = "SameAddress"
ErrFieldInvalidAmount = "InvalidAmount"
ErrFieldInsufficientFunds = "InsufficientFunds"
ErrFieldLoadSenderAccount = "LoadSenderAccount"
ErrFieldLoadReceiverAccount = "LoadReceiverAccount"
ErrFieldKAppError = "KAppError"
ErrFieldBalanceError = "BalanceError"
ErrFieldFreezeError = "FreezeError"
ErrFieldUnfreezeError = "UnfreezeError"
ErrFieldDelegateError = "DelegateError"
ErrFieldUndelegateError = "UndelegateError"
ErrFieldSaveAccountError = "SaveAccountError"
ErrFieldStakingError = "StakingError"
ErrFieldClaimError = "ClaimError"
ErrFieldMaxBucketsExceeded = "MaxBucketsExceeded"
ErrFieldInvalidAssetType = "InvalidAssetType"
ErrFieldBucketNotFound = "BucketNotFound"
ErrFieldInvalidBucketID = "InvalidBucketID"
ErrFieldWithdrawNotAvailable = "WithdrawNotAvailable"
ErrFieldClaimNotAvailable = "ClaimNotAvailable"
ErrFieldNoValidClaims = "NoValidClaims"
ErrFieldInvalidName = "InvalidName"
ErrFieldInvalidPermission = "InvalidPermission"
ErrFieldInvalidPermissionSigs = "InvalidPermissionSigners"
// Validator errors
ErrFieldInvalidOwnerAddress = "InvalidOwnerAddress"
ErrFieldInvalidRewardAddress = "InvalidRewardAddress"
ErrFieldInvalidCommission = "InvalidCommission"
ErrFieldInvalidDelegation = "InvalidDelegation"
ErrFieldInvalidBLSKey = "InvalidBLSKey"
ErrFieldBLSKeyAlreadyUsed = "BLSKeyAlreadyUsed"
ErrFieldBLSKeyRevoked = "BLSKeyRevoked"
ErrFieldBLSKeyNotOwned = "BLSKeyNotOwned"
ErrFieldValidatorAlreadySet = "ValidatorAlreadySet"
ErrFieldValidatorNotFound = "ValidatorNotFound"
ErrFieldValidatorJailed = "ValidatorJailed"
ErrFieldUnjailNotAvailable = "UnjailNotAvailable"
ErrFieldInvalidURI = "InvalidURI"
ErrFieldURICountExceeded = "URICountExceeded"
ErrFieldInvalidLogo = "InvalidLogo"
ErrFieldInvalidNodeVersion = "InvalidNodeVersion"
// Proposal errors
ErrFieldInvalidProposal = "InvalidProposal"
ErrFieldInvalidProposalParams = "InvalidProposalParams"
ErrFieldProposalNotActive = "ProposalNotActive"
ErrFieldProposalNotFound = "ProposalNotFound"
ErrFieldInvalidVote = "InvalidVote"
ErrFieldInvalidVoteType = "InvalidVoteType"
ErrFieldInvalidVoteAmount = "InvalidVoteAmount"
ErrFieldMinKFIStakedUnreached = "MinKFIStakedUnreached"
ErrFieldInsufficientFrozenKFI = "InsufficientFrozenKFI"
ErrFieldProposalMaxVoters = "ProposalMaxVoters"
// KDA Asset errors
ErrFieldInvalidAssetParams = "InvalidAssetParams"
ErrFieldInvalidPrecision = "InvalidPrecision"
ErrFieldInvalidSupply = "InvalidSupply"
ErrFieldInvalidRoleAddress = "InvalidRoleAddress"
ErrFieldInvalidStakingType = "InvalidStakingType"
ErrFieldInvalidSplitRoyalties = "InvalidSplitRoyalties"
ErrFieldAssetCannotMint = "AssetCannotMint"
ErrFieldAssetCannotBurn = "AssetCannotBurn"
ErrFieldAssetCannotWipe = "AssetCannotWipe"
ErrFieldAssetCannotPause = "AssetCannotPause"
ErrFieldAssetCannotFreeze = "AssetCannotFreeze"
ErrFieldAssetMintStopped = "AssetMintStopped"
ErrFieldAssetOwnerCantBeChanged = "AssetOwnerCantBeChanged"
ErrFieldAssetCantAddRoles = "AssetCantAddRoles"
ErrFieldRoleLimitReached = "RoleLimitReached"
ErrFieldRoyaltiesChangeStopped = "RoyaltiesChangeStopped"
ErrFieldNFTMintStopped = "NFTMintStopped"
ErrFieldNFTMetadataChangeStopped = "NFTMetadataChangeStopped"
ErrFieldInvalidTriggerType = "InvalidTriggerType"
ErrFieldInvalidAssetID = "InvalidAssetID"
ErrFieldMissingDepositRole = "MissingDepositRole"
ErrFieldMaxDepositKDAsExceeded = "MaxDepositKDAsExceeded"
// ITO/Market errors
ErrFieldInvalidPacks = "InvalidPacks"
ErrFieldInvalidPrice = "InvalidPrice"
ErrFieldPriceBelowMinimum = "PriceBelowMinimum"
ErrFieldInvalidOrder = "InvalidOrder"
ErrFieldOrderIDMissing = "OrderIDMissing"
ErrFieldOrderCurrencyInvalid = "OrderCurrencyInvalid"
ErrFieldOrderExpired = "OrderExpired"
ErrFieldOrderNotFound = "OrderNotFound"
ErrFieldInvalidMarketType = "InvalidMarketType"
ErrFieldBidTooLow = "BidTooLow"
ErrFieldMarketplaceError = "MarketplaceError"
ErrFieldITONotFound = "ITONotFound"
ErrFieldITONotActive = "ITONotActive"
ErrFieldITOTimeWindow = "ITOTimeWindow"
ErrFieldITOConfigError = "ITOConfigError"
ErrFieldMaxSupplyExceeded = "MaxSupplyExceeded"
ErrFieldInvalidRoyalties = "InvalidRoyalties"
ErrFieldInvalidMetadata = "InvalidMetadata"
ErrFieldAssetAlreadyExists = "AssetAlreadyExists"
ErrFieldAssetNotFound = "AssetNotFound"
)
// ExtraDelayForRequestBlockInfo represents the number of seconds to wait since a block has been received and the
// moment when its components,like transactions, would be requested too if they are still missing
const ExtraDelayForRequestBlockInfo = ExtraDelayForBroadcastBlockInfo + time.Second
// ExtraDelayForBroadcastBlockInfo represents the number of seconds to wait since a block has been broadcast and the
// moment when its components,transactions, would be broadcast too
const ExtraDelayForBroadcastBlockInfo = 1 * time.Second