@dashevo/wasm-dpp 4.2.0-dev.9 → 5.0.0-beta.1

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.
Files changed (23) hide show
  1. package/dist/wasm/wasm_dpp.d.ts +4480 -3190
  2. package/dist/wasm/wasm_dpp.js +679 -87
  3. package/dist/wasm/wasm_dpp_bg.js +1 -1
  4. package/lib/wasm/wasm_dpp.d.ts +4480 -3190
  5. package/package.json +2 -2
  6. package/src/data_contract/state_transition/data_contract_create_transition/mod.rs +3 -2
  7. package/src/data_contract/state_transition/data_contract_update_transition/mod.rs +3 -2
  8. package/src/document/state_transition/batch_transition/token_transition/claim.rs +1 -0
  9. package/src/errors/consensus/basic/identity/contract_group_bound_key_not_allowed_in_shielded_identity_creation_error.rs +36 -0
  10. package/src/errors/consensus/basic/identity/mod.rs +2 -0
  11. package/src/errors/consensus/consensus_error.rs +384 -4
  12. package/src/errors/consensus/deserialize.rs +2 -2
  13. package/src/errors/consensus/signature/contract_bounded_key_non_batch_error.rs +29 -0
  14. package/src/errors/consensus/signature/contract_bounded_key_out_of_bounds_error.rs +29 -0
  15. package/src/errors/consensus/signature/mod.rs +6 -0
  16. package/src/identity/identity.rs +3 -2
  17. package/src/identity/identity_public_key/mod.rs +3 -2
  18. package/src/identity/mod.rs +1 -1
  19. package/src/state_transition/state_transition_factory.rs +9 -0
  20. package/src/utils.rs +2 -2
  21. package/src/validation/validation_result.rs +0 -8
  22. package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +3 -1
  23. package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/DataContractUpdateTransition.spec.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/wasm-dpp",
3
- "version": "4.2.0-dev.9",
3
+ "version": "5.0.0-beta.1",
4
4
  "description": "The JavaScript implementation of the Dash Platform Protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "@babel/core": "^7.26.10",
45
45
  "@babel/preset-env": "^7.26.9",
46
46
  "@dashevo/dashcore-lib": "~0.22.0",
47
- "@dashevo/dpns-contract": "4.2.0-dev.9",
47
+ "@dashevo/dpns-contract": "5.0.0-beta.1",
48
48
  "@types/bs58": "^4.0.1",
49
49
  "@types/node": "^20.10.0",
50
50
  "@yarnpkg/pnpify": "^4.0.0-rc.42",
@@ -7,7 +7,7 @@ use crate::errors::protocol_error::from_protocol_error;
7
7
  use dpp::errors::consensus::signature::SignatureError;
8
8
  use dpp::errors::consensus::ConsensusError;
9
9
 
10
- use dpp::serialization::{PlatformDeserializable, PlatformSerializable};
10
+ use dpp::serialization::{PlatformDeserializableUntrusted, PlatformSerializable};
11
11
  use dpp::state_transition::data_contract_create_transition::accessors::DataContractCreateTransitionAccessorsV0;
12
12
  use dpp::state_transition::data_contract_create_transition::DataContractCreateTransition;
13
13
  use dpp::state_transition::StateTransitionHasUserFeeIncrease;
@@ -169,7 +169,8 @@ impl DataContractCreateTransitionWasm {
169
169
  #[wasm_bindgen(js_name=fromBuffer)]
170
170
  pub fn from_buffer(buffer: Vec<u8>) -> Result<DataContractCreateTransitionWasm, JsValue> {
171
171
  let state_transition: StateTransition =
172
- PlatformDeserializable::deserialize_from_bytes(&buffer).with_js_error()?;
172
+ PlatformDeserializableUntrusted::deserialize_from_bytes_untrusted(&buffer)
173
+ .with_js_error()?;
173
174
  match state_transition {
174
175
  StateTransition::DataContractCreate(dct) => Ok(dct.into()),
175
176
  _ => Err(JsValue::from_str("Invalid state transition type")),
@@ -4,7 +4,7 @@
4
4
 
5
5
  use dpp::consensus::ConsensusError;
6
6
  use dpp::serialization::ValueConvertible;
7
- use dpp::serialization::{PlatformDeserializable, PlatformSerializable};
7
+ use dpp::serialization::{PlatformDeserializableUntrusted, PlatformSerializable};
8
8
  use dpp::state_transition::data_contract_update_transition::accessors::DataContractUpdateTransitionAccessorsV0;
9
9
  use dpp::state_transition::data_contract_update_transition::DataContractUpdateTransition;
10
10
  use dpp::state_transition::StateTransition;
@@ -164,7 +164,8 @@ impl DataContractUpdateTransitionWasm {
164
164
  #[wasm_bindgen(js_name=fromBuffer)]
165
165
  pub fn from_buffer(buffer: Vec<u8>) -> Result<DataContractUpdateTransitionWasm, JsValue> {
166
166
  let state_transition: StateTransition =
167
- PlatformDeserializable::deserialize_from_bytes(&buffer).with_js_error()?;
167
+ PlatformDeserializableUntrusted::deserialize_from_bytes_untrusted(&buffer)
168
+ .with_js_error()?;
168
169
  match state_transition {
169
170
  StateTransition::DataContractUpdate(dct) => Ok(dct.into()),
170
171
  _ => Err(JsValue::from_str("Invalid state transition type")),
@@ -25,6 +25,7 @@ impl TokenClaimTransitionWasm {
25
25
  match self.0.distribution_type() {
26
26
  TokenDistributionType::PreProgrammed => 0,
27
27
  TokenDistributionType::Perpetual => 1,
28
+ TokenDistributionType::OncePerIdentity => 2,
28
29
  }
29
30
  }
30
31
  }
@@ -0,0 +1,36 @@
1
+ use dpp::consensus::basic::identity::ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError;
2
+ use dpp::consensus::codes::ErrorWithCode;
3
+ use dpp::consensus::ConsensusError;
4
+
5
+ use wasm_bindgen::prelude::*;
6
+
7
+ #[wasm_bindgen(js_name=ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError)]
8
+ pub struct ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationErrorWasm {
9
+ inner: ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError,
10
+ }
11
+
12
+ impl From<&ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError>
13
+ for ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationErrorWasm
14
+ {
15
+ fn from(e: &ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError) -> Self {
16
+ Self { inner: e.clone() }
17
+ }
18
+ }
19
+
20
+ #[wasm_bindgen(js_class=ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError)]
21
+ impl ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationErrorWasm {
22
+ #[wasm_bindgen(js_name=getKeyId)]
23
+ pub fn get_key_id(&self) -> u32 {
24
+ self.inner.key_id()
25
+ }
26
+
27
+ #[wasm_bindgen(js_name=getCode)]
28
+ pub fn get_code(&self) -> u32 {
29
+ ConsensusError::from(self.inner.clone()).code()
30
+ }
31
+
32
+ #[wasm_bindgen(getter)]
33
+ pub fn message(&self) -> String {
34
+ self.inner.to_string()
35
+ }
36
+ }
@@ -1,3 +1,4 @@
1
+ mod contract_group_bound_key_not_allowed_in_shielded_identity_creation_error;
1
2
  mod duplicated_identity_public_key_error;
2
3
  mod duplicated_identity_public_key_id_error;
3
4
  mod identity_asset_lock_proof_locked_transaction_mismatch_error;
@@ -28,6 +29,7 @@ mod missing_master_public_key_error;
28
29
  mod missing_public_key_error;
29
30
  mod not_implemented_credit_withdrawal_transition_pooling_error;
30
31
 
32
+ pub use contract_group_bound_key_not_allowed_in_shielded_identity_creation_error::*;
31
33
  pub use duplicated_identity_public_key_error::*;
32
34
  pub use duplicated_identity_public_key_id_error::*;
33
35
  pub use identity_asset_lock_proof_locked_transaction_mismatch_error::*;
@@ -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,85 @@ 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, DataContractInvalidRequiredFieldsUpdateError, ContestedUniqueIndexWithUniqueIndexError, 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, RedundantDocumentPaidForByTokenWithContractId, TokenPaymentByBurningOnlyAllowedOnInternalTokenError, TooManyKeywordsError, UnknownDocumentActionTokenEffectError, UnknownDocumentCreationRestrictionModeError, UnknownGasFeesPaidByError, UnknownSecurityLevelError, UnknownStorageKeyRequirementsError, UnknownTradeModeError, UnknownTransferableTypeError};
66
- use dpp::consensus::basic::document::{ContestedDocumentsTemporarilyNotAllowedError, DocumentCreationNotAllowedError, DocumentFieldMaxSizeExceededError, MaxDocumentsTransitionsExceededError, MissingPositionsInDocumentTypePropertiesError};
69
+ use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError, DataContractInvalidRequiredFieldsUpdateError, ContestedUniqueIndexWithUniqueIndexError, 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, 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_not_moderated_error::ReferencedDocumentTypeNotModeratedError;
77
86
  use dpp::consensus::state::document::document_contest_index_mismatch_error::DocumentContestIndexMismatchError;
78
87
  use dpp::consensus::state::document::document_contest_not_joinable_error::DocumentContestNotJoinableError;
79
88
  use dpp::consensus::state::document::document_contest_not_paid_for_error::DocumentContestNotPaidForError;
80
89
  use dpp::consensus::state::document::document_contest_not_required_error::DocumentContestNotRequiredError;
81
90
  use dpp::consensus::state::document::document_incorrect_purchase_price_error::DocumentIncorrectPurchasePriceError;
82
91
  use dpp::consensus::state::document::document_not_for_sale_error::DocumentNotForSaleError;
92
+ use dpp::consensus::basic::contract_group::{
93
+ ContractGroupMemberNotInContractError, ContractGroupMembershipsOverLimitError,
94
+ DuplicateContractGroupMembershipError,
95
+ InvalidContractGroupDescriptionLengthError, InvalidContractGroupNameLengthError,
96
+ InvalidContractGroupAdminsError, RedundantContractGroupMembershipError,
97
+ };
98
+ use dpp::consensus::basic::contract_moderation::{
99
+ ContractModerationReasonTooLongError, InvalidContractModerationDocumentFieldsError,
100
+ InvalidContractModerationReasonDocumentsError, ContractModerationSelfTargetError,
101
+ DocumentActionFeesWithoutModerationError,
102
+ InvalidContractModerationConfigError,
103
+ };
104
+ use dpp::consensus::basic::moderation_charter::{
105
+ ModerationCharterMalformedFieldError, ModerationCharterRewardSplitNotOneHundredError,
106
+ };
107
+ use dpp::consensus::state::contract_moderation::{
108
+ ContractFeeClaimNotAllowedError, ContractFeesAlreadyClaimedThisEpochError,
109
+ ContractFeesNothingToClaimError, ContractModeratedDocumentTypeNotYetUsableError,
110
+ ContractModerationAbilityNotGrantedError, ContractModerationTeamNotSeatedError,
111
+ DocumentNotSettledError, DocumentTypeNotDeletableOnceSettledError,
112
+ ModerationCharterAddedModeratorLimitReachedError, ModerationReasonNotListedError,
113
+ ContractTeamActionAlreadyCompletedError, ContractTeamActionAlreadySignedError,
114
+ ContractTeamActionDocumentChangedError, ContractTeamActionDoesNotExistError,
115
+ SettledDeletionNotRestorableError,
116
+ ContractModerationNotEnabledError, ContractModerationTargetNotAllowedError,
117
+ ContractModerationCounterpartyBarredError, ContractModerationTargetNotFoundError,
118
+ ContractModeratorIdentityNotFoundError,
119
+ ContractSuspensionNotInFutureError,
120
+ ContractUserAlreadyBannedError, ContractUserBannedError, ContractUserNotBannedError,
121
+ ContractUserNotSuspendedError, ContractUserNotWarnedError, ContractUserSuspendedError,
122
+ ContractUserWarningLimitReachedError, ContractDocumentAlreadyRestoredError,
123
+ ContractDocumentRemovalNotFoundError, DocumentFieldNotChangeableByModeratorsError,
124
+ DocumentModerationWindowElapsedError, DocumentModeratorFieldNotWritableError,
125
+ DocumentRestoreHashMismatchError, DocumentRestoreWindowElapsedError,
126
+ DocumentTypeNotDeletableByModeratorsError, IdentityNotContractModeratorError,
127
+ };
128
+ use dpp::consensus::state::contract_group::{
129
+ ContractGroupAdminNotFoundError, ContractGroupAlreadyExistsError, ContractGroupNotFoundError,
130
+ IdentityNotContractGroupOwnerOrAdminError,
131
+ };
83
132
  use dpp::consensus::state::group::{GroupActionAlreadyCompletedError, GroupActionAlreadySignedByIdentityError, GroupActionDoesNotExistError, IdentityMemberOfGroupNotFoundError, IdentityNotMemberOfGroupError, ModificationOfGroupActionMainParametersNotPermittedError};
84
133
  use dpp::consensus::state::identity::identity_for_token_configuration_not_found_error::IdentityInTokenConfigurationNotFoundError;
85
134
  use dpp::consensus::state::identity::identity_public_key_already_exists_for_unique_contract_bounds_error::IdentityPublicKeyAlreadyExistsForUniqueContractBoundsError;
135
+ use dpp::consensus::basic::identity::{
136
+ IdentityKeyLimitsUpdateEmptyError, IdentityPublicKeyLimitsNotAllowedError,
137
+ IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError,
138
+ InvalidIdentityPublicKeyBudgetError,
139
+ };
140
+ use dpp::consensus::signature::{
141
+ PublicKeyBudgetExhaustedError, PublicKeyExpiredError,
142
+ PublicKeyWithLimitsCannotUpdateKeyLimitsError,
143
+ };
144
+ use dpp::consensus::state::identity::identity_public_key_already_expired_error::IdentityPublicKeyAlreadyExpiredError;
145
+ use dpp::consensus::state::identity::identity_public_key_limit_not_raised_error::IdentityPublicKeyLimitNotRaisedError;
146
+ use dpp::consensus::state::identity::identity_public_key_limit_not_set_error::IdentityPublicKeyLimitNotSetError;
147
+ use dpp::consensus::state::identity::identity_public_key_budget_exceeded_error::IdentityPublicKeyBudgetExceededError;
86
148
  use dpp::consensus::state::identity::identity_to_freeze_does_not_exist_error::IdentityToFreezeDoesNotExistError;
87
149
  use dpp::consensus::state::identity::master_public_key_update_error::MasterPublicKeyUpdateError;
88
150
  use dpp::consensus::state::identity::missing_transfer_key_error::MissingTransferKeyError;
@@ -90,13 +152,22 @@ use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_availab
90
152
  use dpp::consensus::state::identity::RecipientIdentityDoesNotExistError;
91
153
  use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError;
92
154
  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};
155
+ 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};
94
156
  use dpp::consensus::state::address_funds::{AddressDoesNotExistError, AddressInvalidNonceError, AddressNotEnoughFundsError, AddressesNotEnoughFundsError};
95
157
  use dpp::consensus::state::document::referenced_document_type_deletable_error::ReferencedDocumentTypeDeletableError;
158
+ use dpp::consensus::state::document::referenced_document_type_not_deletable_error::ReferencedDocumentTypeNotDeletableError;
96
159
  use dpp::consensus::state::document::referenced_identity_key_disabled_error::ReferencedIdentityKeyDisabledError;
97
160
  use dpp::consensus::state::document::referenced_identity_key_not_found_error::ReferencedIdentityKeyNotFoundError;
98
161
  use dpp::consensus::state::document::referenced_document_property_agreement_invalid_error::ReferencedDocumentPropertyAgreementInvalidError;
99
162
  use dpp::consensus::state::document::referenced_document_property_mismatch_error::ReferencedDocumentPropertyMismatchError;
163
+ use dpp::consensus::state::document::document_immutable_property_changed_error::DocumentImmutablePropertyChangedError;
164
+ use dpp::consensus::state::identity::gas_sponsor_insufficient_balance_error::GasSponsorInsufficientBalanceError;
165
+ use dpp::consensus::state::token::{GasFeesPaidByNotAllowedError, InconsistentGasFeesPaidByInBatchError};
166
+ use dpp::consensus::state::document::document_action_fee_agreement_mismatch_error::DocumentActionFeeAgreementMismatchError;
167
+ use dpp::consensus::state::document::document_action_fee_moderators_share_mismatch_error::DocumentActionFeeModeratorsShareMismatchError;
168
+ use dpp::consensus::state::document::document_expired_error::DocumentExpiredError;
169
+ use dpp::consensus::state::document::document_action_fee_agreement_not_set_error::DocumentActionFeeAgreementNotSetError;
170
+ use dpp::consensus::state::document::document_action_fee_multiplier_not_tolerated_error::DocumentActionFeeMultiplierNotToleratedError;
100
171
  use dpp::consensus::state::document::referenced_key_id_property_invalid_error::ReferencedKeyIdPropertyInvalidError;
101
172
  use dpp::consensus::state::document::referenced_document_type_not_found_error::ReferencedDocumentTypeNotFoundError;
102
173
  use dpp::consensus::state::shielded::insufficient_pool_notes_error::InsufficientPoolNotesError;
@@ -105,12 +176,17 @@ use dpp::consensus::state::shielded::invalid_anchor_error::InvalidAnchorError;
105
176
  use dpp::consensus::state::shielded::invalid_shielded_proof_error::InvalidShieldedProofError;
106
177
  use dpp::consensus::state::shielded::nullifier_already_spent_error::NullifierAlreadySpentError;
107
178
  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};
179
+ use dpp::consensus::state::document::referenced_contract_requirement_not_met_error::ReferencedContractRequirementNotMetError;
180
+ use dpp::consensus::state::document::referenced_identity_key_requirement_not_met_error::ReferencedIdentityKeyRequirementNotMetError;
181
+ use dpp::consensus::state::document::referenced_document_lookup_invalid_error::ReferencedDocumentLookupInvalidError;
182
+ use dpp::consensus::state::document::referenced_document_list_invalid_error::ReferencedDocumentListInvalidError;
108
183
  use dpp::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError;
109
184
  use dpp::consensus::state::voting::masternode_incorrect_voting_address_error::MasternodeIncorrectVotingAddressError;
110
185
  use dpp::consensus::state::voting::masternode_not_found_error::MasternodeNotFoundError;
111
186
  use dpp::consensus::state::voting::masternode_vote_already_present_error::MasternodeVoteAlreadyPresentError;
112
187
  use dpp::consensus::state::voting::masternode_voted_too_many_times::MasternodeVotedTooManyTimesError;
113
188
  use dpp::consensus::state::voting::vote_poll_not_available_for_voting_error::VotePollNotAvailableForVotingError;
189
+ use dpp::consensus::state::voting::vote_choice_not_allowed_for_vote_poll_error::VoteChoiceNotAllowedForVotePollError;
114
190
  use dpp::consensus::state::voting::vote_poll_not_found_error::VotePollNotFoundError;
115
191
 
116
192
  use crate::errors::consensus::basic::data_contract::{
@@ -503,6 +579,204 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
503
579
  StateError::ReferencedDocumentPropertyMismatchError(e) => {
504
580
  generic_consensus_error!(ReferencedDocumentPropertyMismatchError, e).into()
505
581
  }
582
+ StateError::ContractGroupAlreadyExistsError(e) => {
583
+ generic_consensus_error!(ContractGroupAlreadyExistsError, e).into()
584
+ }
585
+ StateError::ContractGroupNotFoundError(e) => {
586
+ generic_consensus_error!(ContractGroupNotFoundError, e).into()
587
+ }
588
+ StateError::IdentityNotContractGroupOwnerOrAdminError(e) => {
589
+ generic_consensus_error!(IdentityNotContractGroupOwnerOrAdminError, e).into()
590
+ }
591
+ StateError::ContractGroupAdminNotFoundError(e) => {
592
+ generic_consensus_error!(ContractGroupAdminNotFoundError, e).into()
593
+ }
594
+ StateError::IdentityPublicKeyBudgetExceededError(e) => {
595
+ generic_consensus_error!(IdentityPublicKeyBudgetExceededError, e).into()
596
+ }
597
+ StateError::IdentityPublicKeyAlreadyExpiredError(e) => {
598
+ generic_consensus_error!(IdentityPublicKeyAlreadyExpiredError, e).into()
599
+ }
600
+ StateError::IdentityPublicKeyLimitNotSetError(e) => {
601
+ generic_consensus_error!(IdentityPublicKeyLimitNotSetError, e).into()
602
+ }
603
+ StateError::IdentityPublicKeyLimitNotRaisedError(e) => {
604
+ generic_consensus_error!(IdentityPublicKeyLimitNotRaisedError, e).into()
605
+ }
606
+ StateError::DocumentImmutablePropertyChangedError(e) => {
607
+ generic_consensus_error!(DocumentImmutablePropertyChangedError, e).into()
608
+ }
609
+ StateError::TokenOncePerIdentityDistributionAlreadyClaimedError(e) => {
610
+ generic_consensus_error!(TokenOncePerIdentityDistributionAlreadyClaimedError, e).into()
611
+ }
612
+ StateError::GasFeesPaidByNotAllowedError(e) => {
613
+ generic_consensus_error!(GasFeesPaidByNotAllowedError, e).into()
614
+ }
615
+ StateError::InconsistentGasFeesPaidByInBatchError(e) => {
616
+ generic_consensus_error!(InconsistentGasFeesPaidByInBatchError, e).into()
617
+ }
618
+ StateError::DocumentActionFeeAgreementNotSetError(e) => {
619
+ generic_consensus_error!(DocumentActionFeeAgreementNotSetError, e).into()
620
+ }
621
+ StateError::DocumentActionFeeAgreementMismatchError(e) => {
622
+ generic_consensus_error!(DocumentActionFeeAgreementMismatchError, e).into()
623
+ }
624
+ StateError::DocumentActionFeeMultiplierNotToleratedError(e) => {
625
+ generic_consensus_error!(DocumentActionFeeMultiplierNotToleratedError, e).into()
626
+ }
627
+ StateError::GasSponsorInsufficientBalanceError(e) => {
628
+ generic_consensus_error!(GasSponsorInsufficientBalanceError, e).into()
629
+ }
630
+ StateError::ContractModerationNotEnabledError(e) => {
631
+ generic_consensus_error!(ContractModerationNotEnabledError, e).into()
632
+ }
633
+ StateError::IdentityNotContractModeratorError(e) => {
634
+ generic_consensus_error!(IdentityNotContractModeratorError, e).into()
635
+ }
636
+ StateError::ContractModerationTargetNotAllowedError(e) => {
637
+ generic_consensus_error!(ContractModerationTargetNotAllowedError, e).into()
638
+ }
639
+ StateError::ContractUserAlreadyBannedError(e) => {
640
+ generic_consensus_error!(ContractUserAlreadyBannedError, e).into()
641
+ }
642
+ StateError::ContractUserNotBannedError(e) => {
643
+ generic_consensus_error!(ContractUserNotBannedError, e).into()
644
+ }
645
+ StateError::ContractUserNotSuspendedError(e) => {
646
+ generic_consensus_error!(ContractUserNotSuspendedError, e).into()
647
+ }
648
+ StateError::ContractSuspensionNotInFutureError(e) => {
649
+ generic_consensus_error!(ContractSuspensionNotInFutureError, e).into()
650
+ }
651
+ StateError::ContractUserBannedError(e) => {
652
+ generic_consensus_error!(ContractUserBannedError, e).into()
653
+ }
654
+ StateError::ContractUserSuspendedError(e) => {
655
+ generic_consensus_error!(ContractUserSuspendedError, e).into()
656
+ }
657
+ StateError::ContractModerationTargetNotFoundError(e) => {
658
+ generic_consensus_error!(ContractModerationTargetNotFoundError, e).into()
659
+ }
660
+ StateError::ContractModeratorIdentityNotFoundError(e) => {
661
+ generic_consensus_error!(ContractModeratorIdentityNotFoundError, e).into()
662
+ }
663
+ StateError::ContractModerationCounterpartyBarredError(e) => {
664
+ generic_consensus_error!(ContractModerationCounterpartyBarredError, e).into()
665
+ }
666
+ StateError::ContractFeesAlreadyClaimedThisEpochError(e) => {
667
+ generic_consensus_error!(ContractFeesAlreadyClaimedThisEpochError, e).into()
668
+ }
669
+ StateError::ContractFeesNothingToClaimError(e) => {
670
+ generic_consensus_error!(ContractFeesNothingToClaimError, e).into()
671
+ }
672
+ StateError::ContractFeeClaimNotAllowedError(e) => {
673
+ generic_consensus_error!(ContractFeeClaimNotAllowedError, e).into()
674
+ }
675
+ StateError::ReferencedDocumentTypeNotDeletableError(e) => {
676
+ generic_consensus_error!(ReferencedDocumentTypeNotDeletableError, e).into()
677
+ }
678
+ StateError::DocumentTypeNotDeletableByModeratorsError(e) => {
679
+ generic_consensus_error!(DocumentTypeNotDeletableByModeratorsError, e).into()
680
+ }
681
+ StateError::DocumentModerationWindowElapsedError(e) => {
682
+ generic_consensus_error!(DocumentModerationWindowElapsedError, e).into()
683
+ }
684
+ StateError::ContractDocumentRemovalNotFoundError(e) => {
685
+ generic_consensus_error!(ContractDocumentRemovalNotFoundError, e).into()
686
+ }
687
+ StateError::DocumentRestoreWindowElapsedError(e) => {
688
+ generic_consensus_error!(DocumentRestoreWindowElapsedError, e).into()
689
+ }
690
+ StateError::DocumentRestoreHashMismatchError(e) => {
691
+ generic_consensus_error!(DocumentRestoreHashMismatchError, e).into()
692
+ }
693
+ StateError::ContractDocumentAlreadyRestoredError(e) => {
694
+ generic_consensus_error!(ContractDocumentAlreadyRestoredError, e).into()
695
+ }
696
+ StateError::ContractUserNotWarnedError(e) => {
697
+ generic_consensus_error!(ContractUserNotWarnedError, e).into()
698
+ }
699
+ StateError::ContractUserWarningLimitReachedError(e) => {
700
+ generic_consensus_error!(ContractUserWarningLimitReachedError, e).into()
701
+ }
702
+ StateError::ContractModeratedDocumentTypeNotYetUsableError(e) => {
703
+ generic_consensus_error!(ContractModeratedDocumentTypeNotYetUsableError, e).into()
704
+ }
705
+ StateError::VoteChoiceNotAllowedForVotePollError(e) => {
706
+ generic_consensus_error!(VoteChoiceNotAllowedForVotePollError, e).into()
707
+ }
708
+ StateError::ReferencedContractRequirementNotMetError(e) => {
709
+ generic_consensus_error!(ReferencedContractRequirementNotMetError, e).into()
710
+ }
711
+ StateError::ReferencedIdentityKeyRequirementNotMetError(e) => {
712
+ generic_consensus_error!(ReferencedIdentityKeyRequirementNotMetError, e).into()
713
+ }
714
+ StateError::ReferencedDocumentLookupInvalidError(e) => {
715
+ generic_consensus_error!(ReferencedDocumentLookupInvalidError, e).into()
716
+ }
717
+ StateError::ReferencedDocumentListInvalidError(e) => {
718
+ generic_consensus_error!(ReferencedDocumentListInvalidError, e).into()
719
+ }
720
+ StateError::ContractModerationAbilityNotGrantedError(e) => {
721
+ generic_consensus_error!(ContractModerationAbilityNotGrantedError, e).into()
722
+ }
723
+ StateError::ModerationCharterAddedModeratorLimitReachedError(e) => {
724
+ generic_consensus_error!(ModerationCharterAddedModeratorLimitReachedError, e).into()
725
+ }
726
+ StateError::ModerationReasonNotListedError(e) => {
727
+ generic_consensus_error!(ModerationReasonNotListedError, e).into()
728
+ }
729
+ StateError::DocumentTypeNotDeletableOnceSettledError(e) => {
730
+ generic_consensus_error!(DocumentTypeNotDeletableOnceSettledError, e).into()
731
+ }
732
+ StateError::ContractModerationTeamNotSeatedError(e) => {
733
+ generic_consensus_error!(ContractModerationTeamNotSeatedError, e).into()
734
+ }
735
+ StateError::DocumentNotSettledError(e) => {
736
+ generic_consensus_error!(DocumentNotSettledError, e).into()
737
+ }
738
+ StateError::ContractTeamActionDoesNotExistError(e) => {
739
+ generic_consensus_error!(ContractTeamActionDoesNotExistError, e).into()
740
+ }
741
+ StateError::ContractTeamActionAlreadySignedError(e) => {
742
+ generic_consensus_error!(ContractTeamActionAlreadySignedError, e).into()
743
+ }
744
+ StateError::SettledDeletionNotRestorableError(e) => {
745
+ generic_consensus_error!(SettledDeletionNotRestorableError, e).into()
746
+ }
747
+ StateError::ContractTeamActionAlreadyCompletedError(e) => {
748
+ generic_consensus_error!(ContractTeamActionAlreadyCompletedError, e).into()
749
+ }
750
+ StateError::ContractTeamActionDocumentChangedError(e) => {
751
+ generic_consensus_error!(ContractTeamActionDocumentChangedError, e).into()
752
+ }
753
+ StateError::DocumentActionFeeModeratorsShareMismatchError(e) => {
754
+ generic_consensus_error!(DocumentActionFeeModeratorsShareMismatchError, e).into()
755
+ }
756
+ StateError::DocumentExpiredError(e) => {
757
+ generic_consensus_error!(DocumentExpiredError, e).into()
758
+ }
759
+ StateError::DocumentContestMaximumContendersReachedError(e) => {
760
+ generic_consensus_error!(DocumentContestMaximumContendersReachedError, e).into()
761
+ }
762
+ StateError::DocumentFieldNotChangeableByModeratorsError(e) => {
763
+ generic_consensus_error!(DocumentFieldNotChangeableByModeratorsError, e).into()
764
+ }
765
+ StateError::DocumentModeratorFieldNotWritableError(e) => {
766
+ generic_consensus_error!(DocumentModeratorFieldNotWritableError, e).into()
767
+ }
768
+ StateError::ReferencedDocumentRequirementNotMetError(e) => {
769
+ generic_consensus_error!(ReferencedDocumentRequirementNotMetError, e).into()
770
+ }
771
+ StateError::ReferencedDocumentTypeNotModeratedError(e) => {
772
+ generic_consensus_error!(ReferencedDocumentTypeNotModeratedError, e).into()
773
+ }
774
+ StateError::ReferencedDocumentTypeModeratedError(e) => {
775
+ generic_consensus_error!(ReferencedDocumentTypeModeratedError, e).into()
776
+ }
777
+ StateError::ReferencedDocumentRemovedError(e) => {
778
+ generic_consensus_error!(ReferencedDocumentRemovedError, e).into()
779
+ }
506
780
  }
507
781
  }
508
782
 
@@ -659,6 +933,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
659
933
  IdentityAssetLockTransactionTooManyInputsError(e) => {
660
934
  IdentityAssetLockTransactionTooManyInputsErrorWasm::from(e).into()
661
935
  }
936
+ ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationError(e) => {
937
+ ContractGroupBoundKeyNotAllowedInShieldedIdentityCreationErrorWasm::from(e).into()
938
+ }
662
939
  InvalidInstantAssetLockProofError(e) => {
663
940
  InvalidInstantAssetLockProofErrorWasm::from(e).into()
664
941
  }
@@ -756,6 +1033,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
756
1033
  BasicError::DocumentFieldMaxSizeExceededError(e) => {
757
1034
  generic_consensus_error!(DocumentFieldMaxSizeExceededError, e).into()
758
1035
  }
1036
+ BasicError::DocumentPropertyNotDistinctError(e) => {
1037
+ generic_consensus_error!(DocumentPropertyNotDistinctError, e).into()
1038
+ }
759
1039
  BasicError::ContestedUniqueIndexWithUniqueIndexError(e) => {
760
1040
  generic_consensus_error!(ContestedUniqueIndexWithUniqueIndexError, e).into()
761
1041
  }
@@ -917,6 +1197,12 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
917
1197
  generic_consensus_error!(InvalidTokenDistributionTimeIntervalNotMinuteAlignedError, e)
918
1198
  .into()
919
1199
  }
1200
+ BasicError::InvalidTokenDistributionEpochIntervalTooShortError(e) => {
1201
+ generic_consensus_error!(InvalidTokenDistributionEpochIntervalTooShortError, e).into()
1202
+ }
1203
+ BasicError::InvalidTokenOncePerIdentityDistributionAmountError(e) => {
1204
+ generic_consensus_error!(InvalidTokenOncePerIdentityDistributionAmountError, e).into()
1205
+ }
920
1206
  BasicError::RedundantDocumentPaidForByTokenWithContractId(e) => {
921
1207
  generic_consensus_error!(RedundantDocumentPaidForByTokenWithContractId, e).into()
922
1208
  }
@@ -1016,6 +1302,85 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
1016
1302
  BasicError::DataContractInvalidRequiredFieldsUpdateError(e) => {
1017
1303
  generic_consensus_error!(DataContractInvalidRequiredFieldsUpdateError, e).into()
1018
1304
  }
1305
+ BasicError::ContractGroupMembershipsOverLimitError(e) => {
1306
+ generic_consensus_error!(ContractGroupMembershipsOverLimitError, e).into()
1307
+ }
1308
+ BasicError::DuplicateContractGroupMembershipError(e) => {
1309
+ generic_consensus_error!(DuplicateContractGroupMembershipError, e).into()
1310
+ }
1311
+ BasicError::RedundantContractGroupMembershipError(e) => {
1312
+ generic_consensus_error!(RedundantContractGroupMembershipError, e).into()
1313
+ }
1314
+ BasicError::ContractGroupMemberNotInContractError(e) => {
1315
+ generic_consensus_error!(ContractGroupMemberNotInContractError, e).into()
1316
+ }
1317
+ BasicError::InvalidContractGroupAdminsError(e) => {
1318
+ generic_consensus_error!(InvalidContractGroupAdminsError, e).into()
1319
+ }
1320
+ BasicError::InvalidContractGroupNameLengthError(e) => {
1321
+ generic_consensus_error!(InvalidContractGroupNameLengthError, e).into()
1322
+ }
1323
+ BasicError::InvalidContractGroupDescriptionLengthError(e) => {
1324
+ generic_consensus_error!(InvalidContractGroupDescriptionLengthError, e).into()
1325
+ }
1326
+ BasicError::IdentityPublicKeyLimitsNotAllowedError(e) => {
1327
+ generic_consensus_error!(IdentityPublicKeyLimitsNotAllowedError, e).into()
1328
+ }
1329
+ BasicError::InvalidIdentityPublicKeyBudgetError(e) => {
1330
+ generic_consensus_error!(InvalidIdentityPublicKeyBudgetError, e).into()
1331
+ }
1332
+ BasicError::IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError(e) => {
1333
+ generic_consensus_error!(
1334
+ IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError,
1335
+ e
1336
+ )
1337
+ .into()
1338
+ }
1339
+ BasicError::IdentityKeyLimitsUpdateEmptyError(e) => {
1340
+ generic_consensus_error!(IdentityKeyLimitsUpdateEmptyError, e).into()
1341
+ }
1342
+ BasicError::PreProgrammedDistributionAmountOverLimitError(e) => {
1343
+ generic_consensus_error!(PreProgrammedDistributionAmountOverLimitError, e).into()
1344
+ }
1345
+ BasicError::InvalidContractModerationConfigError(e) => {
1346
+ generic_consensus_error!(InvalidContractModerationConfigError, e).into()
1347
+ }
1348
+ BasicError::ContractModerationSelfTargetError(e) => {
1349
+ generic_consensus_error!(ContractModerationSelfTargetError, e).into()
1350
+ }
1351
+ BasicError::DocumentActionFeesWithoutModerationError(e) => {
1352
+ generic_consensus_error!(DocumentActionFeesWithoutModerationError, e).into()
1353
+ }
1354
+ BasicError::ContractModerationReasonTooLongError(e) => {
1355
+ generic_consensus_error!(ContractModerationReasonTooLongError, e).into()
1356
+ }
1357
+ BasicError::ModerationCharterMalformedFieldError(e) => {
1358
+ generic_consensus_error!(ModerationCharterMalformedFieldError, e).into()
1359
+ }
1360
+ BasicError::ModerationCharterRewardSplitNotOneHundredError(e) => {
1361
+ generic_consensus_error!(ModerationCharterRewardSplitNotOneHundredError, e).into()
1362
+ }
1363
+ BasicError::InvalidContractModerationReasonDocumentsError(e) => {
1364
+ generic_consensus_error!(InvalidContractModerationReasonDocumentsError, e).into()
1365
+ }
1366
+ BasicError::InvalidEncryptedPropertyShapeError(e) => {
1367
+ generic_consensus_error!(InvalidEncryptedPropertyShapeError, e).into()
1368
+ }
1369
+ BasicError::DocumentPropertyMaxBytesExceededError(e) => {
1370
+ generic_consensus_error!(DocumentPropertyMaxBytesExceededError, e).into()
1371
+ }
1372
+ BasicError::DocumentPropertyConstraintViolatedError(e) => {
1373
+ generic_consensus_error!(DocumentPropertyConstraintViolatedError, e).into()
1374
+ }
1375
+ BasicError::DocumentPropertyNotGeneratedError(e) => {
1376
+ generic_consensus_error!(DocumentPropertyNotGeneratedError, e).into()
1377
+ }
1378
+ BasicError::InvalidContractModerationDocumentFieldsError(e) => {
1379
+ generic_consensus_error!(InvalidContractModerationDocumentFieldsError, e).into()
1380
+ }
1381
+ BasicError::DocumentReferencePreimageInvalidError(e) => {
1382
+ generic_consensus_error!(DocumentReferencePreimageInvalidError, e).into()
1383
+ }
1019
1384
  }
1020
1385
  }
1021
1386
 
@@ -1049,9 +1414,24 @@ fn from_signature_error(signature_error: &SignatureError) -> JsValue {
1049
1414
  SignatureError::InvalidSignaturePublicKeyPurposeError(err) => {
1050
1415
  InvalidSignaturePublicKeyPurposeErrorWasm::from(err).into()
1051
1416
  }
1417
+ SignatureError::ContractBoundedKeyNonBatchError(err) => {
1418
+ ContractBoundedKeyNonBatchErrorWasm::from(err).into()
1419
+ }
1420
+ SignatureError::ContractBoundedKeyOutOfBoundsError(err) => {
1421
+ ContractBoundedKeyOutOfBoundsErrorWasm::from(err).into()
1422
+ }
1052
1423
  SignatureError::UncompressedPublicKeyNotAllowedError(err) => {
1053
1424
  UncompressedPublicKeyNotAllowedErrorWasm::from(err).into()
1054
1425
  }
1426
+ SignatureError::PublicKeyBudgetExhaustedError(e) => {
1427
+ generic_consensus_error!(PublicKeyBudgetExhaustedError, e).into()
1428
+ }
1429
+ SignatureError::PublicKeyExpiredError(e) => {
1430
+ generic_consensus_error!(PublicKeyExpiredError, e).into()
1431
+ }
1432
+ SignatureError::PublicKeyWithLimitsCannotUpdateKeyLimitsError(e) => {
1433
+ generic_consensus_error!(PublicKeyWithLimitsCannotUpdateKeyLimitsError, e).into()
1434
+ }
1055
1435
  }
1056
1436
  }
1057
1437
 
@@ -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::PlatformDeserializable;
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::deserialize_from_bytes(bytes.as_slice())
9
+ ConsensusError::deserialize_from_bytes_untrusted(bytes.as_slice())
10
10
  .map(from_consensus_error)
11
11
  .map_err(|e| e.into())
12
12
  }