pshenmic-dpp 1.1.2-dev.8 → 2.0.0-dev.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.
Files changed (324) hide show
  1. package/README.md +14 -99
  2. package/dist/binaries/bindingsTypes.d.ts +1700 -0
  3. package/dist/binaries/bindingsTypes.js +99 -0
  4. package/dist/binaries/pshenmic_dpp.android.node/react-native-node-api-module +0 -0
  5. package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
  6. package/dist/binaries/pshenmic_dpp.d.ts +166 -0
  7. package/dist/binaries/pshenmic_dpp.js +3 -0
  8. package/dist/binaries/wasm/wasmBytes.d.ts +2 -0
  9. package/dist/binaries/wasm/wasmBytes.js +2 -0
  10. package/dist/binaries/wasm.d.ts +166 -0
  11. package/dist/binaries/wasm.js +44 -0
  12. package/dist/src/dpp/constants.d.ts +4 -0
  13. package/dist/src/dpp/constants.js +19 -0
  14. package/dist/src/dpp/dpp.d.ts +110 -0
  15. package/dist/src/dpp/dpp.js +110 -0
  16. package/dist/src/dpp/enums.d.ts +1 -0
  17. package/dist/src/dpp/enums.js +1 -0
  18. package/dist/src/dpp/provider.d.ts +11 -0
  19. package/dist/src/dpp/provider.js +21 -0
  20. package/dist/src/dpp/structs/Address/AddressWitness.d.ts +12 -0
  21. package/dist/src/dpp/structs/Address/AddressWitness.js +23 -0
  22. package/dist/src/dpp/structs/Address/PlatformAddress.d.ts +14 -0
  23. package/dist/src/dpp/structs/Address/PlatformAddress.js +32 -0
  24. package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +38 -0
  25. package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +95 -0
  26. package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +35 -0
  27. package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +85 -0
  28. package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +30 -0
  29. package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +72 -0
  30. package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +33 -0
  31. package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +82 -0
  32. package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts +31 -0
  33. package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +77 -0
  34. package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +31 -0
  35. package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +76 -0
  36. package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.d.ts +12 -0
  37. package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.js +26 -0
  38. package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.d.ts +14 -0
  39. package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +32 -0
  40. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +12 -0
  41. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +26 -0
  42. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +12 -0
  43. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +29 -0
  44. package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.d.ts +19 -0
  45. package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +50 -0
  46. package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.d.ts +17 -0
  47. package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.js +36 -0
  48. package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.d.ts +24 -0
  49. package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.js +48 -0
  50. package/dist/src/dpp/structs/AssetLockProof/OutPoint.d.ts +15 -0
  51. package/dist/src/dpp/structs/AssetLockProof/OutPoint.js +40 -0
  52. package/dist/src/dpp/structs/AssetLockProof/Transaction.d.ts +20 -0
  53. package/dist/src/dpp/structs/AssetLockProof/Transaction.js +49 -0
  54. package/dist/src/dpp/structs/AssetLockProof/TxIn.d.ts +17 -0
  55. package/dist/src/dpp/structs/AssetLockProof/TxIn.js +39 -0
  56. package/dist/src/dpp/structs/AssetLockProof/TxOut.d.ts +13 -0
  57. package/dist/src/dpp/structs/AssetLockProof/TxOut.js +34 -0
  58. package/dist/src/dpp/structs/AssetLockProof/Witness.d.ts +11 -0
  59. package/dist/src/dpp/structs/AssetLockProof/Witness.js +25 -0
  60. package/dist/src/dpp/structs/Batch/BatchTransition.d.ts +34 -0
  61. package/dist/src/dpp/structs/Batch/BatchTransition.js +95 -0
  62. package/dist/src/dpp/structs/Batch/BatchedTransition.d.ts +14 -0
  63. package/dist/src/dpp/structs/Batch/BatchedTransition.js +39 -0
  64. package/dist/src/dpp/structs/Batch/DocumentBaseTransition.d.ts +20 -0
  65. package/dist/src/dpp/structs/Batch/DocumentBaseTransition.js +54 -0
  66. package/dist/src/dpp/structs/Batch/DocumentTransition.d.ts +32 -0
  67. package/dist/src/dpp/structs/Batch/DocumentTransition.js +74 -0
  68. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.d.ts +23 -0
  69. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.js +58 -0
  70. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.d.ts +14 -0
  71. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.js +26 -0
  72. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.d.ts +19 -0
  73. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.js +39 -0
  74. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.d.ts +19 -0
  75. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.js +40 -0
  76. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.d.ts +19 -0
  77. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.js +35 -0
  78. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.d.ts +17 -0
  79. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.js +33 -0
  80. package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.d.ts +9 -0
  81. package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.js +19 -0
  82. package/dist/src/dpp/structs/Batch/TokenBaseTransition.d.ts +20 -0
  83. package/dist/src/dpp/structs/Batch/TokenBaseTransition.js +49 -0
  84. package/dist/src/dpp/structs/Batch/TokenPaymentInfo.d.ts +19 -0
  85. package/dist/src/dpp/structs/Batch/TokenPaymentInfo.js +54 -0
  86. package/dist/src/dpp/structs/Batch/TokenPricingSchedule.d.ts +17 -0
  87. package/dist/src/dpp/structs/Batch/TokenPricingSchedule.js +41 -0
  88. package/dist/src/dpp/structs/Batch/TokenTransition.d.ts +20 -0
  89. package/dist/src/dpp/structs/Batch/TokenTransition.js +92 -0
  90. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.d.ts +14 -0
  91. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.js +32 -0
  92. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.d.ts +15 -0
  93. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.js +33 -0
  94. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.d.ts +15 -0
  95. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.js +33 -0
  96. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.d.ts +16 -0
  97. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.js +34 -0
  98. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.d.ts +14 -0
  99. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.js +32 -0
  100. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.d.ts +15 -0
  101. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.js +33 -0
  102. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.d.ts +16 -0
  103. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.js +34 -0
  104. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.d.ts +18 -0
  105. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.js +43 -0
  106. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.d.ts +15 -0
  107. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.js +36 -0
  108. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.d.ts +21 -0
  109. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +53 -0
  110. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.d.ts +16 -0
  111. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.js +34 -0
  112. package/dist/src/dpp/structs/ConsensusError.d.ts +8 -0
  113. package/dist/src/dpp/structs/ConsensusError.js +22 -0
  114. package/dist/src/dpp/structs/ContractBounds.d.ts +17 -0
  115. package/dist/src/dpp/structs/ContractBounds.js +39 -0
  116. package/dist/src/dpp/structs/CoreScript.d.ts +15 -0
  117. package/dist/src/dpp/structs/CoreScript.js +37 -0
  118. package/dist/src/dpp/structs/DataContract.d.ts +36 -0
  119. package/dist/src/dpp/structs/DataContract.js +119 -0
  120. package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.d.ts +23 -0
  121. package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +55 -0
  122. package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.d.ts +23 -0
  123. package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +55 -0
  124. package/dist/src/dpp/structs/Document.d.ts +51 -0
  125. package/dist/src/dpp/structs/Document.js +184 -0
  126. package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.d.ts +13 -0
  127. package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.js +31 -0
  128. package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.d.ts +13 -0
  129. package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.js +31 -0
  130. package/dist/src/dpp/structs/GroupStateTransitionInfo.d.ts +15 -0
  131. package/dist/src/dpp/structs/GroupStateTransitionInfo.js +33 -0
  132. package/dist/src/dpp/structs/Identifier.d.ts +17 -0
  133. package/dist/src/dpp/structs/Identifier.js +50 -0
  134. package/dist/src/dpp/structs/Identity.d.ts +26 -0
  135. package/dist/src/dpp/structs/Identity.js +73 -0
  136. package/dist/src/dpp/structs/IdentityPublicKey.d.ts +43 -0
  137. package/dist/src/dpp/structs/IdentityPublicKey.js +126 -0
  138. package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +30 -0
  139. package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +77 -0
  140. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.d.ts +29 -0
  141. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +69 -0
  142. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.d.ts +33 -0
  143. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +85 -0
  144. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.d.ts +42 -0
  145. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +114 -0
  146. package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.d.ts +30 -0
  147. package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +75 -0
  148. package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.d.ts +40 -0
  149. package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +108 -0
  150. package/dist/src/dpp/structs/InstantLock.d.ts +17 -0
  151. package/dist/src/dpp/structs/InstantLock.js +43 -0
  152. package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.d.ts +37 -0
  153. package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +96 -0
  154. package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.d.ts +14 -0
  155. package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.js +29 -0
  156. package/dist/src/dpp/structs/MasternodeVote/Vote.d.ts +13 -0
  157. package/dist/src/dpp/structs/MasternodeVote/Vote.js +27 -0
  158. package/dist/src/dpp/structs/MasternodeVote/VotePoll.d.ts +18 -0
  159. package/dist/src/dpp/structs/MasternodeVote/VotePoll.js +42 -0
  160. package/dist/src/dpp/structs/PartialIdentity.d.ts +26 -0
  161. package/dist/src/dpp/structs/PartialIdentity.js +69 -0
  162. package/dist/src/dpp/structs/PrivateKey.d.ts +20 -0
  163. package/dist/src/dpp/structs/PrivateKey.js +48 -0
  164. package/dist/src/dpp/structs/PublicKey.d.ts +15 -0
  165. package/dist/src/dpp/structs/PublicKey.js +37 -0
  166. package/dist/src/dpp/structs/StateTransition.d.ts +38 -0
  167. package/dist/src/dpp/structs/StateTransition.js +100 -0
  168. package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.d.ts +12 -0
  169. package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.js +44 -0
  170. package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.d.ts +16 -0
  171. package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.js +43 -0
  172. package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.d.ts +23 -0
  173. package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.js +52 -0
  174. package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.d.ts +19 -0
  175. package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.js +57 -0
  176. package/dist/src/dpp/structs/TokenConfiguration/Group.d.ts +19 -0
  177. package/dist/src/dpp/structs/TokenConfiguration/Group.js +44 -0
  178. package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.d.ts +13 -0
  179. package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.js +40 -0
  180. package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.d.ts +54 -0
  181. package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.js +139 -0
  182. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.d.ts +47 -0
  183. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.js +140 -0
  184. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.d.ts +19 -0
  185. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.js +47 -0
  186. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.d.ts +15 -0
  187. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.js +34 -0
  188. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.d.ts +14 -0
  189. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.js +31 -0
  190. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.d.ts +28 -0
  191. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.js +75 -0
  192. package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.d.ts +19 -0
  193. package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.js +49 -0
  194. package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.d.ts +13 -0
  195. package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.js +27 -0
  196. package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.d.ts +13 -0
  197. package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.js +27 -0
  198. package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.d.ts +21 -0
  199. package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.js +42 -0
  200. package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.d.ts +9 -0
  201. package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.js +17 -0
  202. package/dist/src/dpp/types.d.ts +273 -0
  203. package/dist/src/dpp/types.js +1 -0
  204. package/dist/src/dpp/utils.d.ts +5 -0
  205. package/dist/src/dpp/utils.js +78 -0
  206. package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.d.ts +3 -0
  207. package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +34 -0
  208. package/dist/src/dpp/verify/Contract/verifyContract.d.ts +2 -0
  209. package/dist/src/dpp/verify/Contract/verifyContract.js +14 -0
  210. package/dist/src/dpp/verify/Document/verifyDocumentsProof.d.ts +3 -0
  211. package/dist/src/dpp/verify/Document/verifyDocumentsProof.js +10 -0
  212. package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.d.ts +2 -0
  213. package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.js +10 -0
  214. package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.d.ts +2 -0
  215. package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.js +9 -0
  216. package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.d.ts +2 -0
  217. package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.js +10 -0
  218. package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.d.ts +2 -0
  219. package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.js +10 -0
  220. package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.d.ts +2 -0
  221. package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.js +9 -0
  222. package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.d.ts +2 -0
  223. package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.js +10 -0
  224. package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.d.ts +2 -0
  225. package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.js +9 -0
  226. package/dist/src/dpp/verify/StateTransition/utils.d.ts +2 -0
  227. package/dist/src/dpp/verify/StateTransition/utils.js +115 -0
  228. package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.d.ts +4 -0
  229. package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.js +10 -0
  230. package/dist/src/dpp/verify/System/verifyEpochsInfoProof.d.ts +2 -0
  231. package/dist/src/dpp/verify/System/verifyEpochsInfoProof.js +16 -0
  232. package/dist/src/dpp/verify/System/verifyTotalCreditsProof.d.ts +2 -0
  233. package/dist/src/dpp/verify/System/verifyTotalCreditsProof.js +9 -0
  234. package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.d.ts +2 -0
  235. package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.js +13 -0
  236. package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.d.ts +2 -0
  237. package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.js +15 -0
  238. package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.d.ts +2 -0
  239. package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.js +14 -0
  240. package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.d.ts +2 -0
  241. package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.js +12 -0
  242. package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.d.ts +2 -0
  243. package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.js +13 -0
  244. package/dist/src/dpp/verify/verifySignatureDigest.d.ts +1 -0
  245. package/dist/src/dpp/verify/verifySignatureDigest.js +4 -0
  246. package/dist/src/react-native.d.ts +3 -0
  247. package/dist/src/react-native.js +6 -0
  248. package/dist/src/wasm.d.ts +3 -0
  249. package/dist/src/wasm.js +6 -0
  250. package/dist/utils/base122.d.ts +7 -0
  251. package/dist/utils/base122.js +63 -0
  252. package/package.json +30 -27
  253. package/tests/unit/DynamicValue.spec.ts +86 -0
  254. package/tests/unit/Identifier.spec.ts +105 -0
  255. package/tests/unit/Identity.spec.ts +119 -0
  256. package/tests/unit/IdentityPublicKey.spec.ts +126 -0
  257. package/dist/wasm/base122.d.ts +0 -1
  258. package/dist/wasm/base122.js +0 -67
  259. package/dist/wasm/index.d.ts +0 -148
  260. package/dist/wasm/index.js +0 -13
  261. package/dist/wasm/initAsync.d.ts +0 -4
  262. package/dist/wasm/initAsync.js +0 -20
  263. package/dist/wasm/initInterface.d.ts +0 -3
  264. package/dist/wasm/initInterface.js +0 -46
  265. package/dist/wasm/initWASM.d.ts +0 -1
  266. package/dist/wasm/initWASM.js +0 -28
  267. package/dist/wasm/pshenmic_dpp.d.ts +0 -5266
  268. package/dist/wasm/pshenmic_dpp.js +0 -25608
  269. package/dist/wasm/pshenmic_dpp_bg.d.ts +0 -3
  270. package/dist/wasm/pshenmic_dpp_bg.js +0 -2
  271. package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +0 -1636
  272. package/dist/wasm/pshenmic_dpp_zipped.d.ts +0 -3
  273. package/dist/wasm/pshenmic_dpp_zipped.js +0 -2
  274. package/dist/wasm/snippets/pshenmic_dpp_utils-23ab7381b198778d/stringify.js +0 -7
  275. package/tests/AssetLockProof.spec.cjs +0 -96
  276. package/tests/AsyncImportTest.spec.cjs +0 -930
  277. package/tests/AuthorizedActionTakers.spec.cjs +0 -75
  278. package/tests/BatchTransition.spec.cjs +0 -141
  279. package/tests/ChainLockProof.spec.cjs +0 -63
  280. package/tests/ChangeControlRules.spec.cjs +0 -184
  281. package/tests/CoreScript.spec.cjs +0 -37
  282. package/tests/DataContract.spec.cjs +0 -170
  283. package/tests/DataContractCreateStateTransition.spec.cjs +0 -102
  284. package/tests/DataContractUpdateStateTransition.spec.cjs +0 -103
  285. package/tests/DistributionFunction.spec.cjs +0 -416
  286. package/tests/Document.spec.cjs +0 -227
  287. package/tests/DocumentTransition.spec.cjs +0 -94
  288. package/tests/DocumentsTransitions.spec.cjs +0 -699
  289. package/tests/Identifier.spec.cjs +0 -82
  290. package/tests/Identity.spec.cjs +0 -107
  291. package/tests/IdentityCreateTransition.spec.cjs +0 -87
  292. package/tests/IdentityCreditTransferTransition.spec.cjs +0 -140
  293. package/tests/IdentityCreditWithdrawalTransition.spec.cjs +0 -186
  294. package/tests/IdentityPublicKey.spec.cjs +0 -166
  295. package/tests/IdentityTopUpTransition.spec.cjs +0 -125
  296. package/tests/IdentityUpdateTransition.spec.cjs +0 -141
  297. package/tests/InstantLockProof.spec.cjs +0 -91
  298. package/tests/OutPoint.spec.cjs +0 -49
  299. package/tests/PrivateKey.spec.cjs +0 -67
  300. package/tests/PublicKeyInCreation.spec.cjs +0 -252
  301. package/tests/RewardDistributionType.spec.cjs +0 -90
  302. package/tests/TokenBaseTransition.spec.cjs +0 -96
  303. package/tests/TokenConfiguration.spec.cjs +0 -188
  304. package/tests/TokenConfigurationConvention.spec.cjs +0 -93
  305. package/tests/TokenConfigurationLocalization.spec.cjs +0 -59
  306. package/tests/TokenDistributionRecipient.spec.cjs +0 -49
  307. package/tests/TokenDistributionRules.spec.cjs +0 -313
  308. package/tests/TokenKeepsHistoryRules.spec.cjs +0 -67
  309. package/tests/TokenPerpetualDistribution.spec.cjs +0 -130
  310. package/tests/TokenPreProgrammedDistribution.spec.cjs +0 -61
  311. package/tests/TokensTransitions.spec.cjs +0 -509
  312. package/tests/TxOut.spec.cjs +0 -70
  313. package/tests/mocks/DataContract/DataContract.json +0 -164
  314. package/tests/mocks/DataContract/index.js +0 -6
  315. package/tests/mocks/Document/DataContract.json +0 -23
  316. package/tests/mocks/Document/document.json +0 -3
  317. package/tests/mocks/Document/document2.json +0 -3
  318. package/tests/mocks/Document/index.js +0 -13
  319. package/tests/mocks/Identity/index.js +0 -13
  320. package/tests/mocks/Locks/index.js +0 -2
  321. package/tests/mocks/PrivateKey/index.js +0 -5
  322. package/tests/mocks/PublicKey/index.js +0 -13
  323. package/tests/mocks/TokenConfiguration/index.js +0 -5
  324. package/tests/utils/hex.js +0 -14
@@ -1,930 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const {
4
- document, dataContractId, ownerId, documentTypeName, revision, dataContractValue, id, document2, documentBytes
5
- } = require('./mocks/Document/index.js')
6
- const { fromHexString } = require('./utils/hex')
7
- const { initModule } = require('pshenmic-dpp/initAsync')
8
-
9
- let wasm
10
-
11
- describe('Async Import', function () {
12
- before(async () => {
13
- wasm = await initModule()
14
- })
15
-
16
- describe('Document', function () {
17
- describe('serialization / deserialization', function () {
18
- it('should allows to create Document from values', function () {
19
- const dataContractIdentifier = new wasm.IdentifierWASM(dataContractId)
20
- const ownerIdentifier = new wasm.IdentifierWASM(ownerId)
21
-
22
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractIdentifier, ownerIdentifier)
23
-
24
- assert.notEqual(documentInstance.__wbg_ptr, 0)
25
- })
26
-
27
- it('should allows to create Document from values with custom id', function () {
28
- const dataContractIdentifier = new wasm.IdentifierWASM(dataContractId)
29
- const ownerIdentifier = new wasm.IdentifierWASM(ownerId)
30
- const identifier = new wasm.IdentifierWASM(id)
31
-
32
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractIdentifier, ownerIdentifier, identifier)
33
-
34
- assert.notEqual(documentInstance.__wbg_ptr, 0)
35
- })
36
-
37
- it('should allows to create Document from bytes and convert to bytes', function () {
38
- const dataContract = wasm.DataContractWASM.fromValue(dataContractValue, false)
39
- const documentInstance = wasm.DocumentWASM.fromBytes(fromHexString(documentBytes), dataContract, 'note')
40
-
41
- const bytes = documentInstance.bytes(dataContract, wasm.PlatformVersionWASM.PLATFORM_V1)
42
-
43
- assert.equal(documentInstance.dataContractId.base58(), dataContract.id.base58())
44
- assert.deepEqual(bytes, fromHexString(documentBytes))
45
- assert.notEqual(dataContract.__wbg_ptr, 0)
46
- })
47
- })
48
-
49
- describe('getters', function () {
50
- it('should return document id', () => {
51
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
52
-
53
- assert.deepEqual(documentInstance.id.base58(), id)
54
- })
55
-
56
- it('should return owner id', () => {
57
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
58
-
59
- assert.deepEqual(documentInstance.ownerId.base58(), ownerId)
60
- })
61
-
62
- it('should return data contract id', () => {
63
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
64
-
65
- assert.deepEqual(documentInstance.dataContractId.base58(), dataContractId)
66
- })
67
-
68
- it('should return properties', () => {
69
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
70
-
71
- assert.deepEqual(documentInstance.properties, document)
72
- })
73
-
74
- it('should return revision', () => {
75
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
76
-
77
- assert.deepEqual(documentInstance.revision, revision)
78
- })
79
- })
80
-
81
- describe('setters', function () {
82
- it('should allow to set document id', () => {
83
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
84
-
85
- documentInstance.id = ownerId
86
-
87
- assert.deepEqual(documentInstance.id.base58(), ownerId)
88
- })
89
-
90
- it('should allow to set document owner id', () => {
91
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
92
-
93
- documentInstance.ownerId = id
94
-
95
- assert.deepEqual(documentInstance.ownerId.base58(), id)
96
- })
97
-
98
- it('should allow to set entropy', () => {
99
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
100
-
101
- const newEntropy = new Array(documentInstance.entropy.length).fill(0)
102
-
103
- documentInstance.entropy = newEntropy
104
-
105
- assert.deepEqual(Array.from(documentInstance.entropy), newEntropy)
106
- })
107
-
108
- it('should allow to set properties', () => {
109
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
110
-
111
- documentInstance.properties = document2
112
-
113
- assert.deepEqual(documentInstance.properties, document2)
114
- })
115
-
116
- it('should allow to set revision', () => {
117
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
118
-
119
- const newRevision = BigInt(1000)
120
-
121
- documentInstance.revision = newRevision
122
-
123
- assert.deepEqual(documentInstance.revision, newRevision)
124
- })
125
-
126
- it('should allow to set created at', () => {
127
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
128
-
129
- const createdAt = BigInt(new Date(1123).getTime())
130
-
131
- documentInstance.createdAt = createdAt
132
-
133
- assert.deepEqual(documentInstance.createdAt, createdAt)
134
- })
135
-
136
- it('should allow to set updated at', () => {
137
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
138
-
139
- const updatedAt = BigInt(new Date(1123).getTime())
140
-
141
- documentInstance.updatedAt = updatedAt
142
-
143
- assert.deepEqual(documentInstance.updatedAt, updatedAt)
144
- })
145
-
146
- it('should allow to set transferred at', () => {
147
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
148
-
149
- const transferredAt = BigInt(new Date(11231).getTime())
150
-
151
- documentInstance.transferredAt = transferredAt
152
-
153
- assert.deepEqual(documentInstance.transferredAt, transferredAt)
154
- })
155
-
156
- it('should allow to set create at Block Height', () => {
157
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
158
-
159
- const createdAtHeight = BigInt(9172)
160
-
161
- documentInstance.createdAtBlockHeight = createdAtHeight
162
-
163
- assert.deepEqual(documentInstance.createdAtBlockHeight, createdAtHeight)
164
- })
165
-
166
- it('should allow to set updated at Block Height', () => {
167
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
168
-
169
- const updatedAtHeight = BigInt(9172)
170
-
171
- documentInstance.updatedAtBlockHeight = updatedAtHeight
172
-
173
- assert.deepEqual(documentInstance.updatedAtBlockHeight, updatedAtHeight)
174
- })
175
-
176
- it('should allow to set transferred at Block Height', () => {
177
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
178
-
179
- const transferredAtHeight = BigInt(9172)
180
-
181
- documentInstance.transferredAtBlockHeight = transferredAtHeight
182
-
183
- assert.deepEqual(documentInstance.transferredAtBlockHeight, transferredAtHeight)
184
- })
185
-
186
- it('should allow to set create at core Block Height', () => {
187
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
188
-
189
- const createdAtHeight = 91721
190
-
191
- documentInstance.createdAtCoreBlockHeight = createdAtHeight
192
-
193
- assert.deepEqual(documentInstance.createdAtCoreBlockHeight, createdAtHeight)
194
- })
195
-
196
- it('should allow to set updated at Block Height', () => {
197
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
198
-
199
- const updatedAtHeight = 91722
200
-
201
- documentInstance.updatedAtCoreBlockHeight = updatedAtHeight
202
-
203
- assert.deepEqual(documentInstance.updatedAtCoreBlockHeight, updatedAtHeight)
204
- })
205
-
206
- it('should allow to set transferred at Block Height', () => {
207
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
208
-
209
- const transferredAtHeight = 91723
210
-
211
- documentInstance.transferredAtCoreBlockHeight = transferredAtHeight
212
-
213
- assert.deepEqual(documentInstance.transferredAtCoreBlockHeight, transferredAtHeight)
214
- })
215
-
216
- it('should allow to set document type name', () => {
217
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
218
-
219
- const newDocumentTypeName = 'bbbb'
220
-
221
- documentInstance.documentTypeName = newDocumentTypeName
222
-
223
- assert.deepEqual(documentInstance.documentTypeName, newDocumentTypeName)
224
- })
225
- })
226
-
227
- describe('static', function () {
228
- it('should allow to generate id', () => {
229
- const generatedId = wasm.DocumentWASM.generateId('note', ownerId, dataContractId)
230
-
231
- assert.equal(Array.from(generatedId).length, 32)
232
- })
233
- })
234
- })
235
-
236
- describe('DocumentsTransitions', function () {
237
- describe('serialization / deserialization', function () {
238
- describe('document Create transition', function () {
239
- it('should allow to create CreateTransition from document', () => {
240
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
241
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
242
-
243
- assert.notEqual(documentInstance.__wbg_ptr, 0)
244
- assert.notEqual(createTransition.__wbg_ptr, 0)
245
- })
246
-
247
- it('should allow to create Document Transition from Create transition', () => {
248
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
249
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
250
-
251
- const documentTransition = createTransition.toDocumentTransition()
252
-
253
- assert.notEqual(documentInstance.__wbg_ptr, 0)
254
- assert.notEqual(createTransition.__wbg_ptr, 0)
255
- assert.notEqual(documentTransition.__wbg_ptr, 0)
256
- })
257
-
258
- it('should allow to create Document Batch Transition from Document Transitions', () => {
259
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
260
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
261
-
262
- const documentTransition = createTransition.toDocumentTransition()
263
-
264
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
265
-
266
- assert.notEqual(documentInstance.__wbg_ptr, 0)
267
- assert.notEqual(createTransition.__wbg_ptr, 0)
268
- assert.notEqual(documentTransition.__wbg_ptr, 0)
269
- assert.notEqual(batchTransition.__wbg_ptr, 0)
270
- })
271
-
272
- it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
273
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
274
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
275
-
276
- const documentTransition = createTransition.toDocumentTransition()
277
-
278
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
279
-
280
- const st = batchTransition.toStateTransition()
281
-
282
- const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
283
-
284
- const deserializedTransitions = deserializedBatch.transitions
285
-
286
- assert.equal(deserializedTransitions.length, 2)
287
-
288
- const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().createTransition
289
-
290
- assert.notEqual(documentInstance.__wbg_ptr, 0)
291
- assert.notEqual(createTransition.__wbg_ptr, 0)
292
- assert.notEqual(documentTransition.__wbg_ptr, 0)
293
- assert.notEqual(batchTransition.__wbg_ptr, 0)
294
- assert.notEqual(st.__wbg_ptr, 0)
295
- assert.notEqual(deserializedBatch.__wbg_ptr, 0)
296
- assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
297
- })
298
- })
299
-
300
- describe('document Delete transition', function () {
301
- it('should allow to create DeleteTransition from document', () => {
302
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
303
- const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
304
-
305
- assert.notEqual(documentInstance.__wbg_ptr, 0)
306
- assert.notEqual(deleteTransition.__wbg_ptr, 0)
307
- })
308
-
309
- it('should allow to create Document Transition from Delete transition', () => {
310
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
311
- const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
312
-
313
- const documentTransition = deleteTransition.toDocumentTransition()
314
-
315
- assert.notEqual(documentInstance.__wbg_ptr, 0)
316
- assert.notEqual(deleteTransition.__wbg_ptr, 0)
317
- assert.notEqual(documentTransition.__wbg_ptr, 0)
318
- })
319
-
320
- it('should allow to create Document Batch Transition from Document Transitions', () => {
321
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
322
- const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
323
-
324
- const documentTransition = deleteTransition.toDocumentTransition()
325
-
326
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
327
-
328
- assert.notEqual(documentInstance.__wbg_ptr, 0)
329
- assert.notEqual(deleteTransition.__wbg_ptr, 0)
330
- assert.notEqual(documentTransition.__wbg_ptr, 0)
331
- assert.notEqual(batchTransition.__wbg_ptr, 0)
332
- })
333
-
334
- it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
335
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
336
- const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
337
-
338
- const documentTransition = deleteTransition.toDocumentTransition()
339
-
340
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
341
-
342
- const st = batchTransition.toStateTransition()
343
-
344
- const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
345
-
346
- const deserializedTransitions = deserializedBatch.transitions
347
-
348
- assert.equal(deserializedTransitions.length, 2)
349
-
350
- const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().deleteTransition
351
-
352
- assert.notEqual(documentInstance.__wbg_ptr, 0)
353
- assert.notEqual(deleteTransition.__wbg_ptr, 0)
354
- assert.notEqual(documentTransition.__wbg_ptr, 0)
355
- assert.notEqual(batchTransition.__wbg_ptr, 0)
356
- assert.notEqual(st.__wbg_ptr, 0)
357
- assert.notEqual(deserializedBatch.__wbg_ptr, 0)
358
- assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
359
- })
360
- })
361
-
362
- describe('document Replace transition', function () {
363
- it('should allow to create ReplaceTransition from document', () => {
364
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
365
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
366
-
367
- assert.notEqual(documentInstance.__wbg_ptr, 0)
368
- assert.notEqual(replaceTransition.__wbg_ptr, 0)
369
- })
370
-
371
- it('should allow to create Document Transition from Replace transition', () => {
372
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
373
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
374
-
375
- const documentTransition = replaceTransition.toDocumentTransition()
376
-
377
- assert.notEqual(replaceTransition.__wbg_ptr, 0)
378
- assert.notEqual(replaceTransition.__wbg_ptr, 0)
379
- assert.notEqual(documentTransition.__wbg_ptr, 0)
380
- })
381
-
382
- it('should allow to create Document Batch Transition from Document Transitions', () => {
383
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
384
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
385
-
386
- const documentTransition = replaceTransition.toDocumentTransition()
387
-
388
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
389
-
390
- assert.notEqual(documentInstance.__wbg_ptr, 0)
391
- assert.notEqual(replaceTransition.__wbg_ptr, 0)
392
- assert.notEqual(documentTransition.__wbg_ptr, 0)
393
- assert.notEqual(batchTransition.__wbg_ptr, 0)
394
- })
395
-
396
- it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
397
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
398
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
399
-
400
- const documentTransition = replaceTransition.toDocumentTransition()
401
-
402
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
403
-
404
- const st = batchTransition.toStateTransition()
405
-
406
- const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
407
-
408
- const deserializedTransitions = deserializedBatch.transitions
409
-
410
- assert.equal(deserializedTransitions.length, 2)
411
-
412
- const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().replaceTransition
413
-
414
- assert.notEqual(documentInstance.__wbg_ptr, 0)
415
- assert.notEqual(replaceTransition.__wbg_ptr, 0)
416
- assert.notEqual(documentTransition.__wbg_ptr, 0)
417
- assert.notEqual(batchTransition.__wbg_ptr, 0)
418
- assert.notEqual(st.__wbg_ptr, 0)
419
- assert.notEqual(deserializedBatch.__wbg_ptr, 0)
420
- assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
421
- })
422
- })
423
-
424
- describe('document Transfer transition', function () {
425
- it('should allow to create ReplaceTransition from document', () => {
426
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
427
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
428
-
429
- assert.notEqual(documentInstance.__wbg_ptr, 0)
430
- assert.notEqual(transferTransition.__wbg_ptr, 0)
431
- })
432
-
433
- it('should allow to create Document Transition from Replace transition', () => {
434
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
435
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
436
-
437
- const documentTransition = transferTransition.toDocumentTransition()
438
-
439
- assert.notEqual(transferTransition.__wbg_ptr, 0)
440
- assert.notEqual(transferTransition.__wbg_ptr, 0)
441
- assert.notEqual(documentTransition.__wbg_ptr, 0)
442
- })
443
-
444
- it('should allow to create Document Batch Transition from Document Transitions', () => {
445
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
446
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
447
-
448
- const documentTransition = transferTransition.toDocumentTransition()
449
-
450
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
451
-
452
- assert.notEqual(documentInstance.__wbg_ptr, 0)
453
- assert.notEqual(transferTransition.__wbg_ptr, 0)
454
- assert.notEqual(documentTransition.__wbg_ptr, 0)
455
- assert.notEqual(batchTransition.__wbg_ptr, 0)
456
- })
457
-
458
- it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
459
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
460
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
461
-
462
- const documentTransition = transferTransition.toDocumentTransition()
463
-
464
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
465
-
466
- const st = batchTransition.toStateTransition()
467
-
468
- const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
469
-
470
- const deserializedTransitions = deserializedBatch.transitions
471
-
472
- assert.equal(deserializedTransitions.length, 2)
473
-
474
- const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().transferTransition
475
-
476
- assert.notEqual(documentInstance.__wbg_ptr, 0)
477
- assert.notEqual(transferTransition.__wbg_ptr, 0)
478
- assert.notEqual(documentTransition.__wbg_ptr, 0)
479
- assert.notEqual(batchTransition.__wbg_ptr, 0)
480
- assert.notEqual(st.__wbg_ptr, 0)
481
- assert.notEqual(deserializedBatch.__wbg_ptr, 0)
482
- assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
483
- })
484
- })
485
-
486
- describe('document UpdatePrice transition', function () {
487
- it('should allow to create UpdatePriceTransition from document', () => {
488
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
489
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
490
-
491
- assert.notEqual(documentInstance.__wbg_ptr, 0)
492
- assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
493
- })
494
-
495
- it('should allow to create Document Transition from UpdatePrice transition', () => {
496
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
497
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
498
-
499
- const documentTransition = updatePriceTransition.toDocumentTransition()
500
-
501
- assert.notEqual(documentInstance.__wbg_ptr, 0)
502
- assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
503
- assert.notEqual(documentTransition.__wbg_ptr, 0)
504
- })
505
-
506
- it('should allow to create Document Batch Transition from Document Transitions', () => {
507
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
508
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
509
-
510
- const documentTransition = updatePriceTransition.toDocumentTransition()
511
-
512
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
513
-
514
- assert.notEqual(documentInstance.__wbg_ptr, 0)
515
- assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
516
- assert.notEqual(documentTransition.__wbg_ptr, 0)
517
- assert.notEqual(batchTransition.__wbg_ptr, 0)
518
- })
519
-
520
- it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
521
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
522
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
523
-
524
- const documentTransition = updatePriceTransition.toDocumentTransition()
525
-
526
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
527
-
528
- const st = batchTransition.toStateTransition()
529
-
530
- const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
531
-
532
- const deserializedTransitions = deserializedBatch.transitions
533
-
534
- assert.equal(deserializedTransitions.length, 2)
535
-
536
- const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().updatePriceTransition
537
-
538
- assert.notEqual(documentInstance.__wbg_ptr, 0)
539
- assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
540
- assert.notEqual(documentTransition.__wbg_ptr, 0)
541
- assert.notEqual(batchTransition.__wbg_ptr, 0)
542
- assert.notEqual(st.__wbg_ptr, 0)
543
- assert.notEqual(deserializedBatch.__wbg_ptr, 0)
544
- assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
545
- })
546
- })
547
-
548
- describe('document Purchase transition', function () {
549
- it('should allow to create PurchaseTransition from document', () => {
550
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
551
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
552
-
553
- assert.notEqual(documentInstance.__wbg_ptr, 0)
554
- assert.notEqual(purchaseTransition.__wbg_ptr, 0)
555
- })
556
-
557
- it('should allow to create Document Transition from PurchaseTransition transition', () => {
558
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
559
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
560
-
561
- const documentTransition = purchaseTransition.toDocumentTransition()
562
-
563
- assert.notEqual(documentInstance.__wbg_ptr, 0)
564
- assert.notEqual(purchaseTransition.__wbg_ptr, 0)
565
- assert.notEqual(documentTransition.__wbg_ptr, 0)
566
- })
567
-
568
- it('should allow to create Document Batch Transition from Document Transitions', () => {
569
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
570
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
571
-
572
- const documentTransition = purchaseTransition.toDocumentTransition()
573
-
574
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
575
-
576
- assert.notEqual(documentInstance.__wbg_ptr, 0)
577
- assert.notEqual(purchaseTransition.__wbg_ptr, 0)
578
- assert.notEqual(documentTransition.__wbg_ptr, 0)
579
- assert.notEqual(batchTransition.__wbg_ptr, 0)
580
- })
581
-
582
- it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
583
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
584
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
585
-
586
- const documentTransition = purchaseTransition.toDocumentTransition()
587
-
588
- const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
589
-
590
- const st = batchTransition.toStateTransition()
591
-
592
- const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
593
-
594
- const deserializedTransitions = deserializedBatch.transitions
595
-
596
- assert.equal(deserializedTransitions.length, 2)
597
-
598
- const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().purchaseTransition
599
-
600
- assert.notEqual(documentInstance.__wbg_ptr, 0)
601
- assert.notEqual(purchaseTransition.__wbg_ptr, 0)
602
- assert.notEqual(documentTransition.__wbg_ptr, 0)
603
- assert.notEqual(batchTransition.__wbg_ptr, 0)
604
- assert.notEqual(st.__wbg_ptr, 0)
605
- assert.notEqual(deserializedBatch.__wbg_ptr, 0)
606
- assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
607
- })
608
- })
609
- })
610
- describe('getters', function () {
611
- describe('document Create transition', function () {
612
- it('get data', () => {
613
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
614
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
615
-
616
- assert.deepEqual(createTransition.data, document)
617
- })
618
-
619
- it('get base', () => {
620
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
621
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
622
-
623
- assert.equal(createTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
624
- })
625
-
626
- it('get entropy', () => {
627
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
628
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
629
-
630
- assert.deepEqual(createTransition.entropy, documentInstance.entropy)
631
- })
632
-
633
- it('get prefunded voting balance', () => {
634
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
635
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
636
-
637
- assert.equal(createTransition.prefundedVotingBalance, undefined)
638
- })
639
- })
640
-
641
- describe('document Delete transition', function () {
642
- it('get base', () => {
643
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
644
- const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
645
-
646
- assert.equal(deleteTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
647
- })
648
- })
649
-
650
- describe('document Replace transition', function () {
651
- it('get data', () => {
652
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
653
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
654
-
655
- assert.deepEqual(replaceTransition.data, document)
656
- })
657
-
658
- it('get base', () => {
659
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
660
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
661
-
662
- assert.equal(replaceTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
663
- })
664
-
665
- it('get revision', () => {
666
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
667
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
668
-
669
- assert.equal(replaceTransition.revision, BigInt(2))
670
- })
671
- })
672
-
673
- describe('document Transfer transition', function () {
674
- it('get base', () => {
675
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
676
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
677
-
678
- assert.equal(transferTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
679
- })
680
-
681
- it('get recipient', () => {
682
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
683
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
684
-
685
- assert.deepEqual(transferTransition.recipientId.base58(), documentInstance.ownerId.base58())
686
- })
687
- })
688
-
689
- describe('document Update Price transition', function () {
690
- it('get base', () => {
691
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
692
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
693
-
694
- assert.equal(updatePriceTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
695
- })
696
-
697
- it('get price', () => {
698
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
699
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
700
-
701
- assert.deepEqual(updatePriceTransition.price, BigInt(100))
702
- })
703
- })
704
-
705
- describe('document Purchase transition', function () {
706
- it('get base', () => {
707
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
708
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
709
-
710
- assert.equal(purchaseTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
711
- })
712
-
713
- it('get price', () => {
714
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
715
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
716
-
717
- assert.deepEqual(purchaseTransition.price, BigInt(100))
718
- })
719
- })
720
- })
721
-
722
- describe('setters', function () {
723
- describe('document Create transition', function () {
724
- it('set data', () => {
725
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
726
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
727
-
728
- const newData = { message: 'bebra' }
729
-
730
- createTransition.data = newData
731
-
732
- assert.deepEqual(createTransition.data, newData)
733
- })
734
-
735
- it('set base', () => {
736
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
737
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
738
-
739
- const newBase = new wasm.DocumentBaseTransitionWASM(
740
- documentInstance.id,
741
- BigInt(12350),
742
- 'bbbbb',
743
- dataContractId
744
- )
745
-
746
- createTransition.base = newBase
747
-
748
- assert.equal(createTransition.base.identityContractNonce, newBase.identityContractNonce)
749
- assert.notEqual(newBase.__wbg_ptr, 0)
750
- })
751
-
752
- it('set entropy', () => {
753
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
754
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
755
-
756
- const newEntropy = new Uint8Array(32)
757
-
758
- createTransition.entropy = newEntropy
759
-
760
- assert.deepEqual(createTransition.entropy, newEntropy)
761
- })
762
-
763
- it('set prefunded voting balance', () => {
764
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
765
- const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
766
-
767
- const newPrefundedVotingBalance = new wasm.PrefundedVotingBalanceWASM('note', BigInt(9999))
768
-
769
- createTransition.prefundedVotingBalance = newPrefundedVotingBalance
770
-
771
- assert.equal(createTransition.prefundedVotingBalance.indexName, newPrefundedVotingBalance.indexName)
772
- assert.equal(createTransition.prefundedVotingBalance.credits, newPrefundedVotingBalance.credits)
773
- })
774
- })
775
-
776
- describe('document Delete transition', function () {
777
- it('set base', () => {
778
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
779
- const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
780
-
781
- const newBase = new wasm.DocumentBaseTransitionWASM(
782
- documentInstance.id,
783
- BigInt(12350),
784
- 'bbbbb',
785
- dataContractId
786
- )
787
-
788
- deleteTransition.base = newBase
789
-
790
- assert.equal(deleteTransition.base.identityContractNonce, newBase.identityContractNonce)
791
- assert.notEqual(newBase.__wbg_ptr, 0)
792
- })
793
- })
794
-
795
- describe('document Replace transition', function () {
796
- it('set data', () => {
797
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
798
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
799
-
800
- const newData = { message: 'bebra' }
801
-
802
- replaceTransition.data = newData
803
-
804
- assert.deepEqual(replaceTransition.data, newData)
805
- })
806
-
807
- it('set base', () => {
808
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
809
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
810
-
811
- const newBase = new wasm.DocumentBaseTransitionWASM(
812
- documentInstance.id,
813
- BigInt(12350),
814
- 'bbbbb',
815
- dataContractId
816
- )
817
-
818
- replaceTransition.base = newBase
819
-
820
- assert.equal(replaceTransition.base.identityContractNonce, newBase.identityContractNonce)
821
- assert.notEqual(newBase.__wbg_ptr, 0)
822
- })
823
-
824
- it('set revision', () => {
825
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
826
- const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
827
-
828
- replaceTransition.revision = BigInt(11)
829
-
830
- assert.equal(replaceTransition.revision, BigInt(11))
831
- })
832
- })
833
-
834
- describe('document Transfer transition', function () {
835
- it('set base', () => {
836
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
837
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
838
-
839
- const newBase = new wasm.DocumentBaseTransitionWASM(
840
- documentInstance.id,
841
- BigInt(12350),
842
- 'bbbbb',
843
- dataContractId
844
- )
845
-
846
- transferTransition.base = newBase
847
-
848
- assert.equal(transferTransition.base.identityContractNonce, newBase.identityContractNonce)
849
- assert.notEqual(newBase.__wbg_ptr, 0)
850
- })
851
-
852
- it('set recipient', () => {
853
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
854
- const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
855
-
856
- const newRecipient = new Uint8Array(32)
857
-
858
- transferTransition.recipientId = newRecipient
859
-
860
- assert.deepEqual(transferTransition.recipientId.bytes(), newRecipient)
861
- })
862
- })
863
-
864
- describe('document Update Price transition', function () {
865
- it('set base', () => {
866
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
867
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
868
-
869
- const newBase = new wasm.DocumentBaseTransitionWASM(
870
- documentInstance.id,
871
- BigInt(12350),
872
- 'bbbbb',
873
- dataContractId
874
- )
875
-
876
- updatePriceTransition.base = newBase
877
-
878
- assert.equal(updatePriceTransition.base.identityContractNonce, newBase.identityContractNonce)
879
- assert.notEqual(newBase.__wbg_ptr, 0)
880
- })
881
-
882
- it('set price', () => {
883
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
884
- const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
885
-
886
- updatePriceTransition.price = BigInt(1111)
887
-
888
- assert.deepEqual(updatePriceTransition.price, BigInt(1111))
889
- })
890
- })
891
-
892
- describe('document Purchase transition', function () {
893
- it('set base', () => {
894
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
895
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
896
-
897
- const newBase = new wasm.DocumentBaseTransitionWASM(
898
- documentInstance.id,
899
- BigInt(12350),
900
- 'bbbbb',
901
- dataContractId
902
- )
903
-
904
- purchaseTransition.base = newBase
905
-
906
- assert.equal(purchaseTransition.base.identityContractNonce, newBase.identityContractNonce)
907
- assert.notEqual(newBase.__wbg_ptr, 0)
908
- })
909
-
910
- it('set price', () => {
911
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
912
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
913
-
914
- purchaseTransition.price = BigInt(1111)
915
-
916
- assert.deepEqual(purchaseTransition.price, BigInt(1111))
917
- })
918
-
919
- it('set revision', () => {
920
- const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
921
- const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
922
-
923
- purchaseTransition.revision = BigInt(1111)
924
-
925
- assert.deepEqual(purchaseTransition.revision, BigInt(1111))
926
- })
927
- })
928
- })
929
- })
930
- })