@dashevo/wasm-dpp 2.0.0-rc.11 → 2.0.0-rc.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/wasm-dpp",
3
- "version": "2.0.0-rc.11",
3
+ "version": "2.0.0-rc.13",
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": "2.0.0-rc.11",
47
+ "@dashevo/dpns-contract": "2.0.0-rc.13",
48
48
  "@types/bs58": "^4.0.1",
49
49
  "@types/node": "^14.6.0",
50
50
  "@yarnpkg/pnpify": "^4.0.0-rc.42",
@@ -61,12 +61,13 @@ use dpp::consensus::state::data_trigger::DataTriggerError::{
61
61
  DataTriggerConditionError, DataTriggerExecutionError, DataTriggerInvalidResultError,
62
62
  };
63
63
  use wasm_bindgen::{JsError, JsValue};
64
- use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError, ContestedUniqueIndexWithUniqueIndexError, DataContractTokenConfigurationUpdateError, DecimalsOverLimitError, DuplicateKeywordsError, GroupExceedsMaxMembersError, GroupMemberHasPowerOfZeroError, GroupMemberHasPowerOverLimitError, GroupNonUnilateralMemberPowerHasLessThanRequiredPowerError, GroupPositionDoesNotExistError, GroupRequiredPowerIsInvalidError, GroupTotalPowerLessThanRequiredError, InvalidDescriptionLengthError, InvalidDocumentTypeRequiredSecurityLevelError, InvalidKeywordCharacterError, InvalidKeywordLengthError, InvalidTokenBaseSupplyError, InvalidTokenDistributionFunctionDivideByZeroError, InvalidTokenDistributionFunctionIncoherenceError, InvalidTokenDistributionFunctionInvalidParameterError, InvalidTokenDistributionFunctionInvalidParameterTupleError, InvalidTokenLanguageCodeError, InvalidTokenNameCharacterError, InvalidTokenNameLengthError, MainGroupIsNotDefinedError, NewTokensDestinationIdentityOptionRequiredError, NonContiguousContractGroupPositionsError, NonContiguousContractTokenPositionsError, TokenPaymentByBurningOnlyAllowedOnInternalTokenError, TooManyKeywordsError, UnknownDocumentActionTokenEffectError, UnknownDocumentCreationRestrictionModeError, UnknownGasFeesPaidByError, UnknownSecurityLevelError, UnknownStorageKeyRequirementsError, UnknownTradeModeError, UnknownTransferableTypeError};
64
+ use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError, ContestedUniqueIndexWithUniqueIndexError, DataContractTokenConfigurationUpdateError, DecimalsOverLimitError, DuplicateKeywordsError, GroupExceedsMaxMembersError, 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};
65
65
  use dpp::consensus::basic::document::{ContestedDocumentsTemporarilyNotAllowedError, DocumentCreationNotAllowedError, DocumentFieldMaxSizeExceededError, MaxDocumentsTransitionsExceededError, MissingPositionsInDocumentTypePropertiesError};
66
66
  use dpp::consensus::basic::group::GroupActionNotAllowedOnTransitionError;
67
67
  use dpp::consensus::basic::identity::{DataContractBoundsNotPresentError, DisablingKeyIdAlsoBeingAddedInSameTransitionError, InvalidIdentityCreditWithdrawalTransitionAmountError, InvalidIdentityUpdateTransitionDisableKeysError, InvalidIdentityUpdateTransitionEmptyError, TooManyMasterPublicKeyError, WithdrawalOutputScriptNotAllowedWhenSigningWithOwnerKeyError};
68
68
  use dpp::consensus::basic::overflow_error::OverflowError;
69
69
  use dpp::consensus::basic::token::{ChoosingTokenMintRecipientNotAllowedError, ContractHasNoTokensError, DestinationIdentityForTokenMintingNotSetError, InvalidActionIdError, InvalidTokenAmountError, InvalidTokenConfigUpdateNoChangeError, InvalidTokenIdError, InvalidTokenNoteTooBigError, InvalidTokenPositionError, MissingDefaultLocalizationError, TokenNoteOnlyAllowedWhenProposerError, TokenTransferToOurselfError};
70
+ use dpp::consensus::state::data_contract::data_contract_not_found_error::DataContractNotFoundError;
70
71
  use dpp::consensus::state::data_contract::data_contract_update_action_not_allowed_error::DataContractUpdateActionNotAllowedError;
71
72
  use dpp::consensus::state::data_contract::document_type_update_error::DocumentTypeUpdateError;
72
73
  use dpp::consensus::state::document::document_contest_currently_locked_error::DocumentContestCurrentlyLockedError;
@@ -86,7 +87,7 @@ use dpp::consensus::state::identity::no_transfer_key_for_core_withdrawal_availab
86
87
  use dpp::consensus::state::identity::RecipientIdentityDoesNotExistError;
87
88
  use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_insufficient_error::PrefundedSpecializedBalanceInsufficientError;
88
89
  use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError;
89
- 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};
90
+ 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};
90
91
  use dpp::consensus::state::voting::masternode_incorrect_voter_identity_id_error::MasternodeIncorrectVoterIdentityIdError;
91
92
  use dpp::consensus::state::voting::masternode_incorrect_voting_address_error::MasternodeIncorrectVotingAddressError;
92
93
  use dpp::consensus::state::voting::masternode_not_found_error::MasternodeNotFoundError;
@@ -423,6 +424,12 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
423
424
  StateError::IdentityToFreezeDoesNotExistError(e) => {
424
425
  generic_consensus_error!(IdentityToFreezeDoesNotExistError, e).into()
425
426
  }
427
+ StateError::DataContractNotFoundError(e) => {
428
+ generic_consensus_error!(DataContractNotFoundError, e).into()
429
+ }
430
+ StateError::InvalidTokenPositionStateError(e) => {
431
+ generic_consensus_error!(InvalidTokenPositionStateError, e).into()
432
+ }
426
433
  }
427
434
  }
428
435
 
@@ -824,6 +831,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
824
831
  BasicError::TokenNoteOnlyAllowedWhenProposerError(e) => {
825
832
  generic_consensus_error!(TokenNoteOnlyAllowedWhenProposerError, e).into()
826
833
  }
834
+ BasicError::RedundantDocumentPaidForByTokenWithContractId(e) => {
835
+ generic_consensus_error!(RedundantDocumentPaidForByTokenWithContractId, e).into()
836
+ }
827
837
  }
828
838
  }
829
839
 
@@ -66,7 +66,7 @@ describe('DataContractCreateTransition', () => {
66
66
  it('should return serialized State Transition', () => {
67
67
  const result = stateTransition.toBuffer();
68
68
  expect(result).to.be.instanceOf(Buffer);
69
- expect(result).to.have.lengthOf(2360);
69
+ expect(result).to.have.lengthOf(2359);
70
70
  });
71
71
 
72
72
  it('should be able to restore contract config from bytes', () => {
@@ -65,7 +65,7 @@ describe('DataContractUpdateTransition', () => {
65
65
  it('should return serialized State Transition', () => {
66
66
  const result = stateTransition.toBuffer();
67
67
  expect(result).to.be.instanceOf(Buffer);
68
- expect(result).to.have.lengthOf(2360);
68
+ expect(result).to.have.lengthOf(2359);
69
69
  });
70
70
 
71
71
  it('should be able to restore contract config from bytes', () => {