@dashevo/wasm-dpp 4.2.0-dev.9 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wasm/wasm_dpp.d.ts +3845 -2470
- package/dist/wasm/wasm_dpp.js +707 -79
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/lib/wasm/wasm_dpp.d.ts +3845 -2470
- package/package.json +2 -2
- package/src/data_contract/state_transition/data_contract_create_transition/mod.rs +8 -3
- package/src/data_contract/state_transition/data_contract_update_transition/mod.rs +8 -3
- package/src/document/factory.rs +1 -1
- package/src/document/state_transition/batch_transition/mod.rs +6 -1
- package/src/document/state_transition/batch_transition/token_transition/claim.rs +1 -0
- package/src/document/state_transition/batch_transition/token_transition/mod.rs +41 -14
- package/src/errors/consensus/basic/identity/contract_group_bound_key_not_allowed_in_shielded_identity_creation_error.rs +36 -0
- package/src/errors/consensus/basic/identity/mod.rs +2 -0
- package/src/errors/consensus/consensus_error.rs +403 -4
- package/src/errors/consensus/deserialize.rs +2 -2
- package/src/errors/consensus/signature/contract_bounded_key_non_batch_error.rs +29 -0
- package/src/errors/consensus/signature/contract_bounded_key_out_of_bounds_error.rs +29 -0
- package/src/errors/consensus/signature/mod.rs +6 -0
- package/src/identity/identity.rs +3 -2
- package/src/identity/identity_public_key/mod.rs +3 -2
- package/src/identity/mod.rs +1 -1
- package/src/identity/state_transition/identity_update_transition/transition.rs +5 -1
- package/src/state_transition/state_transition_factory.rs +12 -0
- package/src/utils.rs +2 -2
- package/src/validation/validation_result.rs +0 -8
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +3 -1
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/DataContractUpdateTransition.spec.js +3 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
use super::signature::ContractBoundedKeyNonBatchErrorWasm;
|
|
2
|
+
use super::signature::ContractBoundedKeyOutOfBoundsErrorWasm;
|
|
3
|
+
use crate::errors::consensus::basic::identity::ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationErrorWasm;
|
|
1
4
|
use crate::errors::consensus::basic::{
|
|
2
5
|
IncompatibleProtocolVersionErrorWasm, InvalidIdentifierErrorWasm,
|
|
3
6
|
InvalidSignaturePublicKeyPurposeErrorWasm, JsonSchemaErrorWasm,
|
|
@@ -34,6 +37,7 @@ use crate::errors::consensus::state::identity::{
|
|
|
34
37
|
};
|
|
35
38
|
use dpp::consensus::basic::decode::VersionError;
|
|
36
39
|
use dpp::consensus::basic::BasicError::{
|
|
40
|
+
ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError,
|
|
37
41
|
DuplicatedIdentityPublicKeyBasicError, DuplicatedIdentityPublicKeyIdBasicError,
|
|
38
42
|
IdentityAssetLockProofLockedTransactionMismatchError,
|
|
39
43
|
IdentityAssetLockStateTransitionReplayError, IdentityAssetLockTransactionIsNotFoundError,
|
|
@@ -62,27 +66,87 @@ use dpp::consensus::state::data_trigger::DataTriggerError::{
|
|
|
62
66
|
DataTriggerConditionError, DataTriggerExecutionError, DataTriggerInvalidResultError,
|
|
63
67
|
};
|
|
64
68
|
use wasm_bindgen::{JsError, JsValue};
|
|
65
|
-
use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError,
|
|
66
|
-
use dpp::consensus::basic::document::{ContestedDocumentsTemporarilyNotAllowedError, DocumentCreationNotAllowedError, DocumentFieldMaxSizeExceededError, MaxDocumentsTransitionsExceededError, MissingPositionsInDocumentTypePropertiesError};
|
|
69
|
+
use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError, ContestedUniqueIndexWithUniqueIndexError, DataContractInvalidRequiredFieldsUpdateError, DataContractTokenConfigurationUpdateError, DecimalsOverLimitError, DuplicateKeywordsError, GroupExceedsMaxMembersError, GroupHasTooFewMembersError, GroupMemberHasPowerOfZeroError, GroupMemberHasPowerOverLimitError, GroupNonUnilateralMemberPowerHasLessThanRequiredPowerError, GroupPositionDoesNotExistError, GroupRequiredPowerIsInvalidError, GroupTotalPowerLessThanRequiredError, InvalidDescriptionLengthError, InvalidDocumentTypeRequiredSecurityLevelError, InvalidKeywordCharacterError, InvalidKeywordLengthError, InvalidTokenBaseSupplyError, InvalidTokenDistributionFunctionDivideByZeroError, InvalidTokenDistributionFunctionIncoherenceError, InvalidTokenDistributionFunctionInvalidParameterError, InvalidTokenDistributionFunctionInvalidParameterTupleError, InvalidTokenLanguageCodeError, InvalidTokenNameCharacterError, InvalidTokenNameLengthError, MainGroupIsNotDefinedError, NewTokensDestinationIdentityOptionRequiredError, NonContiguousContractGroupPositionsError, NonContiguousContractTokenPositionsError, PreProgrammedDistributionAmountOverLimitError, RedundantDocumentPaidForByTokenWithContractId, TokenPaymentByBurningOnlyAllowedOnInternalTokenError, TokenShieldedPoolIncompatibleRulesError, TooManyKeywordsError, UnknownDocumentActionTokenEffectError, UnknownDocumentCreationRestrictionModeError, UnknownGasFeesPaidByError, UnknownSecurityLevelError, UnknownStorageKeyRequirementsError, UnknownTradeModeError, UnknownTransferableTypeError};
|
|
70
|
+
use dpp::consensus::basic::document::{ContestedDocumentsTemporarilyNotAllowedError, DocumentCreationNotAllowedError, DocumentFieldMaxSizeExceededError, DocumentPropertyConstraintViolatedError, DocumentPropertyMaxBytesExceededError, DocumentPropertyNotDistinctError, DocumentPropertyNotGeneratedError, DocumentReferencePreimageInvalidError, InvalidEncryptedPropertyShapeError, MaxDocumentsTransitionsExceededError, MissingPositionsInDocumentTypePropertiesError};
|
|
67
71
|
use dpp::consensus::basic::group::GroupActionNotAllowedOnTransitionError;
|
|
68
72
|
use dpp::consensus::basic::identity::{DataContractBoundsNotPresentError, DisablingKeyIdAlsoBeingAddedInSameTransitionError, InvalidIdentityCreditWithdrawalTransitionAmountError, InvalidIdentityUpdateTransitionDisableKeysError, InvalidIdentityUpdateTransitionEmptyError, InvalidKeyPurposeForContractBoundsError, TooManyMasterPublicKeyError, WithdrawalOutputScriptNotAllowedWhenSigningWithOwnerKeyError};
|
|
69
73
|
use dpp::consensus::basic::overflow_error::OverflowError;
|
|
70
|
-
use dpp::consensus::basic::token::{ChoosingTokenMintRecipientNotAllowedError, ContractHasNoTokensError, DestinationIdentityForTokenMintingNotSetError, InvalidActionIdError, InvalidTokenAmountError, InvalidTokenConfigUpdateNoChangeError, InvalidTokenIdError, InvalidTokenNoteTooBigError, InvalidTokenPositionError, MissingDefaultLocalizationError, TokenNoteOnlyAllowedWhenProposerError, TokenPricingScheduleEmptyError, TokenTransferToOurselfError, InvalidTokenDistributionTimeIntervalNotMinuteAlignedError, InvalidTokenDistributionTimeIntervalTooShortError, InvalidTokenDistributionBlockIntervalTooShortError};
|
|
74
|
+
use dpp::consensus::basic::token::{ChoosingTokenMintRecipientNotAllowedError, ContractHasNoTokensError, DestinationIdentityForTokenMintingNotSetError, InvalidActionIdError, InvalidTokenAmountError, InvalidTokenConfigUpdateNoChangeError, InvalidTokenIdError, InvalidTokenNoteTooBigError, InvalidTokenPositionError, MissingDefaultLocalizationError, TokenNoteOnlyAllowedWhenProposerError, TokenPricingScheduleEmptyError, TokenTransferToOurselfError, InvalidTokenDistributionTimeIntervalNotMinuteAlignedError, InvalidTokenDistributionTimeIntervalTooShortError, InvalidTokenDistributionBlockIntervalTooShortError, InvalidTokenDistributionEpochIntervalTooShortError, InvalidTokenOncePerIdentityDistributionAmountError};
|
|
71
75
|
use dpp::consensus::state::data_contract::data_contract_not_found_error::DataContractNotFoundError;
|
|
72
76
|
use dpp::consensus::state::data_contract::data_contract_update_action_not_allowed_error::DataContractUpdateActionNotAllowedError;
|
|
73
77
|
use dpp::consensus::state::data_contract::document_type_update_error::DocumentTypeUpdateError;
|
|
74
78
|
use dpp::consensus::state::document::document_contest_currently_locked_error::DocumentContestCurrentlyLockedError;
|
|
75
79
|
use dpp::consensus::state::document::document_contest_document_with_same_id_already_present_error::DocumentContestDocumentWithSameIdAlreadyPresentError;
|
|
76
80
|
use dpp::consensus::state::document::document_contest_identity_already_contestant::DocumentContestIdentityAlreadyContestantError;
|
|
81
|
+
use dpp::consensus::state::document::document_contest_maximum_contenders_reached_error::DocumentContestMaximumContendersReachedError;
|
|
82
|
+
use dpp::consensus::state::document::referenced_document_requirement_not_met_error::ReferencedDocumentRequirementNotMetError;
|
|
83
|
+
use dpp::consensus::state::document::referenced_document_removed_error::ReferencedDocumentRemovedError;
|
|
84
|
+
use dpp::consensus::state::document::referenced_document_type_moderated_error::ReferencedDocumentTypeModeratedError;
|
|
85
|
+
use dpp::consensus::state::document::referenced_document_type_index_only_error::ReferencedDocumentTypeIndexOnlyError;
|
|
86
|
+
use dpp::consensus::state::document::referenced_document_type_not_moderated_error::ReferencedDocumentTypeNotModeratedError;
|
|
77
87
|
use dpp::consensus::state::document::document_contest_index_mismatch_error::DocumentContestIndexMismatchError;
|
|
78
88
|
use dpp::consensus::state::document::document_contest_not_joinable_error::DocumentContestNotJoinableError;
|
|
79
89
|
use dpp::consensus::state::document::document_contest_not_paid_for_error::DocumentContestNotPaidForError;
|
|
80
90
|
use dpp::consensus::state::document::document_contest_not_required_error::DocumentContestNotRequiredError;
|
|
81
91
|
use dpp::consensus::state::document::document_incorrect_purchase_price_error::DocumentIncorrectPurchasePriceError;
|
|
82
92
|
use dpp::consensus::state::document::document_not_for_sale_error::DocumentNotForSaleError;
|
|
93
|
+
use dpp::consensus::basic::contract_group::{
|
|
94
|
+
ContractGroupMemberNotInContractError, ContractGroupMembershipsOverLimitError,
|
|
95
|
+
DuplicateContractGroupMembershipError,
|
|
96
|
+
InvalidContractGroupDescriptionLengthError, InvalidContractGroupNameLengthError,
|
|
97
|
+
InvalidContractGroupAdminsError, RedundantContractGroupMembershipError,
|
|
98
|
+
};
|
|
99
|
+
use dpp::consensus::basic::contract_moderation::{
|
|
100
|
+
ContractModerationReasonTooLongError, InvalidContractModerationDocumentFieldsError,
|
|
101
|
+
InvalidContractModerationReasonDocumentsError, ContractModerationSelfTargetError,
|
|
102
|
+
DocumentActionFeesWithoutModerationError,
|
|
103
|
+
InvalidContractModerationConfigError,
|
|
104
|
+
};
|
|
105
|
+
use dpp::consensus::basic::moderation_charter::{
|
|
106
|
+
ModerationCharterMalformedFieldError, ModerationCharterRewardSplitNotOneHundredError,
|
|
107
|
+
};
|
|
108
|
+
use dpp::consensus::state::contract_moderation::{
|
|
109
|
+
ContractFeeClaimNotAllowedError, ContractFeesAlreadyClaimedThisEpochError,
|
|
110
|
+
ContractFeesNothingToClaimError, ContractModeratedDocumentTypeNotYetUsableError,
|
|
111
|
+
ContractModerationAbilityNotGrantedError, ContractModerationTeamNotSeatedError,
|
|
112
|
+
DocumentNotSettledError, DocumentTypeNotDeletableOnceSettledError,
|
|
113
|
+
ModerationCharterAddedModeratorLimitReachedError, ModerationReasonNotListedError,
|
|
114
|
+
ContractTeamActionAlreadyCompletedError, ContractTeamActionAlreadySignedError,
|
|
115
|
+
ContractTeamActionDocumentChangedError, ContractTeamActionDoesNotExistError,
|
|
116
|
+
ContractTeamMemberAddedAfterDocumentError,
|
|
117
|
+
SettledDeletionNotRestorableError,
|
|
118
|
+
ContractModerationNotEnabledError, ContractModerationTargetNotAllowedError,
|
|
119
|
+
ContractModerationCounterpartyBarredError, ContractModerationTargetNotFoundError,
|
|
120
|
+
ContractModeratorIdentityNotFoundError,
|
|
121
|
+
ContractSuspensionNotInFutureError,
|
|
122
|
+
ContractUserAlreadyBannedError, ContractUserBannedError, ContractUserNotBannedError,
|
|
123
|
+
ContractUserNotSuspendedError, ContractUserNotWarnedError, ContractUserSuspendedError,
|
|
124
|
+
ContractUserWarningLimitReachedError, ContractDocumentAlreadyRestoredError,
|
|
125
|
+
ContractDocumentRemovalNotFoundError, DocumentFieldNotChangeableByModeratorsError,
|
|
126
|
+
DocumentModerationWindowElapsedError, DocumentModeratorFieldNotWritableError,
|
|
127
|
+
DocumentRestoreHashMismatchError, DocumentRestoreWindowElapsedError,
|
|
128
|
+
DocumentTypeNotDeletableByModeratorsError, IdentityNotContractModeratorError,
|
|
129
|
+
};
|
|
130
|
+
use dpp::consensus::state::contract_group::{
|
|
131
|
+
ContractGroupAdminNotFoundError, ContractGroupAlreadyExistsError, ContractGroupNotFoundError,
|
|
132
|
+
IdentityNotContractGroupOwnerOrAdminError,
|
|
133
|
+
};
|
|
83
134
|
use dpp::consensus::state::group::{GroupActionAlreadyCompletedError, GroupActionAlreadySignedByIdentityError, GroupActionDoesNotExistError, IdentityMemberOfGroupNotFoundError, IdentityNotMemberOfGroupError, ModificationOfGroupActionMainParametersNotPermittedError};
|
|
84
135
|
use dpp::consensus::state::identity::identity_for_token_configuration_not_found_error::IdentityInTokenConfigurationNotFoundError;
|
|
85
136
|
use dpp::consensus::state::identity::identity_public_key_already_exists_for_unique_contract_bounds_error::IdentityPublicKeyAlreadyExistsForUniqueContractBoundsError;
|
|
137
|
+
use dpp::consensus::basic::identity::{
|
|
138
|
+
IdentityKeyLimitsUpdateEmptyError, IdentityPublicKeyLimitsNotAllowedError,
|
|
139
|
+
IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError,
|
|
140
|
+
InvalidIdentityPublicKeyBudgetError,
|
|
141
|
+
};
|
|
142
|
+
use dpp::consensus::signature::{
|
|
143
|
+
PublicKeyBudgetExhaustedError, PublicKeyExpiredError,
|
|
144
|
+
PublicKeyWithLimitsCannotUpdateKeyLimitsError,
|
|
145
|
+
};
|
|
146
|
+
use dpp::consensus::state::identity::identity_public_key_already_expired_error::IdentityPublicKeyAlreadyExpiredError;
|
|
147
|
+
use dpp::consensus::state::identity::identity_public_key_limit_not_raised_error::IdentityPublicKeyLimitNotRaisedError;
|
|
148
|
+
use dpp::consensus::state::identity::identity_public_key_limit_not_set_error::IdentityPublicKeyLimitNotSetError;
|
|
149
|
+
use dpp::consensus::state::identity::identity_public_key_budget_exceeded_error::IdentityPublicKeyBudgetExceededError;
|
|
86
150
|
use dpp::consensus::state::identity::identity_to_freeze_does_not_exist_error::IdentityToFreezeDoesNotExistError;
|
|
87
151
|
use dpp::consensus::state::identity::master_public_key_update_error::MasterPublicKeyUpdateError;
|
|
88
152
|
use dpp::consensus::state::identity::missing_transfer_key_error::MissingTransferKeyError;
|
|
@@ -90,13 +154,21 @@ use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_availab
|
|
|
90
154
|
use dpp::consensus::state::identity::RecipientIdentityDoesNotExistError;
|
|
91
155
|
use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError;
|
|
92
156
|
use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError;
|
|
93
|
-
use dpp::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountNotFrozenError, IdentityTokenAccountFrozenError, TokenIsPausedError, IdentityTokenAccountAlreadyFrozenError, UnauthorizedTokenActionError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, TokenMintPastMaxSupplyError, NewTokensDestinationIdentityDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, InvalidGroupPositionError, TokenAlreadyPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, TokenTransferRecipientIdentityNotExistError, PreProgrammedDistributionTimestampInPastError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError, TokenDirectPurchaseUserPriceTooLow, TokenAmountUnderMinimumSaleAmount, TokenNotForDirectSale, InvalidTokenPositionStateError};
|
|
157
|
+
use dpp::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountNotFrozenError, IdentityTokenAccountFrozenError, TokenIsPausedError, IdentityTokenAccountAlreadyFrozenError, UnauthorizedTokenActionError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, TokenMintPastMaxSupplyError, NewTokensDestinationIdentityDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, InvalidGroupPositionError, TokenAlreadyPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, TokenTransferRecipientIdentityNotExistError, PreProgrammedDistributionTimestampInPastError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError, TokenDirectPurchaseUserPriceTooLow, TokenAmountUnderMinimumSaleAmount, TokenNotForDirectSale, InvalidTokenPositionStateError, TokenOncePerIdentityDistributionAlreadyClaimedError, TokenShieldedPoolNotEnabledError, TokenShieldedPaymentAmountMismatchError, TokenShieldedPaymentNotRequiredError, GasFeesPaidByNotAllowedError, InconsistentGasFeesPaidByInBatchError};
|
|
94
158
|
use dpp::consensus::state::address_funds::{AddressDoesNotExistError, AddressInvalidNonceError, AddressNotEnoughFundsError, AddressesNotEnoughFundsError};
|
|
95
159
|
use dpp::consensus::state::document::referenced_document_type_deletable_error::ReferencedDocumentTypeDeletableError;
|
|
160
|
+
use dpp::consensus::state::document::referenced_document_type_not_deletable_error::ReferencedDocumentTypeNotDeletableError;
|
|
96
161
|
use dpp::consensus::state::document::referenced_identity_key_disabled_error::ReferencedIdentityKeyDisabledError;
|
|
97
162
|
use dpp::consensus::state::document::referenced_identity_key_not_found_error::ReferencedIdentityKeyNotFoundError;
|
|
98
163
|
use dpp::consensus::state::document::referenced_document_property_agreement_invalid_error::ReferencedDocumentPropertyAgreementInvalidError;
|
|
99
164
|
use dpp::consensus::state::document::referenced_document_property_mismatch_error::ReferencedDocumentPropertyMismatchError;
|
|
165
|
+
use dpp::consensus::state::document::document_immutable_property_changed_error::DocumentImmutablePropertyChangedError;
|
|
166
|
+
use dpp::consensus::state::identity::gas_sponsor_insufficient_balance_error::GasSponsorInsufficientBalanceError;
|
|
167
|
+
use dpp::consensus::state::document::document_action_fee_agreement_mismatch_error::DocumentActionFeeAgreementMismatchError;
|
|
168
|
+
use dpp::consensus::state::document::document_action_fee_moderators_share_mismatch_error::DocumentActionFeeModeratorsShareMismatchError;
|
|
169
|
+
use dpp::consensus::state::document::document_expired_error::DocumentExpiredError;
|
|
170
|
+
use dpp::consensus::state::document::document_action_fee_agreement_not_set_error::DocumentActionFeeAgreementNotSetError;
|
|
171
|
+
use dpp::consensus::state::document::document_action_fee_multiplier_not_tolerated_error::DocumentActionFeeMultiplierNotToleratedError;
|
|
100
172
|
use dpp::consensus::state::document::referenced_key_id_property_invalid_error::ReferencedKeyIdPropertyInvalidError;
|
|
101
173
|
use dpp::consensus::state::document::referenced_document_type_not_found_error::ReferencedDocumentTypeNotFoundError;
|
|
102
174
|
use dpp::consensus::state::shielded::insufficient_pool_notes_error::InsufficientPoolNotesError;
|
|
@@ -105,12 +177,17 @@ use dpp::consensus::state::shielded::invalid_anchor_error::InvalidAnchorError;
|
|
|
105
177
|
use dpp::consensus::state::shielded::invalid_shielded_proof_error::InvalidShieldedProofError;
|
|
106
178
|
use dpp::consensus::state::shielded::nullifier_already_spent_error::NullifierAlreadySpentError;
|
|
107
179
|
use dpp::consensus::basic::state_transition::{StateTransitionNotActiveError, TransitionOverMaxInputsError, TransitionOverMaxOutputsError, InputWitnessCountMismatchError, TransitionNoInputsError, TransitionNoOutputsError, FeeStrategyEmptyError, FeeStrategyDuplicateError, FeeStrategyIndexOutOfBoundsError, FeeStrategyTooManyStepsError, InputBelowMinimumError, OutputBelowMinimumError, InputOutputBalanceMismatchError, OutputsNotGreaterThanInputsError, WithdrawalBalanceMismatchError, InsufficientFundingAmountError, InputsNotLessThanOutputsError, OutputAddressAlsoInputError, InvalidRemainderOutputCountError, WithdrawalBelowMinAmountError, ShieldedNoActionsError, ShieldedTooManyActionsError, ShieldedEmptyProofError, ShieldedZeroAnchorError, ShieldedInvalidValueBalanceError, ShieldedEncryptedNoteSizeMismatchError, ShieldedImplicitFeeCapExceededError, ShieldedInvalidDenominationError};
|
|
180
|
+
use dpp::consensus::state::document::referenced_contract_requirement_not_met_error::ReferencedContractRequirementNotMetError;
|
|
181
|
+
use dpp::consensus::state::document::referenced_identity_key_requirement_not_met_error::ReferencedIdentityKeyRequirementNotMetError;
|
|
182
|
+
use dpp::consensus::state::document::referenced_document_lookup_invalid_error::ReferencedDocumentLookupInvalidError;
|
|
183
|
+
use dpp::consensus::state::document::referenced_document_list_invalid_error::ReferencedDocumentListInvalidError;
|
|
108
184
|
use dpp::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError;
|
|
109
185
|
use dpp::consensus::state::voting::masternode_incorrect_voting_address_error::MasternodeIncorrectVotingAddressError;
|
|
110
186
|
use dpp::consensus::state::voting::masternode_not_found_error::MasternodeNotFoundError;
|
|
111
187
|
use dpp::consensus::state::voting::masternode_vote_already_present_error::MasternodeVoteAlreadyPresentError;
|
|
112
188
|
use dpp::consensus::state::voting::masternode_voted_too_many_times::MasternodeVotedTooManyTimesError;
|
|
113
189
|
use dpp::consensus::state::voting::vote_poll_not_available_for_voting_error::VotePollNotAvailableForVotingError;
|
|
190
|
+
use dpp::consensus::state::voting::vote_choice_not_allowed_for_vote_poll_error::VoteChoiceNotAllowedForVotePollError;
|
|
114
191
|
use dpp::consensus::state::voting::vote_poll_not_found_error::VotePollNotFoundError;
|
|
115
192
|
|
|
116
193
|
use crate::errors::consensus::basic::data_contract::{
|
|
@@ -435,6 +512,15 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
|
|
|
435
512
|
StateError::TokenNotForDirectSale(e) => {
|
|
436
513
|
generic_consensus_error!(TokenNotForDirectSale, e).into()
|
|
437
514
|
}
|
|
515
|
+
StateError::TokenShieldedPoolNotEnabledError(e) => {
|
|
516
|
+
generic_consensus_error!(TokenShieldedPoolNotEnabledError, e).into()
|
|
517
|
+
}
|
|
518
|
+
StateError::TokenShieldedPaymentAmountMismatchError(e) => {
|
|
519
|
+
generic_consensus_error!(TokenShieldedPaymentAmountMismatchError, e).into()
|
|
520
|
+
}
|
|
521
|
+
StateError::TokenShieldedPaymentNotRequiredError(e) => {
|
|
522
|
+
generic_consensus_error!(TokenShieldedPaymentNotRequiredError, e).into()
|
|
523
|
+
}
|
|
438
524
|
StateError::IdentityInTokenConfigurationNotFoundError(e) => {
|
|
439
525
|
generic_consensus_error!(IdentityInTokenConfigurationNotFoundError, e).into()
|
|
440
526
|
}
|
|
@@ -503,6 +589,210 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
|
|
|
503
589
|
StateError::ReferencedDocumentPropertyMismatchError(e) => {
|
|
504
590
|
generic_consensus_error!(ReferencedDocumentPropertyMismatchError, e).into()
|
|
505
591
|
}
|
|
592
|
+
StateError::ContractGroupAlreadyExistsError(e) => {
|
|
593
|
+
generic_consensus_error!(ContractGroupAlreadyExistsError, e).into()
|
|
594
|
+
}
|
|
595
|
+
StateError::ContractGroupNotFoundError(e) => {
|
|
596
|
+
generic_consensus_error!(ContractGroupNotFoundError, e).into()
|
|
597
|
+
}
|
|
598
|
+
StateError::IdentityNotContractGroupOwnerOrAdminError(e) => {
|
|
599
|
+
generic_consensus_error!(IdentityNotContractGroupOwnerOrAdminError, e).into()
|
|
600
|
+
}
|
|
601
|
+
StateError::ContractGroupAdminNotFoundError(e) => {
|
|
602
|
+
generic_consensus_error!(ContractGroupAdminNotFoundError, e).into()
|
|
603
|
+
}
|
|
604
|
+
StateError::IdentityPublicKeyBudgetExceededError(e) => {
|
|
605
|
+
generic_consensus_error!(IdentityPublicKeyBudgetExceededError, e).into()
|
|
606
|
+
}
|
|
607
|
+
StateError::IdentityPublicKeyAlreadyExpiredError(e) => {
|
|
608
|
+
generic_consensus_error!(IdentityPublicKeyAlreadyExpiredError, e).into()
|
|
609
|
+
}
|
|
610
|
+
StateError::IdentityPublicKeyLimitNotSetError(e) => {
|
|
611
|
+
generic_consensus_error!(IdentityPublicKeyLimitNotSetError, e).into()
|
|
612
|
+
}
|
|
613
|
+
StateError::IdentityPublicKeyLimitNotRaisedError(e) => {
|
|
614
|
+
generic_consensus_error!(IdentityPublicKeyLimitNotRaisedError, e).into()
|
|
615
|
+
}
|
|
616
|
+
StateError::DocumentImmutablePropertyChangedError(e) => {
|
|
617
|
+
generic_consensus_error!(DocumentImmutablePropertyChangedError, e).into()
|
|
618
|
+
}
|
|
619
|
+
StateError::TokenOncePerIdentityDistributionAlreadyClaimedError(e) => {
|
|
620
|
+
generic_consensus_error!(TokenOncePerIdentityDistributionAlreadyClaimedError, e).into()
|
|
621
|
+
}
|
|
622
|
+
StateError::GasFeesPaidByNotAllowedError(e) => {
|
|
623
|
+
generic_consensus_error!(GasFeesPaidByNotAllowedError, e).into()
|
|
624
|
+
}
|
|
625
|
+
StateError::InconsistentGasFeesPaidByInBatchError(e) => {
|
|
626
|
+
generic_consensus_error!(InconsistentGasFeesPaidByInBatchError, e).into()
|
|
627
|
+
}
|
|
628
|
+
StateError::DocumentActionFeeAgreementNotSetError(e) => {
|
|
629
|
+
generic_consensus_error!(DocumentActionFeeAgreementNotSetError, e).into()
|
|
630
|
+
}
|
|
631
|
+
StateError::DocumentActionFeeAgreementMismatchError(e) => {
|
|
632
|
+
generic_consensus_error!(DocumentActionFeeAgreementMismatchError, e).into()
|
|
633
|
+
}
|
|
634
|
+
StateError::DocumentActionFeeMultiplierNotToleratedError(e) => {
|
|
635
|
+
generic_consensus_error!(DocumentActionFeeMultiplierNotToleratedError, e).into()
|
|
636
|
+
}
|
|
637
|
+
StateError::GasSponsorInsufficientBalanceError(e) => {
|
|
638
|
+
generic_consensus_error!(GasSponsorInsufficientBalanceError, e).into()
|
|
639
|
+
}
|
|
640
|
+
StateError::ContractModerationNotEnabledError(e) => {
|
|
641
|
+
generic_consensus_error!(ContractModerationNotEnabledError, e).into()
|
|
642
|
+
}
|
|
643
|
+
StateError::IdentityNotContractModeratorError(e) => {
|
|
644
|
+
generic_consensus_error!(IdentityNotContractModeratorError, e).into()
|
|
645
|
+
}
|
|
646
|
+
StateError::ContractModerationTargetNotAllowedError(e) => {
|
|
647
|
+
generic_consensus_error!(ContractModerationTargetNotAllowedError, e).into()
|
|
648
|
+
}
|
|
649
|
+
StateError::ContractUserAlreadyBannedError(e) => {
|
|
650
|
+
generic_consensus_error!(ContractUserAlreadyBannedError, e).into()
|
|
651
|
+
}
|
|
652
|
+
StateError::ContractUserNotBannedError(e) => {
|
|
653
|
+
generic_consensus_error!(ContractUserNotBannedError, e).into()
|
|
654
|
+
}
|
|
655
|
+
StateError::ContractUserNotSuspendedError(e) => {
|
|
656
|
+
generic_consensus_error!(ContractUserNotSuspendedError, e).into()
|
|
657
|
+
}
|
|
658
|
+
StateError::ContractSuspensionNotInFutureError(e) => {
|
|
659
|
+
generic_consensus_error!(ContractSuspensionNotInFutureError, e).into()
|
|
660
|
+
}
|
|
661
|
+
StateError::ContractUserBannedError(e) => {
|
|
662
|
+
generic_consensus_error!(ContractUserBannedError, e).into()
|
|
663
|
+
}
|
|
664
|
+
StateError::ContractUserSuspendedError(e) => {
|
|
665
|
+
generic_consensus_error!(ContractUserSuspendedError, e).into()
|
|
666
|
+
}
|
|
667
|
+
StateError::ContractModerationTargetNotFoundError(e) => {
|
|
668
|
+
generic_consensus_error!(ContractModerationTargetNotFoundError, e).into()
|
|
669
|
+
}
|
|
670
|
+
StateError::ContractModeratorIdentityNotFoundError(e) => {
|
|
671
|
+
generic_consensus_error!(ContractModeratorIdentityNotFoundError, e).into()
|
|
672
|
+
}
|
|
673
|
+
StateError::ContractModerationCounterpartyBarredError(e) => {
|
|
674
|
+
generic_consensus_error!(ContractModerationCounterpartyBarredError, e).into()
|
|
675
|
+
}
|
|
676
|
+
StateError::ContractFeesAlreadyClaimedThisEpochError(e) => {
|
|
677
|
+
generic_consensus_error!(ContractFeesAlreadyClaimedThisEpochError, e).into()
|
|
678
|
+
}
|
|
679
|
+
StateError::ContractFeesNothingToClaimError(e) => {
|
|
680
|
+
generic_consensus_error!(ContractFeesNothingToClaimError, e).into()
|
|
681
|
+
}
|
|
682
|
+
StateError::ContractFeeClaimNotAllowedError(e) => {
|
|
683
|
+
generic_consensus_error!(ContractFeeClaimNotAllowedError, e).into()
|
|
684
|
+
}
|
|
685
|
+
StateError::ReferencedDocumentTypeNotDeletableError(e) => {
|
|
686
|
+
generic_consensus_error!(ReferencedDocumentTypeNotDeletableError, e).into()
|
|
687
|
+
}
|
|
688
|
+
StateError::DocumentTypeNotDeletableByModeratorsError(e) => {
|
|
689
|
+
generic_consensus_error!(DocumentTypeNotDeletableByModeratorsError, e).into()
|
|
690
|
+
}
|
|
691
|
+
StateError::DocumentModerationWindowElapsedError(e) => {
|
|
692
|
+
generic_consensus_error!(DocumentModerationWindowElapsedError, e).into()
|
|
693
|
+
}
|
|
694
|
+
StateError::ContractDocumentRemovalNotFoundError(e) => {
|
|
695
|
+
generic_consensus_error!(ContractDocumentRemovalNotFoundError, e).into()
|
|
696
|
+
}
|
|
697
|
+
StateError::DocumentRestoreWindowElapsedError(e) => {
|
|
698
|
+
generic_consensus_error!(DocumentRestoreWindowElapsedError, e).into()
|
|
699
|
+
}
|
|
700
|
+
StateError::DocumentRestoreHashMismatchError(e) => {
|
|
701
|
+
generic_consensus_error!(DocumentRestoreHashMismatchError, e).into()
|
|
702
|
+
}
|
|
703
|
+
StateError::ContractDocumentAlreadyRestoredError(e) => {
|
|
704
|
+
generic_consensus_error!(ContractDocumentAlreadyRestoredError, e).into()
|
|
705
|
+
}
|
|
706
|
+
StateError::ContractUserNotWarnedError(e) => {
|
|
707
|
+
generic_consensus_error!(ContractUserNotWarnedError, e).into()
|
|
708
|
+
}
|
|
709
|
+
StateError::ContractUserWarningLimitReachedError(e) => {
|
|
710
|
+
generic_consensus_error!(ContractUserWarningLimitReachedError, e).into()
|
|
711
|
+
}
|
|
712
|
+
StateError::ContractModeratedDocumentTypeNotYetUsableError(e) => {
|
|
713
|
+
generic_consensus_error!(ContractModeratedDocumentTypeNotYetUsableError, e).into()
|
|
714
|
+
}
|
|
715
|
+
StateError::VoteChoiceNotAllowedForVotePollError(e) => {
|
|
716
|
+
generic_consensus_error!(VoteChoiceNotAllowedForVotePollError, e).into()
|
|
717
|
+
}
|
|
718
|
+
StateError::ReferencedContractRequirementNotMetError(e) => {
|
|
719
|
+
generic_consensus_error!(ReferencedContractRequirementNotMetError, e).into()
|
|
720
|
+
}
|
|
721
|
+
StateError::ReferencedIdentityKeyRequirementNotMetError(e) => {
|
|
722
|
+
generic_consensus_error!(ReferencedIdentityKeyRequirementNotMetError, e).into()
|
|
723
|
+
}
|
|
724
|
+
StateError::ReferencedDocumentLookupInvalidError(e) => {
|
|
725
|
+
generic_consensus_error!(ReferencedDocumentLookupInvalidError, e).into()
|
|
726
|
+
}
|
|
727
|
+
StateError::ReferencedDocumentListInvalidError(e) => {
|
|
728
|
+
generic_consensus_error!(ReferencedDocumentListInvalidError, e).into()
|
|
729
|
+
}
|
|
730
|
+
StateError::ContractModerationAbilityNotGrantedError(e) => {
|
|
731
|
+
generic_consensus_error!(ContractModerationAbilityNotGrantedError, e).into()
|
|
732
|
+
}
|
|
733
|
+
StateError::ModerationCharterAddedModeratorLimitReachedError(e) => {
|
|
734
|
+
generic_consensus_error!(ModerationCharterAddedModeratorLimitReachedError, e).into()
|
|
735
|
+
}
|
|
736
|
+
StateError::ModerationReasonNotListedError(e) => {
|
|
737
|
+
generic_consensus_error!(ModerationReasonNotListedError, e).into()
|
|
738
|
+
}
|
|
739
|
+
StateError::DocumentTypeNotDeletableOnceSettledError(e) => {
|
|
740
|
+
generic_consensus_error!(DocumentTypeNotDeletableOnceSettledError, e).into()
|
|
741
|
+
}
|
|
742
|
+
StateError::ContractModerationTeamNotSeatedError(e) => {
|
|
743
|
+
generic_consensus_error!(ContractModerationTeamNotSeatedError, e).into()
|
|
744
|
+
}
|
|
745
|
+
StateError::DocumentNotSettledError(e) => {
|
|
746
|
+
generic_consensus_error!(DocumentNotSettledError, e).into()
|
|
747
|
+
}
|
|
748
|
+
StateError::ContractTeamActionDoesNotExistError(e) => {
|
|
749
|
+
generic_consensus_error!(ContractTeamActionDoesNotExistError, e).into()
|
|
750
|
+
}
|
|
751
|
+
StateError::ContractTeamActionAlreadySignedError(e) => {
|
|
752
|
+
generic_consensus_error!(ContractTeamActionAlreadySignedError, e).into()
|
|
753
|
+
}
|
|
754
|
+
StateError::SettledDeletionNotRestorableError(e) => {
|
|
755
|
+
generic_consensus_error!(SettledDeletionNotRestorableError, e).into()
|
|
756
|
+
}
|
|
757
|
+
StateError::ContractTeamActionAlreadyCompletedError(e) => {
|
|
758
|
+
generic_consensus_error!(ContractTeamActionAlreadyCompletedError, e).into()
|
|
759
|
+
}
|
|
760
|
+
StateError::ContractTeamActionDocumentChangedError(e) => {
|
|
761
|
+
generic_consensus_error!(ContractTeamActionDocumentChangedError, e).into()
|
|
762
|
+
}
|
|
763
|
+
StateError::ContractTeamMemberAddedAfterDocumentError(e) => {
|
|
764
|
+
generic_consensus_error!(ContractTeamMemberAddedAfterDocumentError, e).into()
|
|
765
|
+
}
|
|
766
|
+
StateError::DocumentActionFeeModeratorsShareMismatchError(e) => {
|
|
767
|
+
generic_consensus_error!(DocumentActionFeeModeratorsShareMismatchError, e).into()
|
|
768
|
+
}
|
|
769
|
+
StateError::DocumentExpiredError(e) => {
|
|
770
|
+
generic_consensus_error!(DocumentExpiredError, e).into()
|
|
771
|
+
}
|
|
772
|
+
StateError::DocumentContestMaximumContendersReachedError(e) => {
|
|
773
|
+
generic_consensus_error!(DocumentContestMaximumContendersReachedError, e).into()
|
|
774
|
+
}
|
|
775
|
+
StateError::DocumentFieldNotChangeableByModeratorsError(e) => {
|
|
776
|
+
generic_consensus_error!(DocumentFieldNotChangeableByModeratorsError, e).into()
|
|
777
|
+
}
|
|
778
|
+
StateError::DocumentModeratorFieldNotWritableError(e) => {
|
|
779
|
+
generic_consensus_error!(DocumentModeratorFieldNotWritableError, e).into()
|
|
780
|
+
}
|
|
781
|
+
StateError::ReferencedDocumentRequirementNotMetError(e) => {
|
|
782
|
+
generic_consensus_error!(ReferencedDocumentRequirementNotMetError, e).into()
|
|
783
|
+
}
|
|
784
|
+
StateError::ReferencedDocumentTypeNotModeratedError(e) => {
|
|
785
|
+
generic_consensus_error!(ReferencedDocumentTypeNotModeratedError, e).into()
|
|
786
|
+
}
|
|
787
|
+
StateError::ReferencedDocumentTypeModeratedError(e) => {
|
|
788
|
+
generic_consensus_error!(ReferencedDocumentTypeModeratedError, e).into()
|
|
789
|
+
}
|
|
790
|
+
StateError::ReferencedDocumentRemovedError(e) => {
|
|
791
|
+
generic_consensus_error!(ReferencedDocumentRemovedError, e).into()
|
|
792
|
+
}
|
|
793
|
+
StateError::ReferencedDocumentTypeIndexOnlyError(e) => {
|
|
794
|
+
generic_consensus_error!(ReferencedDocumentTypeIndexOnlyError, e).into()
|
|
795
|
+
}
|
|
506
796
|
}
|
|
507
797
|
}
|
|
508
798
|
|
|
@@ -659,6 +949,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
659
949
|
IdentityAssetLockTransactionTooManyInputsError(e) => {
|
|
660
950
|
IdentityAssetLockTransactionTooManyInputsErrorWasm::from(e).into()
|
|
661
951
|
}
|
|
952
|
+
ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError(e) => {
|
|
953
|
+
ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationErrorWasm::from(e).into()
|
|
954
|
+
}
|
|
662
955
|
InvalidInstantAssetLockProofError(e) => {
|
|
663
956
|
InvalidInstantAssetLockProofErrorWasm::from(e).into()
|
|
664
957
|
}
|
|
@@ -756,6 +1049,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
756
1049
|
BasicError::DocumentFieldMaxSizeExceededError(e) => {
|
|
757
1050
|
generic_consensus_error!(DocumentFieldMaxSizeExceededError, e).into()
|
|
758
1051
|
}
|
|
1052
|
+
BasicError::DocumentPropertyNotDistinctError(e) => {
|
|
1053
|
+
generic_consensus_error!(DocumentPropertyNotDistinctError, e).into()
|
|
1054
|
+
}
|
|
759
1055
|
BasicError::ContestedUniqueIndexWithUniqueIndexError(e) => {
|
|
760
1056
|
generic_consensus_error!(ContestedUniqueIndexWithUniqueIndexError, e).into()
|
|
761
1057
|
}
|
|
@@ -917,6 +1213,12 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
917
1213
|
generic_consensus_error!(InvalidTokenDistributionTimeIntervalNotMinuteAlignedError, e)
|
|
918
1214
|
.into()
|
|
919
1215
|
}
|
|
1216
|
+
BasicError::InvalidTokenDistributionEpochIntervalTooShortError(e) => {
|
|
1217
|
+
generic_consensus_error!(InvalidTokenDistributionEpochIntervalTooShortError, e).into()
|
|
1218
|
+
}
|
|
1219
|
+
BasicError::InvalidTokenOncePerIdentityDistributionAmountError(e) => {
|
|
1220
|
+
generic_consensus_error!(InvalidTokenOncePerIdentityDistributionAmountError, e).into()
|
|
1221
|
+
}
|
|
920
1222
|
BasicError::RedundantDocumentPaidForByTokenWithContractId(e) => {
|
|
921
1223
|
generic_consensus_error!(RedundantDocumentPaidForByTokenWithContractId, e).into()
|
|
922
1224
|
}
|
|
@@ -1016,6 +1318,88 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
1016
1318
|
BasicError::DataContractInvalidRequiredFieldsUpdateError(e) => {
|
|
1017
1319
|
generic_consensus_error!(DataContractInvalidRequiredFieldsUpdateError, e).into()
|
|
1018
1320
|
}
|
|
1321
|
+
BasicError::ContractGroupMembershipsOverLimitError(e) => {
|
|
1322
|
+
generic_consensus_error!(ContractGroupMembershipsOverLimitError, e).into()
|
|
1323
|
+
}
|
|
1324
|
+
BasicError::DuplicateContractGroupMembershipError(e) => {
|
|
1325
|
+
generic_consensus_error!(DuplicateContractGroupMembershipError, e).into()
|
|
1326
|
+
}
|
|
1327
|
+
BasicError::RedundantContractGroupMembershipError(e) => {
|
|
1328
|
+
generic_consensus_error!(RedundantContractGroupMembershipError, e).into()
|
|
1329
|
+
}
|
|
1330
|
+
BasicError::ContractGroupMemberNotInContractError(e) => {
|
|
1331
|
+
generic_consensus_error!(ContractGroupMemberNotInContractError, e).into()
|
|
1332
|
+
}
|
|
1333
|
+
BasicError::InvalidContractGroupAdminsError(e) => {
|
|
1334
|
+
generic_consensus_error!(InvalidContractGroupAdminsError, e).into()
|
|
1335
|
+
}
|
|
1336
|
+
BasicError::InvalidContractGroupNameLengthError(e) => {
|
|
1337
|
+
generic_consensus_error!(InvalidContractGroupNameLengthError, e).into()
|
|
1338
|
+
}
|
|
1339
|
+
BasicError::InvalidContractGroupDescriptionLengthError(e) => {
|
|
1340
|
+
generic_consensus_error!(InvalidContractGroupDescriptionLengthError, e).into()
|
|
1341
|
+
}
|
|
1342
|
+
BasicError::IdentityPublicKeyLimitsNotAllowedError(e) => {
|
|
1343
|
+
generic_consensus_error!(IdentityPublicKeyLimitsNotAllowedError, e).into()
|
|
1344
|
+
}
|
|
1345
|
+
BasicError::InvalidIdentityPublicKeyBudgetError(e) => {
|
|
1346
|
+
generic_consensus_error!(InvalidIdentityPublicKeyBudgetError, e).into()
|
|
1347
|
+
}
|
|
1348
|
+
BasicError::IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError(e) => {
|
|
1349
|
+
generic_consensus_error!(
|
|
1350
|
+
IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError,
|
|
1351
|
+
e
|
|
1352
|
+
)
|
|
1353
|
+
.into()
|
|
1354
|
+
}
|
|
1355
|
+
BasicError::IdentityKeyLimitsUpdateEmptyError(e) => {
|
|
1356
|
+
generic_consensus_error!(IdentityKeyLimitsUpdateEmptyError, e).into()
|
|
1357
|
+
}
|
|
1358
|
+
BasicError::PreProgrammedDistributionAmountOverLimitError(e) => {
|
|
1359
|
+
generic_consensus_error!(PreProgrammedDistributionAmountOverLimitError, e).into()
|
|
1360
|
+
}
|
|
1361
|
+
BasicError::InvalidContractModerationConfigError(e) => {
|
|
1362
|
+
generic_consensus_error!(InvalidContractModerationConfigError, e).into()
|
|
1363
|
+
}
|
|
1364
|
+
BasicError::ContractModerationSelfTargetError(e) => {
|
|
1365
|
+
generic_consensus_error!(ContractModerationSelfTargetError, e).into()
|
|
1366
|
+
}
|
|
1367
|
+
BasicError::DocumentActionFeesWithoutModerationError(e) => {
|
|
1368
|
+
generic_consensus_error!(DocumentActionFeesWithoutModerationError, e).into()
|
|
1369
|
+
}
|
|
1370
|
+
BasicError::ContractModerationReasonTooLongError(e) => {
|
|
1371
|
+
generic_consensus_error!(ContractModerationReasonTooLongError, e).into()
|
|
1372
|
+
}
|
|
1373
|
+
BasicError::ModerationCharterMalformedFieldError(e) => {
|
|
1374
|
+
generic_consensus_error!(ModerationCharterMalformedFieldError, e).into()
|
|
1375
|
+
}
|
|
1376
|
+
BasicError::ModerationCharterRewardSplitNotOneHundredError(e) => {
|
|
1377
|
+
generic_consensus_error!(ModerationCharterRewardSplitNotOneHundredError, e).into()
|
|
1378
|
+
}
|
|
1379
|
+
BasicError::InvalidContractModerationReasonDocumentsError(e) => {
|
|
1380
|
+
generic_consensus_error!(InvalidContractModerationReasonDocumentsError, e).into()
|
|
1381
|
+
}
|
|
1382
|
+
BasicError::InvalidEncryptedPropertyShapeError(e) => {
|
|
1383
|
+
generic_consensus_error!(InvalidEncryptedPropertyShapeError, e).into()
|
|
1384
|
+
}
|
|
1385
|
+
BasicError::DocumentPropertyMaxBytesExceededError(e) => {
|
|
1386
|
+
generic_consensus_error!(DocumentPropertyMaxBytesExceededError, e).into()
|
|
1387
|
+
}
|
|
1388
|
+
BasicError::DocumentPropertyConstraintViolatedError(e) => {
|
|
1389
|
+
generic_consensus_error!(DocumentPropertyConstraintViolatedError, e).into()
|
|
1390
|
+
}
|
|
1391
|
+
BasicError::DocumentPropertyNotGeneratedError(e) => {
|
|
1392
|
+
generic_consensus_error!(DocumentPropertyNotGeneratedError, e).into()
|
|
1393
|
+
}
|
|
1394
|
+
BasicError::InvalidContractModerationDocumentFieldsError(e) => {
|
|
1395
|
+
generic_consensus_error!(InvalidContractModerationDocumentFieldsError, e).into()
|
|
1396
|
+
}
|
|
1397
|
+
BasicError::DocumentReferencePreimageInvalidError(e) => {
|
|
1398
|
+
generic_consensus_error!(DocumentReferencePreimageInvalidError, e).into()
|
|
1399
|
+
}
|
|
1400
|
+
BasicError::TokenShieldedPoolIncompatibleRulesError(e) => {
|
|
1401
|
+
generic_consensus_error!(TokenShieldedPoolIncompatibleRulesError, e).into()
|
|
1402
|
+
}
|
|
1019
1403
|
}
|
|
1020
1404
|
}
|
|
1021
1405
|
|
|
@@ -1049,9 +1433,24 @@ fn from_signature_error(signature_error: &SignatureError) -> JsValue {
|
|
|
1049
1433
|
SignatureError::InvalidSignaturePublicKeyPurposeError(err) => {
|
|
1050
1434
|
InvalidSignaturePublicKeyPurposeErrorWasm::from(err).into()
|
|
1051
1435
|
}
|
|
1436
|
+
SignatureError::ContractBoundedKeyNonBatchError(err) => {
|
|
1437
|
+
ContractBoundedKeyNonBatchErrorWasm::from(err).into()
|
|
1438
|
+
}
|
|
1439
|
+
SignatureError::ContractBoundedKeyOutOfBoundsError(err) => {
|
|
1440
|
+
ContractBoundedKeyOutOfBoundsErrorWasm::from(err).into()
|
|
1441
|
+
}
|
|
1052
1442
|
SignatureError::UncompressedPublicKeyNotAllowedError(err) => {
|
|
1053
1443
|
UncompressedPublicKeyNotAllowedErrorWasm::from(err).into()
|
|
1054
1444
|
}
|
|
1445
|
+
SignatureError::PublicKeyBudgetExhaustedError(e) => {
|
|
1446
|
+
generic_consensus_error!(PublicKeyBudgetExhaustedError, e).into()
|
|
1447
|
+
}
|
|
1448
|
+
SignatureError::PublicKeyExpiredError(e) => {
|
|
1449
|
+
generic_consensus_error!(PublicKeyExpiredError, e).into()
|
|
1450
|
+
}
|
|
1451
|
+
SignatureError::PublicKeyWithLimitsCannotUpdateKeyLimitsError(e) => {
|
|
1452
|
+
generic_consensus_error!(PublicKeyWithLimitsCannotUpdateKeyLimitsError, e).into()
|
|
1453
|
+
}
|
|
1055
1454
|
}
|
|
1056
1455
|
}
|
|
1057
1456
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
use crate::errors::consensus::consensus_error::from_consensus_error;
|
|
2
2
|
use dpp::consensus::ConsensusError;
|
|
3
|
-
use dpp::serialization::
|
|
3
|
+
use dpp::serialization::PlatformDeserializableUntrusted;
|
|
4
4
|
use wasm_bindgen::prelude::wasm_bindgen;
|
|
5
5
|
use wasm_bindgen::{JsError, JsValue};
|
|
6
6
|
|
|
7
7
|
#[wasm_bindgen(js_name=deserializeConsensusError)]
|
|
8
8
|
pub fn deserialize_consensus_error(bytes: Vec<u8>) -> Result<JsValue, JsError> {
|
|
9
|
-
ConsensusError::
|
|
9
|
+
ConsensusError::deserialize_from_bytes_untrusted(bytes.as_slice())
|
|
10
10
|
.map(from_consensus_error)
|
|
11
11
|
.map_err(|e| e.into())
|
|
12
12
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
use dpp::consensus::codes::ErrorWithCode;
|
|
2
|
+
use dpp::consensus::signature::ContractBoundedKeyNonBatchError;
|
|
3
|
+
use dpp::consensus::ConsensusError;
|
|
4
|
+
|
|
5
|
+
use wasm_bindgen::prelude::*;
|
|
6
|
+
|
|
7
|
+
#[wasm_bindgen(js_name=ContractBoundedKeyNonBatchError)]
|
|
8
|
+
pub struct ContractBoundedKeyNonBatchErrorWasm {
|
|
9
|
+
inner: ContractBoundedKeyNonBatchError,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl From<&ContractBoundedKeyNonBatchError> for ContractBoundedKeyNonBatchErrorWasm {
|
|
13
|
+
fn from(e: &ContractBoundedKeyNonBatchError) -> Self {
|
|
14
|
+
Self { inner: e.clone() }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#[wasm_bindgen(js_class=ContractBoundedKeyNonBatchError)]
|
|
19
|
+
impl ContractBoundedKeyNonBatchErrorWasm {
|
|
20
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
21
|
+
pub fn get_code(&self) -> u32 {
|
|
22
|
+
ConsensusError::from(self.inner.clone()).code()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#[wasm_bindgen(getter)]
|
|
26
|
+
pub fn message(&self) -> String {
|
|
27
|
+
self.inner.to_string()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
use dpp::consensus::codes::ErrorWithCode;
|
|
2
|
+
use dpp::consensus::signature::ContractBoundedKeyOutOfBoundsError;
|
|
3
|
+
use dpp::consensus::ConsensusError;
|
|
4
|
+
|
|
5
|
+
use wasm_bindgen::prelude::*;
|
|
6
|
+
|
|
7
|
+
#[wasm_bindgen(js_name=ContractBoundedKeyOutOfBoundsError)]
|
|
8
|
+
pub struct ContractBoundedKeyOutOfBoundsErrorWasm {
|
|
9
|
+
inner: ContractBoundedKeyOutOfBoundsError,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl From<&ContractBoundedKeyOutOfBoundsError> for ContractBoundedKeyOutOfBoundsErrorWasm {
|
|
13
|
+
fn from(e: &ContractBoundedKeyOutOfBoundsError) -> Self {
|
|
14
|
+
Self { inner: e.clone() }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#[wasm_bindgen(js_class=ContractBoundedKeyOutOfBoundsError)]
|
|
19
|
+
impl ContractBoundedKeyOutOfBoundsErrorWasm {
|
|
20
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
21
|
+
pub fn get_code(&self) -> u32 {
|
|
22
|
+
ConsensusError::from(self.inner.clone()).code()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#[wasm_bindgen(getter)]
|
|
26
|
+
pub fn message(&self) -> String {
|
|
27
|
+
self.inner.to_string()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -9,3 +9,9 @@ pub use basic_ecdsa_error::*;
|
|
|
9
9
|
pub use identity_not_found_error::*;
|
|
10
10
|
pub use signature_should_not_be_present_error::*;
|
|
11
11
|
pub use uncompressed_public_key_not_allowed_error::*;
|
|
12
|
+
|
|
13
|
+
mod contract_bounded_key_non_batch_error;
|
|
14
|
+
pub use contract_bounded_key_non_batch_error::ContractBoundedKeyNonBatchErrorWasm;
|
|
15
|
+
|
|
16
|
+
mod contract_bounded_key_out_of_bounds_error;
|
|
17
|
+
pub use contract_bounded_key_out_of_bounds_error::ContractBoundedKeyOutOfBoundsErrorWasm;
|
package/src/identity/identity.rs
CHANGED
|
@@ -10,7 +10,7 @@ use dpp::identity::identity_public_key::accessors::v0::IdentityPublicKeyGettersV
|
|
|
10
10
|
use dpp::identity::{Identity, IdentityPublicKey, KeyID};
|
|
11
11
|
use dpp::metadata::Metadata;
|
|
12
12
|
use dpp::platform_value::ReplacementType;
|
|
13
|
-
use dpp::serialization::
|
|
13
|
+
use dpp::serialization::PlatformDeserializableUntrusted;
|
|
14
14
|
use dpp::serialization::PlatformSerializable;
|
|
15
15
|
use dpp::serialization::ValueConvertible;
|
|
16
16
|
use dpp::version::PlatformVersion;
|
|
@@ -267,7 +267,8 @@ impl IdentityWasm {
|
|
|
267
267
|
#[wasm_bindgen(js_name=fromBuffer)]
|
|
268
268
|
pub fn from_buffer(buffer: Vec<u8>) -> Result<IdentityWasm, JsValue> {
|
|
269
269
|
let identity: Identity =
|
|
270
|
-
|
|
270
|
+
PlatformDeserializableUntrusted::deserialize_from_bytes_untrusted(buffer.as_slice())
|
|
271
|
+
.with_js_error()?;
|
|
271
272
|
Ok(identity.into())
|
|
272
273
|
}
|
|
273
274
|
}
|
|
@@ -11,7 +11,7 @@ use dpp::identity::identity_public_key::accessors::v0::{
|
|
|
11
11
|
use dpp::identity::identity_public_key::hash::IdentityPublicKeyHashMethodsV0;
|
|
12
12
|
use dpp::identity::{IdentityPublicKey, KeyID, TimestampMillis};
|
|
13
13
|
use dpp::platform_value::{BinaryData, ReplacementType};
|
|
14
|
-
use dpp::serialization::{
|
|
14
|
+
use dpp::serialization::{PlatformDeserializableUntrusted, PlatformSerializable, ValueConvertible};
|
|
15
15
|
use dpp::ProtocolError;
|
|
16
16
|
|
|
17
17
|
use dpp::version::PlatformVersion;
|
|
@@ -196,7 +196,8 @@ impl IdentityPublicKeyWasm {
|
|
|
196
196
|
#[wasm_bindgen(js_name=fromBuffer)]
|
|
197
197
|
pub fn from_buffer(buffer: Vec<u8>) -> Result<IdentityPublicKeyWasm, JsValue> {
|
|
198
198
|
let key: IdentityPublicKey =
|
|
199
|
-
|
|
199
|
+
PlatformDeserializableUntrusted::deserialize_from_bytes_untrusted(buffer.as_slice())
|
|
200
|
+
.with_js_error()?;
|
|
200
201
|
Ok(key.into())
|
|
201
202
|
}
|
|
202
203
|
}
|