@dashevo/wasm-dpp 4.2.0-beta.2 → 4.2.0-beta.4
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 +1634 -932
- package/dist/wasm/wasm_dpp.js +386 -62
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/lib/wasm/wasm_dpp.d.ts +1634 -932
- package/package.json +2 -2
- package/src/document/state_transition/batch_transition/token_transition/claim.rs +1 -0
- package/src/errors/consensus/consensus_error.rs +202 -4
- package/src/state_transition/state_transition_factory.rs +6 -0
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +3 -1
- 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-beta.
|
|
3
|
+
"version": "4.2.0-beta.4",
|
|
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-beta.
|
|
47
|
+
"@dashevo/dpns-contract": "4.2.0-beta.4",
|
|
48
48
|
"@types/bs58": "^4.0.1",
|
|
49
49
|
"@types/node": "^20.10.0",
|
|
50
50
|
"@yarnpkg/pnpify": "^4.0.0-rc.42",
|
|
@@ -66,12 +66,12 @@ use dpp::consensus::state::data_trigger::DataTriggerError::{
|
|
|
66
66
|
DataTriggerConditionError, DataTriggerExecutionError, DataTriggerInvalidResultError,
|
|
67
67
|
};
|
|
68
68
|
use wasm_bindgen::{JsError, JsValue};
|
|
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, RedundantDocumentPaidForByTokenWithContractId, TokenPaymentByBurningOnlyAllowedOnInternalTokenError, TooManyKeywordsError, UnknownDocumentActionTokenEffectError, UnknownDocumentCreationRestrictionModeError, UnknownGasFeesPaidByError, UnknownSecurityLevelError, UnknownStorageKeyRequirementsError, UnknownTradeModeError, UnknownTransferableTypeError};
|
|
70
|
-
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, InvalidEncryptedPropertyShapeError, MaxDocumentsTransitionsExceededError, MissingPositionsInDocumentTypePropertiesError};
|
|
71
71
|
use dpp::consensus::basic::group::GroupActionNotAllowedOnTransitionError;
|
|
72
72
|
use dpp::consensus::basic::identity::{DataContractBoundsNotPresentError, DisablingKeyIdAlsoBeingAddedInSameTransitionError, InvalidIdentityCreditWithdrawalTransitionAmountError, InvalidIdentityUpdateTransitionDisableKeysError, InvalidIdentityUpdateTransitionEmptyError, InvalidKeyPurposeForContractBoundsError, TooManyMasterPublicKeyError, WithdrawalOutputScriptNotAllowedWhenSigningWithOwnerKeyError};
|
|
73
73
|
use dpp::consensus::basic::overflow_error::OverflowError;
|
|
74
|
-
use dpp::consensus::basic::token::{ChoosingTokenMintRecipientNotAllowedError, ContractHasNoTokensError, DestinationIdentityForTokenMintingNotSetError, InvalidActionIdError, InvalidTokenAmountError, InvalidTokenConfigUpdateNoChangeError, InvalidTokenIdError, InvalidTokenNoteTooBigError, InvalidTokenPositionError, MissingDefaultLocalizationError, TokenNoteOnlyAllowedWhenProposerError, TokenPricingScheduleEmptyError, TokenTransferToOurselfError, InvalidTokenDistributionTimeIntervalNotMinuteAlignedError, InvalidTokenDistributionTimeIntervalTooShortError, InvalidTokenDistributionBlockIntervalTooShortError, InvalidTokenDistributionEpochIntervalTooShortError};
|
|
74
|
+
use dpp::consensus::basic::token::{ChoosingTokenMintRecipientNotAllowedError, ContractHasNoTokensError, DestinationIdentityForTokenMintingNotSetError, InvalidActionIdError, InvalidTokenAmountError, InvalidTokenConfigUpdateNoChangeError, InvalidTokenIdError, InvalidTokenNoteTooBigError, InvalidTokenPositionError, MissingDefaultLocalizationError, TokenNoteOnlyAllowedWhenProposerError, TokenPricingScheduleEmptyError, TokenTransferToOurselfError, InvalidTokenDistributionTimeIntervalNotMinuteAlignedError, InvalidTokenDistributionTimeIntervalTooShortError, InvalidTokenDistributionBlockIntervalTooShortError, InvalidTokenDistributionEpochIntervalTooShortError, InvalidTokenOncePerIdentityDistributionAmountError};
|
|
75
75
|
use dpp::consensus::state::data_contract::data_contract_not_found_error::DataContractNotFoundError;
|
|
76
76
|
use dpp::consensus::state::data_contract::data_contract_update_action_not_allowed_error::DataContractUpdateActionNotAllowedError;
|
|
77
77
|
use dpp::consensus::state::data_contract::document_type_update_error::DocumentTypeUpdateError;
|
|
@@ -90,6 +90,30 @@ use dpp::consensus::basic::contract_group::{
|
|
|
90
90
|
InvalidContractGroupDescriptionLengthError, InvalidContractGroupNameLengthError,
|
|
91
91
|
InvalidContractGroupAdminsError, RedundantContractGroupMembershipError,
|
|
92
92
|
};
|
|
93
|
+
use dpp::consensus::basic::contract_moderation::{
|
|
94
|
+
ContractModerationReasonTooLongError, InvalidContractModerationReasonDocumentsError, ContractModerationSelfTargetError,
|
|
95
|
+
DocumentActionFeesWithoutModerationError,
|
|
96
|
+
InvalidContractModerationConfigError,
|
|
97
|
+
};
|
|
98
|
+
use dpp::consensus::basic::moderation_charter::{
|
|
99
|
+
ModerationCharterMalformedFieldError, ModerationCharterRewardSplitNotOneHundredError,
|
|
100
|
+
};
|
|
101
|
+
use dpp::consensus::state::contract_moderation::{
|
|
102
|
+
ContractFeeClaimNotAllowedError, ContractFeesAlreadyClaimedThisEpochError,
|
|
103
|
+
ContractFeesNothingToClaimError, ContractModeratedDocumentTypeNotYetUsableError,
|
|
104
|
+
ContractModerationAbilityNotGrantedError, ModerationCharterAddedModeratorLimitReachedError,
|
|
105
|
+
ModerationReasonNotListedError,
|
|
106
|
+
ContractModerationNotEnabledError, ContractModerationTargetNotAllowedError,
|
|
107
|
+
ContractModerationCounterpartyBarredError, ContractModerationTargetNotFoundError,
|
|
108
|
+
ContractModeratorIdentityNotFoundError,
|
|
109
|
+
ContractSuspensionNotInFutureError,
|
|
110
|
+
ContractUserAlreadyBannedError, ContractUserBannedError, ContractUserNotBannedError,
|
|
111
|
+
ContractUserNotSuspendedError, ContractUserNotWarnedError, ContractUserSuspendedError,
|
|
112
|
+
ContractUserWarningLimitReachedError, ContractDocumentAlreadyRestoredError,
|
|
113
|
+
ContractDocumentRemovalNotFoundError, DocumentModerationWindowElapsedError,
|
|
114
|
+
DocumentRestoreHashMismatchError, DocumentRestoreWindowElapsedError,
|
|
115
|
+
DocumentTypeNotDeletableByModeratorsError, IdentityNotContractModeratorError,
|
|
116
|
+
};
|
|
93
117
|
use dpp::consensus::state::contract_group::{
|
|
94
118
|
ContractGroupAdminNotFoundError, ContractGroupAlreadyExistsError, ContractGroupNotFoundError,
|
|
95
119
|
IdentityNotContractGroupOwnerOrAdminError,
|
|
@@ -117,14 +141,21 @@ use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_availab
|
|
|
117
141
|
use dpp::consensus::state::identity::RecipientIdentityDoesNotExistError;
|
|
118
142
|
use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError;
|
|
119
143
|
use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError;
|
|
120
|
-
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};
|
|
144
|
+
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};
|
|
121
145
|
use dpp::consensus::state::address_funds::{AddressDoesNotExistError, AddressInvalidNonceError, AddressNotEnoughFundsError, AddressesNotEnoughFundsError};
|
|
122
146
|
use dpp::consensus::state::document::referenced_document_type_deletable_error::ReferencedDocumentTypeDeletableError;
|
|
147
|
+
use dpp::consensus::state::document::referenced_document_type_not_deletable_error::ReferencedDocumentTypeNotDeletableError;
|
|
123
148
|
use dpp::consensus::state::document::referenced_identity_key_disabled_error::ReferencedIdentityKeyDisabledError;
|
|
124
149
|
use dpp::consensus::state::document::referenced_identity_key_not_found_error::ReferencedIdentityKeyNotFoundError;
|
|
125
150
|
use dpp::consensus::state::document::referenced_document_property_agreement_invalid_error::ReferencedDocumentPropertyAgreementInvalidError;
|
|
126
151
|
use dpp::consensus::state::document::referenced_document_property_mismatch_error::ReferencedDocumentPropertyMismatchError;
|
|
127
152
|
use dpp::consensus::state::document::document_immutable_property_changed_error::DocumentImmutablePropertyChangedError;
|
|
153
|
+
use dpp::consensus::state::identity::gas_sponsor_insufficient_balance_error::GasSponsorInsufficientBalanceError;
|
|
154
|
+
use dpp::consensus::state::token::{GasFeesPaidByNotAllowedError, InconsistentGasFeesPaidByInBatchError};
|
|
155
|
+
use dpp::consensus::state::document::document_action_fee_agreement_mismatch_error::DocumentActionFeeAgreementMismatchError;
|
|
156
|
+
use dpp::consensus::state::document::document_action_fee_moderators_share_mismatch_error::DocumentActionFeeModeratorsShareMismatchError;
|
|
157
|
+
use dpp::consensus::state::document::document_action_fee_agreement_not_set_error::DocumentActionFeeAgreementNotSetError;
|
|
158
|
+
use dpp::consensus::state::document::document_action_fee_multiplier_not_tolerated_error::DocumentActionFeeMultiplierNotToleratedError;
|
|
128
159
|
use dpp::consensus::state::document::referenced_key_id_property_invalid_error::ReferencedKeyIdPropertyInvalidError;
|
|
129
160
|
use dpp::consensus::state::document::referenced_document_type_not_found_error::ReferencedDocumentTypeNotFoundError;
|
|
130
161
|
use dpp::consensus::state::shielded::insufficient_pool_notes_error::InsufficientPoolNotesError;
|
|
@@ -133,12 +164,17 @@ use dpp::consensus::state::shielded::invalid_anchor_error::InvalidAnchorError;
|
|
|
133
164
|
use dpp::consensus::state::shielded::invalid_shielded_proof_error::InvalidShieldedProofError;
|
|
134
165
|
use dpp::consensus::state::shielded::nullifier_already_spent_error::NullifierAlreadySpentError;
|
|
135
166
|
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};
|
|
167
|
+
use dpp::consensus::state::document::referenced_contract_requirement_not_met_error::ReferencedContractRequirementNotMetError;
|
|
168
|
+
use dpp::consensus::state::document::referenced_identity_key_requirement_not_met_error::ReferencedIdentityKeyRequirementNotMetError;
|
|
169
|
+
use dpp::consensus::state::document::referenced_document_lookup_invalid_error::ReferencedDocumentLookupInvalidError;
|
|
170
|
+
use dpp::consensus::state::document::referenced_document_list_invalid_error::ReferencedDocumentListInvalidError;
|
|
136
171
|
use dpp::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError;
|
|
137
172
|
use dpp::consensus::state::voting::masternode_incorrect_voting_address_error::MasternodeIncorrectVotingAddressError;
|
|
138
173
|
use dpp::consensus::state::voting::masternode_not_found_error::MasternodeNotFoundError;
|
|
139
174
|
use dpp::consensus::state::voting::masternode_vote_already_present_error::MasternodeVoteAlreadyPresentError;
|
|
140
175
|
use dpp::consensus::state::voting::masternode_voted_too_many_times::MasternodeVotedTooManyTimesError;
|
|
141
176
|
use dpp::consensus::state::voting::vote_poll_not_available_for_voting_error::VotePollNotAvailableForVotingError;
|
|
177
|
+
use dpp::consensus::state::voting::vote_choice_not_allowed_for_vote_poll_error::VoteChoiceNotAllowedForVotePollError;
|
|
142
178
|
use dpp::consensus::state::voting::vote_poll_not_found_error::VotePollNotFoundError;
|
|
143
179
|
|
|
144
180
|
use crate::errors::consensus::basic::data_contract::{
|
|
@@ -558,6 +594,129 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
|
|
|
558
594
|
StateError::DocumentImmutablePropertyChangedError(e) => {
|
|
559
595
|
generic_consensus_error!(DocumentImmutablePropertyChangedError, e).into()
|
|
560
596
|
}
|
|
597
|
+
StateError::TokenOncePerIdentityDistributionAlreadyClaimedError(e) => {
|
|
598
|
+
generic_consensus_error!(TokenOncePerIdentityDistributionAlreadyClaimedError, e).into()
|
|
599
|
+
}
|
|
600
|
+
StateError::GasFeesPaidByNotAllowedError(e) => {
|
|
601
|
+
generic_consensus_error!(GasFeesPaidByNotAllowedError, e).into()
|
|
602
|
+
}
|
|
603
|
+
StateError::InconsistentGasFeesPaidByInBatchError(e) => {
|
|
604
|
+
generic_consensus_error!(InconsistentGasFeesPaidByInBatchError, e).into()
|
|
605
|
+
}
|
|
606
|
+
StateError::DocumentActionFeeAgreementNotSetError(e) => {
|
|
607
|
+
generic_consensus_error!(DocumentActionFeeAgreementNotSetError, e).into()
|
|
608
|
+
}
|
|
609
|
+
StateError::DocumentActionFeeAgreementMismatchError(e) => {
|
|
610
|
+
generic_consensus_error!(DocumentActionFeeAgreementMismatchError, e).into()
|
|
611
|
+
}
|
|
612
|
+
StateError::DocumentActionFeeMultiplierNotToleratedError(e) => {
|
|
613
|
+
generic_consensus_error!(DocumentActionFeeMultiplierNotToleratedError, e).into()
|
|
614
|
+
}
|
|
615
|
+
StateError::GasSponsorInsufficientBalanceError(e) => {
|
|
616
|
+
generic_consensus_error!(GasSponsorInsufficientBalanceError, e).into()
|
|
617
|
+
}
|
|
618
|
+
StateError::ContractModerationNotEnabledError(e) => {
|
|
619
|
+
generic_consensus_error!(ContractModerationNotEnabledError, e).into()
|
|
620
|
+
}
|
|
621
|
+
StateError::IdentityNotContractModeratorError(e) => {
|
|
622
|
+
generic_consensus_error!(IdentityNotContractModeratorError, e).into()
|
|
623
|
+
}
|
|
624
|
+
StateError::ContractModerationTargetNotAllowedError(e) => {
|
|
625
|
+
generic_consensus_error!(ContractModerationTargetNotAllowedError, e).into()
|
|
626
|
+
}
|
|
627
|
+
StateError::ContractUserAlreadyBannedError(e) => {
|
|
628
|
+
generic_consensus_error!(ContractUserAlreadyBannedError, e).into()
|
|
629
|
+
}
|
|
630
|
+
StateError::ContractUserNotBannedError(e) => {
|
|
631
|
+
generic_consensus_error!(ContractUserNotBannedError, e).into()
|
|
632
|
+
}
|
|
633
|
+
StateError::ContractUserNotSuspendedError(e) => {
|
|
634
|
+
generic_consensus_error!(ContractUserNotSuspendedError, e).into()
|
|
635
|
+
}
|
|
636
|
+
StateError::ContractSuspensionNotInFutureError(e) => {
|
|
637
|
+
generic_consensus_error!(ContractSuspensionNotInFutureError, e).into()
|
|
638
|
+
}
|
|
639
|
+
StateError::ContractUserBannedError(e) => {
|
|
640
|
+
generic_consensus_error!(ContractUserBannedError, e).into()
|
|
641
|
+
}
|
|
642
|
+
StateError::ContractUserSuspendedError(e) => {
|
|
643
|
+
generic_consensus_error!(ContractUserSuspendedError, e).into()
|
|
644
|
+
}
|
|
645
|
+
StateError::ContractModerationTargetNotFoundError(e) => {
|
|
646
|
+
generic_consensus_error!(ContractModerationTargetNotFoundError, e).into()
|
|
647
|
+
}
|
|
648
|
+
StateError::ContractModeratorIdentityNotFoundError(e) => {
|
|
649
|
+
generic_consensus_error!(ContractModeratorIdentityNotFoundError, e).into()
|
|
650
|
+
}
|
|
651
|
+
StateError::ContractModerationCounterpartyBarredError(e) => {
|
|
652
|
+
generic_consensus_error!(ContractModerationCounterpartyBarredError, e).into()
|
|
653
|
+
}
|
|
654
|
+
StateError::ContractFeesAlreadyClaimedThisEpochError(e) => {
|
|
655
|
+
generic_consensus_error!(ContractFeesAlreadyClaimedThisEpochError, e).into()
|
|
656
|
+
}
|
|
657
|
+
StateError::ContractFeesNothingToClaimError(e) => {
|
|
658
|
+
generic_consensus_error!(ContractFeesNothingToClaimError, e).into()
|
|
659
|
+
}
|
|
660
|
+
StateError::ContractFeeClaimNotAllowedError(e) => {
|
|
661
|
+
generic_consensus_error!(ContractFeeClaimNotAllowedError, e).into()
|
|
662
|
+
}
|
|
663
|
+
StateError::ReferencedDocumentTypeNotDeletableError(e) => {
|
|
664
|
+
generic_consensus_error!(ReferencedDocumentTypeNotDeletableError, e).into()
|
|
665
|
+
}
|
|
666
|
+
StateError::DocumentTypeNotDeletableByModeratorsError(e) => {
|
|
667
|
+
generic_consensus_error!(DocumentTypeNotDeletableByModeratorsError, e).into()
|
|
668
|
+
}
|
|
669
|
+
StateError::DocumentModerationWindowElapsedError(e) => {
|
|
670
|
+
generic_consensus_error!(DocumentModerationWindowElapsedError, e).into()
|
|
671
|
+
}
|
|
672
|
+
StateError::ContractDocumentRemovalNotFoundError(e) => {
|
|
673
|
+
generic_consensus_error!(ContractDocumentRemovalNotFoundError, e).into()
|
|
674
|
+
}
|
|
675
|
+
StateError::DocumentRestoreWindowElapsedError(e) => {
|
|
676
|
+
generic_consensus_error!(DocumentRestoreWindowElapsedError, e).into()
|
|
677
|
+
}
|
|
678
|
+
StateError::DocumentRestoreHashMismatchError(e) => {
|
|
679
|
+
generic_consensus_error!(DocumentRestoreHashMismatchError, e).into()
|
|
680
|
+
}
|
|
681
|
+
StateError::ContractDocumentAlreadyRestoredError(e) => {
|
|
682
|
+
generic_consensus_error!(ContractDocumentAlreadyRestoredError, e).into()
|
|
683
|
+
}
|
|
684
|
+
StateError::ContractUserNotWarnedError(e) => {
|
|
685
|
+
generic_consensus_error!(ContractUserNotWarnedError, e).into()
|
|
686
|
+
}
|
|
687
|
+
StateError::ContractUserWarningLimitReachedError(e) => {
|
|
688
|
+
generic_consensus_error!(ContractUserWarningLimitReachedError, e).into()
|
|
689
|
+
}
|
|
690
|
+
StateError::ContractModeratedDocumentTypeNotYetUsableError(e) => {
|
|
691
|
+
generic_consensus_error!(ContractModeratedDocumentTypeNotYetUsableError, e).into()
|
|
692
|
+
}
|
|
693
|
+
StateError::VoteChoiceNotAllowedForVotePollError(e) => {
|
|
694
|
+
generic_consensus_error!(VoteChoiceNotAllowedForVotePollError, e).into()
|
|
695
|
+
}
|
|
696
|
+
StateError::ReferencedContractRequirementNotMetError(e) => {
|
|
697
|
+
generic_consensus_error!(ReferencedContractRequirementNotMetError, e).into()
|
|
698
|
+
}
|
|
699
|
+
StateError::ReferencedIdentityKeyRequirementNotMetError(e) => {
|
|
700
|
+
generic_consensus_error!(ReferencedIdentityKeyRequirementNotMetError, e).into()
|
|
701
|
+
}
|
|
702
|
+
StateError::ReferencedDocumentLookupInvalidError(e) => {
|
|
703
|
+
generic_consensus_error!(ReferencedDocumentLookupInvalidError, e).into()
|
|
704
|
+
}
|
|
705
|
+
StateError::ReferencedDocumentListInvalidError(e) => {
|
|
706
|
+
generic_consensus_error!(ReferencedDocumentListInvalidError, e).into()
|
|
707
|
+
}
|
|
708
|
+
StateError::ContractModerationAbilityNotGrantedError(e) => {
|
|
709
|
+
generic_consensus_error!(ContractModerationAbilityNotGrantedError, e).into()
|
|
710
|
+
}
|
|
711
|
+
StateError::ModerationCharterAddedModeratorLimitReachedError(e) => {
|
|
712
|
+
generic_consensus_error!(ModerationCharterAddedModeratorLimitReachedError, e).into()
|
|
713
|
+
}
|
|
714
|
+
StateError::ModerationReasonNotListedError(e) => {
|
|
715
|
+
generic_consensus_error!(ModerationReasonNotListedError, e).into()
|
|
716
|
+
}
|
|
717
|
+
StateError::DocumentActionFeeModeratorsShareMismatchError(e) => {
|
|
718
|
+
generic_consensus_error!(DocumentActionFeeModeratorsShareMismatchError, e).into()
|
|
719
|
+
}
|
|
561
720
|
}
|
|
562
721
|
}
|
|
563
722
|
|
|
@@ -814,6 +973,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
814
973
|
BasicError::DocumentFieldMaxSizeExceededError(e) => {
|
|
815
974
|
generic_consensus_error!(DocumentFieldMaxSizeExceededError, e).into()
|
|
816
975
|
}
|
|
976
|
+
BasicError::DocumentPropertyNotDistinctError(e) => {
|
|
977
|
+
generic_consensus_error!(DocumentPropertyNotDistinctError, e).into()
|
|
978
|
+
}
|
|
817
979
|
BasicError::ContestedUniqueIndexWithUniqueIndexError(e) => {
|
|
818
980
|
generic_consensus_error!(ContestedUniqueIndexWithUniqueIndexError, e).into()
|
|
819
981
|
}
|
|
@@ -978,6 +1140,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
978
1140
|
BasicError::InvalidTokenDistributionEpochIntervalTooShortError(e) => {
|
|
979
1141
|
generic_consensus_error!(InvalidTokenDistributionEpochIntervalTooShortError, e).into()
|
|
980
1142
|
}
|
|
1143
|
+
BasicError::InvalidTokenOncePerIdentityDistributionAmountError(e) => {
|
|
1144
|
+
generic_consensus_error!(InvalidTokenOncePerIdentityDistributionAmountError, e).into()
|
|
1145
|
+
}
|
|
981
1146
|
BasicError::RedundantDocumentPaidForByTokenWithContractId(e) => {
|
|
982
1147
|
generic_consensus_error!(RedundantDocumentPaidForByTokenWithContractId, e).into()
|
|
983
1148
|
}
|
|
@@ -1114,6 +1279,39 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
1114
1279
|
BasicError::IdentityKeyLimitsUpdateEmptyError(e) => {
|
|
1115
1280
|
generic_consensus_error!(IdentityKeyLimitsUpdateEmptyError, e).into()
|
|
1116
1281
|
}
|
|
1282
|
+
BasicError::PreProgrammedDistributionAmountOverLimitError(e) => {
|
|
1283
|
+
generic_consensus_error!(PreProgrammedDistributionAmountOverLimitError, e).into()
|
|
1284
|
+
}
|
|
1285
|
+
BasicError::InvalidContractModerationConfigError(e) => {
|
|
1286
|
+
generic_consensus_error!(InvalidContractModerationConfigError, e).into()
|
|
1287
|
+
}
|
|
1288
|
+
BasicError::ContractModerationSelfTargetError(e) => {
|
|
1289
|
+
generic_consensus_error!(ContractModerationSelfTargetError, e).into()
|
|
1290
|
+
}
|
|
1291
|
+
BasicError::DocumentActionFeesWithoutModerationError(e) => {
|
|
1292
|
+
generic_consensus_error!(DocumentActionFeesWithoutModerationError, e).into()
|
|
1293
|
+
}
|
|
1294
|
+
BasicError::ContractModerationReasonTooLongError(e) => {
|
|
1295
|
+
generic_consensus_error!(ContractModerationReasonTooLongError, e).into()
|
|
1296
|
+
}
|
|
1297
|
+
BasicError::ModerationCharterMalformedFieldError(e) => {
|
|
1298
|
+
generic_consensus_error!(ModerationCharterMalformedFieldError, e).into()
|
|
1299
|
+
}
|
|
1300
|
+
BasicError::ModerationCharterRewardSplitNotOneHundredError(e) => {
|
|
1301
|
+
generic_consensus_error!(ModerationCharterRewardSplitNotOneHundredError, e).into()
|
|
1302
|
+
}
|
|
1303
|
+
BasicError::InvalidContractModerationReasonDocumentsError(e) => {
|
|
1304
|
+
generic_consensus_error!(InvalidContractModerationReasonDocumentsError, e).into()
|
|
1305
|
+
}
|
|
1306
|
+
BasicError::InvalidEncryptedPropertyShapeError(e) => {
|
|
1307
|
+
generic_consensus_error!(InvalidEncryptedPropertyShapeError, e).into()
|
|
1308
|
+
}
|
|
1309
|
+
BasicError::DocumentPropertyMaxBytesExceededError(e) => {
|
|
1310
|
+
generic_consensus_error!(DocumentPropertyMaxBytesExceededError, e).into()
|
|
1311
|
+
}
|
|
1312
|
+
BasicError::DocumentPropertyConstraintViolatedError(e) => {
|
|
1313
|
+
generic_consensus_error!(DocumentPropertyConstraintViolatedError, e).into()
|
|
1314
|
+
}
|
|
1117
1315
|
}
|
|
1118
1316
|
}
|
|
1119
1317
|
|
|
@@ -92,6 +92,12 @@ impl StateTransitionFactoryWasm {
|
|
|
92
92
|
StateTransition::IdentityKeyLimitsUpdate(_) => Err(JsValue::from_str(
|
|
93
93
|
"identity key limits update transitions are not supported in wasm-dpp StateTransitionFactory; use wasm-dpp2",
|
|
94
94
|
)),
|
|
95
|
+
StateTransition::ContractUserModeration(_) => Err(JsValue::from_str(
|
|
96
|
+
"contract user moderation transitions are not supported in wasm-dpp StateTransitionFactory; use wasm-dpp2",
|
|
97
|
+
)),
|
|
98
|
+
StateTransition::ContractFeeClaim(_) => Err(JsValue::from_str(
|
|
99
|
+
"contract fee claim transitions are not supported in wasm-dpp StateTransitionFactory; use wasm-dpp2",
|
|
100
|
+
)),
|
|
95
101
|
},
|
|
96
102
|
Err(dpp::ProtocolError::StateTransitionError(e)) => match e {
|
|
97
103
|
StateTransitionError::InvalidStateTransitionError {
|
|
@@ -72,7 +72,9 @@ describe('DataContractCreateTransition', () => {
|
|
|
72
72
|
it('should return serialized State Transition', () => {
|
|
73
73
|
const result = stateTransition.toBuffer();
|
|
74
74
|
expect(result).to.be.instanceOf(Buffer);
|
|
75
|
-
|
|
75
|
+
// The fixture contract carries a V2 config (protocol version 14), whose optional
|
|
76
|
+
// moderation declaration is one more bincode byte than a V1 config.
|
|
77
|
+
expect(result).to.have.lengthOf(2371);
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
it('should be able to restore contract config from bytes', () => {
|
|
@@ -66,7 +66,9 @@ describe('DataContractUpdateTransition', () => {
|
|
|
66
66
|
it('should return serialized State Transition', () => {
|
|
67
67
|
const result = stateTransition.toBuffer();
|
|
68
68
|
expect(result).to.be.instanceOf(Buffer);
|
|
69
|
-
|
|
69
|
+
// The fixture contract carries a V2 config (protocol version 14), whose optional
|
|
70
|
+
// moderation declaration is one more bincode byte than a V1 config.
|
|
71
|
+
expect(result).to.have.lengthOf(2371);
|
|
70
72
|
});
|
|
71
73
|
|
|
72
74
|
it('should be able to restore contract config from bytes', () => {
|