pshenmic-dpp 1.1.2-dev.8 → 2.0.0-dev.10
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/README.md +14 -99
- package/dist/binaries/bindingsTypes.d.ts +1721 -0
- package/dist/binaries/bindingsTypes.js +99 -0
- package/dist/binaries/pshenmic_dpp.android.node/react-native-node-api-module +0 -0
- package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
- package/dist/binaries/pshenmic_dpp.d.ts +171 -0
- package/dist/binaries/pshenmic_dpp.js +3 -0
- package/dist/binaries/wasm/wasmBytes.d.ts +2 -0
- package/dist/binaries/wasm/wasmBytes.js +2 -0
- package/dist/binaries/wasm.d.ts +171 -0
- package/dist/binaries/wasm.js +44 -0
- package/dist/src/dpp/constants.d.ts +4 -0
- package/dist/src/dpp/constants.js +19 -0
- package/dist/src/dpp/dpp.d.ts +112 -0
- package/dist/src/dpp/dpp.js +112 -0
- package/dist/src/dpp/enums.d.ts +1 -0
- package/dist/src/dpp/enums.js +1 -0
- package/dist/src/dpp/provider.d.ts +11 -0
- package/dist/src/dpp/provider.js +21 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +38 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +95 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +35 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +85 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +30 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +72 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +33 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +82 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts +31 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +77 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +31 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +76 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.d.ts +12 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.js +26 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.d.ts +15 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +33 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +13 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +27 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +13 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +30 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.d.ts +19 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +50 -0
- package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.d.ts +17 -0
- package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.js +36 -0
- package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.d.ts +24 -0
- package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.js +48 -0
- package/dist/src/dpp/structs/AssetLockProof/OutPoint.d.ts +15 -0
- package/dist/src/dpp/structs/AssetLockProof/OutPoint.js +40 -0
- package/dist/src/dpp/structs/AssetLockProof/Transaction.d.ts +20 -0
- package/dist/src/dpp/structs/AssetLockProof/Transaction.js +49 -0
- package/dist/src/dpp/structs/AssetLockProof/TxIn.d.ts +17 -0
- package/dist/src/dpp/structs/AssetLockProof/TxIn.js +39 -0
- package/dist/src/dpp/structs/AssetLockProof/TxOut.d.ts +13 -0
- package/dist/src/dpp/structs/AssetLockProof/TxOut.js +34 -0
- package/dist/src/dpp/structs/AssetLockProof/Witness.d.ts +11 -0
- package/dist/src/dpp/structs/AssetLockProof/Witness.js +25 -0
- package/dist/src/dpp/structs/Batch/BatchTransition.d.ts +34 -0
- package/dist/src/dpp/structs/Batch/BatchTransition.js +95 -0
- package/dist/src/dpp/structs/Batch/BatchedTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/BatchedTransition.js +39 -0
- package/dist/src/dpp/structs/Batch/DocumentBaseTransition.d.ts +20 -0
- package/dist/src/dpp/structs/Batch/DocumentBaseTransition.js +54 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.d.ts +33 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.js +77 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.d.ts +23 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.js +58 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.js +26 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.js +39 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.js +40 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.js +35 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.d.ts +17 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.d.ts +9 -0
- package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.js +19 -0
- package/dist/src/dpp/structs/Batch/TokenBaseTransition.d.ts +20 -0
- package/dist/src/dpp/structs/Batch/TokenBaseTransition.js +49 -0
- package/dist/src/dpp/structs/Batch/TokenPaymentInfo.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/TokenPaymentInfo.js +54 -0
- package/dist/src/dpp/structs/Batch/TokenPricingSchedule.d.ts +17 -0
- package/dist/src/dpp/structs/Batch/TokenPricingSchedule.js +41 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.d.ts +21 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.js +95 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.js +32 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.d.ts +16 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.js +34 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.js +32 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.d.ts +16 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.js +34 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.d.ts +18 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.js +43 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.js +36 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.d.ts +24 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +60 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.d.ts +16 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.js +34 -0
- package/dist/src/dpp/structs/ConsensusError.d.ts +8 -0
- package/dist/src/dpp/structs/ConsensusError.js +22 -0
- package/dist/src/dpp/structs/ContractBounds.d.ts +17 -0
- package/dist/src/dpp/structs/ContractBounds.js +39 -0
- package/dist/src/dpp/structs/CoreScript.d.ts +15 -0
- package/dist/src/dpp/structs/CoreScript.js +37 -0
- package/dist/src/dpp/structs/DataContract.d.ts +38 -0
- package/dist/src/dpp/structs/DataContract.js +125 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.d.ts +23 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +55 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.d.ts +23 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +55 -0
- package/dist/src/dpp/structs/Document.d.ts +51 -0
- package/dist/src/dpp/structs/Document.js +184 -0
- package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.d.ts +13 -0
- package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.js +31 -0
- package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.d.ts +13 -0
- package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.js +31 -0
- package/dist/src/dpp/structs/GroupStateTransitionInfo.d.ts +15 -0
- package/dist/src/dpp/structs/GroupStateTransitionInfo.js +33 -0
- package/dist/src/dpp/structs/Identifier.d.ts +17 -0
- package/dist/src/dpp/structs/Identifier.js +50 -0
- package/dist/src/dpp/structs/Identity.d.ts +26 -0
- package/dist/src/dpp/structs/Identity.js +73 -0
- package/dist/src/dpp/structs/IdentityPublicKey.d.ts +44 -0
- package/dist/src/dpp/structs/IdentityPublicKey.js +131 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +31 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +82 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.d.ts +29 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +69 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.d.ts +33 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +85 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.d.ts +42 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +114 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.d.ts +30 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +75 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.d.ts +40 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +108 -0
- package/dist/src/dpp/structs/InstantLock.d.ts +17 -0
- package/dist/src/dpp/structs/InstantLock.js +43 -0
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.d.ts +37 -0
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +96 -0
- package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.d.ts +14 -0
- package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.js +29 -0
- package/dist/src/dpp/structs/MasternodeVote/Vote.d.ts +13 -0
- package/dist/src/dpp/structs/MasternodeVote/Vote.js +27 -0
- package/dist/src/dpp/structs/MasternodeVote/VotePoll.d.ts +18 -0
- package/dist/src/dpp/structs/MasternodeVote/VotePoll.js +42 -0
- package/dist/src/dpp/structs/PartialIdentity.d.ts +26 -0
- package/dist/src/dpp/structs/PartialIdentity.js +69 -0
- package/dist/src/dpp/structs/PlatformAddress/AddressWitness.d.ts +12 -0
- package/dist/src/dpp/structs/PlatformAddress/AddressWitness.js +23 -0
- package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.d.ts +16 -0
- package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.js +38 -0
- package/dist/src/dpp/structs/PrivateKey.d.ts +20 -0
- package/dist/src/dpp/structs/PrivateKey.js +48 -0
- package/dist/src/dpp/structs/PublicKey.d.ts +15 -0
- package/dist/src/dpp/structs/PublicKey.js +37 -0
- package/dist/src/dpp/structs/StateTransition.d.ts +39 -0
- package/dist/src/dpp/structs/StateTransition.js +103 -0
- package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.d.ts +12 -0
- package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.js +44 -0
- package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.d.ts +16 -0
- package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.js +43 -0
- package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.d.ts +23 -0
- package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.js +52 -0
- package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.js +57 -0
- package/dist/src/dpp/structs/TokenConfiguration/Group.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/Group.js +44 -0
- package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.d.ts +13 -0
- package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.js +40 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.d.ts +54 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.js +139 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.d.ts +47 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.js +140 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.js +47 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.d.ts +15 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.js +34 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.d.ts +14 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.js +31 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.d.ts +28 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.js +75 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.js +49 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.d.ts +13 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.js +27 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.d.ts +13 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.js +27 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.d.ts +21 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.js +42 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.d.ts +9 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.js +17 -0
- package/dist/src/dpp/types.d.ts +284 -0
- package/dist/src/dpp/types.js +1 -0
- package/dist/src/dpp/utils.d.ts +6 -0
- package/dist/src/dpp/utils.js +96 -0
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.d.ts +3 -0
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +34 -0
- package/dist/src/dpp/verify/Contract/verifyContract.d.ts +2 -0
- package/dist/src/dpp/verify/Contract/verifyContract.js +14 -0
- package/dist/src/dpp/verify/Document/verifyDocumentsProof.d.ts +3 -0
- package/dist/src/dpp/verify/Document/verifyDocumentsProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.js +9 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.js +9 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.js +9 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressInfo.d.ts +2 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressInfo.js +12 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressesInfos.d.ts +2 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressesInfos.js +14 -0
- package/dist/src/dpp/verify/StateTransition/utils.d.ts +2 -0
- package/dist/src/dpp/verify/StateTransition/utils.js +115 -0
- package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.d.ts +4 -0
- package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.js +10 -0
- package/dist/src/dpp/verify/System/verifyEpochsInfoProof.d.ts +2 -0
- package/dist/src/dpp/verify/System/verifyEpochsInfoProof.js +16 -0
- package/dist/src/dpp/verify/System/verifyTotalCreditsProof.d.ts +2 -0
- package/dist/src/dpp/verify/System/verifyTotalCreditsProof.js +9 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.js +13 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.js +15 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.js +14 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.js +12 -0
- package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.js +13 -0
- package/dist/src/dpp/verify/verifySignatureDigest.d.ts +1 -0
- package/dist/src/dpp/verify/verifySignatureDigest.js +4 -0
- package/dist/src/react-native.d.ts +3 -0
- package/dist/src/react-native.js +6 -0
- package/dist/src/wasm.d.ts +3 -0
- package/dist/src/wasm.js +6 -0
- package/dist/utils/base122.d.ts +7 -0
- package/dist/utils/base122.js +63 -0
- package/package.json +30 -27
- package/tests/unit/DynamicValue.spec.ts +126 -0
- package/tests/unit/Identifier.spec.ts +105 -0
- package/tests/unit/Identity.spec.ts +119 -0
- package/tests/unit/IdentityPublicKey.spec.ts +126 -0
- package/dist/wasm/base122.d.ts +0 -1
- package/dist/wasm/base122.js +0 -67
- package/dist/wasm/index.d.ts +0 -148
- package/dist/wasm/index.js +0 -13
- package/dist/wasm/initAsync.d.ts +0 -4
- package/dist/wasm/initAsync.js +0 -20
- package/dist/wasm/initInterface.d.ts +0 -3
- package/dist/wasm/initInterface.js +0 -46
- package/dist/wasm/initWASM.d.ts +0 -1
- package/dist/wasm/initWASM.js +0 -28
- package/dist/wasm/pshenmic_dpp.d.ts +0 -5266
- package/dist/wasm/pshenmic_dpp.js +0 -25608
- package/dist/wasm/pshenmic_dpp_bg.d.ts +0 -3
- package/dist/wasm/pshenmic_dpp_bg.js +0 -2
- package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +0 -1636
- package/dist/wasm/pshenmic_dpp_zipped.d.ts +0 -3
- package/dist/wasm/pshenmic_dpp_zipped.js +0 -2
- package/dist/wasm/snippets/pshenmic_dpp_utils-23ab7381b198778d/stringify.js +0 -7
- package/tests/AssetLockProof.spec.cjs +0 -96
- package/tests/AsyncImportTest.spec.cjs +0 -930
- package/tests/AuthorizedActionTakers.spec.cjs +0 -75
- package/tests/BatchTransition.spec.cjs +0 -141
- package/tests/ChainLockProof.spec.cjs +0 -63
- package/tests/ChangeControlRules.spec.cjs +0 -184
- package/tests/CoreScript.spec.cjs +0 -37
- package/tests/DataContract.spec.cjs +0 -170
- package/tests/DataContractCreateStateTransition.spec.cjs +0 -102
- package/tests/DataContractUpdateStateTransition.spec.cjs +0 -103
- package/tests/DistributionFunction.spec.cjs +0 -416
- package/tests/Document.spec.cjs +0 -227
- package/tests/DocumentTransition.spec.cjs +0 -94
- package/tests/DocumentsTransitions.spec.cjs +0 -699
- package/tests/Identifier.spec.cjs +0 -82
- package/tests/Identity.spec.cjs +0 -107
- package/tests/IdentityCreateTransition.spec.cjs +0 -87
- package/tests/IdentityCreditTransferTransition.spec.cjs +0 -140
- package/tests/IdentityCreditWithdrawalTransition.spec.cjs +0 -186
- package/tests/IdentityPublicKey.spec.cjs +0 -166
- package/tests/IdentityTopUpTransition.spec.cjs +0 -125
- package/tests/IdentityUpdateTransition.spec.cjs +0 -141
- package/tests/InstantLockProof.spec.cjs +0 -91
- package/tests/OutPoint.spec.cjs +0 -49
- package/tests/PrivateKey.spec.cjs +0 -67
- package/tests/PublicKeyInCreation.spec.cjs +0 -252
- package/tests/RewardDistributionType.spec.cjs +0 -90
- package/tests/TokenBaseTransition.spec.cjs +0 -96
- package/tests/TokenConfiguration.spec.cjs +0 -188
- package/tests/TokenConfigurationConvention.spec.cjs +0 -93
- package/tests/TokenConfigurationLocalization.spec.cjs +0 -59
- package/tests/TokenDistributionRecipient.spec.cjs +0 -49
- package/tests/TokenDistributionRules.spec.cjs +0 -313
- package/tests/TokenKeepsHistoryRules.spec.cjs +0 -67
- package/tests/TokenPerpetualDistribution.spec.cjs +0 -130
- package/tests/TokenPreProgrammedDistribution.spec.cjs +0 -61
- package/tests/TokensTransitions.spec.cjs +0 -509
- package/tests/TxOut.spec.cjs +0 -70
- package/tests/mocks/DataContract/DataContract.json +0 -164
- package/tests/mocks/DataContract/index.js +0 -6
- package/tests/mocks/Document/DataContract.json +0 -23
- package/tests/mocks/Document/document.json +0 -3
- package/tests/mocks/Document/document2.json +0 -3
- package/tests/mocks/Document/index.js +0 -13
- package/tests/mocks/Identity/index.js +0 -13
- package/tests/mocks/Locks/index.js +0 -2
- package/tests/mocks/PrivateKey/index.js +0 -5
- package/tests/mocks/PublicKey/index.js +0 -13
- package/tests/mocks/TokenConfiguration/index.js +0 -5
- package/tests/utils/hex.js +0 -14
|
@@ -1,699 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { document, documentTypeName, revision, dataContractId, ownerId, id } = require('./mocks/Document/index.js')
|
|
4
|
-
const { default: wasm } = require('..')
|
|
5
|
-
|
|
6
|
-
describe('DocumentsTransitions', function () {
|
|
7
|
-
describe('serialization / deserialization', function () {
|
|
8
|
-
describe('document Create transition', function () {
|
|
9
|
-
it('should allow to create CreateTransition from document', () => {
|
|
10
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
11
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
12
|
-
|
|
13
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
14
|
-
assert.notEqual(createTransition.__wbg_ptr, 0)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('should allow to create Document Transition from Create transition', () => {
|
|
18
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
19
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
20
|
-
|
|
21
|
-
const documentTransition = createTransition.toDocumentTransition()
|
|
22
|
-
|
|
23
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
24
|
-
assert.notEqual(createTransition.__wbg_ptr, 0)
|
|
25
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('should allow to create Document Batch Transition from Document Transitions', () => {
|
|
29
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
30
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
31
|
-
|
|
32
|
-
const documentTransition = createTransition.toDocumentTransition()
|
|
33
|
-
|
|
34
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
35
|
-
|
|
36
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
37
|
-
assert.notEqual(createTransition.__wbg_ptr, 0)
|
|
38
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
39
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
|
|
43
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
44
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
45
|
-
|
|
46
|
-
const documentTransition = createTransition.toDocumentTransition()
|
|
47
|
-
|
|
48
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
49
|
-
|
|
50
|
-
const st = batchTransition.toStateTransition()
|
|
51
|
-
|
|
52
|
-
const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
|
|
53
|
-
|
|
54
|
-
const deserializedTransitions = deserializedBatch.transitions
|
|
55
|
-
|
|
56
|
-
assert.equal(deserializedTransitions.length, 2)
|
|
57
|
-
|
|
58
|
-
const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().createTransition
|
|
59
|
-
|
|
60
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
61
|
-
assert.notEqual(createTransition.__wbg_ptr, 0)
|
|
62
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
63
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
64
|
-
assert.notEqual(st.__wbg_ptr, 0)
|
|
65
|
-
assert.notEqual(deserializedBatch.__wbg_ptr, 0)
|
|
66
|
-
assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
describe('document Delete transition', function () {
|
|
71
|
-
it('should allow to create DeleteTransition from document', () => {
|
|
72
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
73
|
-
const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
|
|
74
|
-
|
|
75
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
76
|
-
assert.notEqual(deleteTransition.__wbg_ptr, 0)
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
it('should allow to create Document Transition from Delete transition', () => {
|
|
80
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
81
|
-
const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
|
|
82
|
-
|
|
83
|
-
const documentTransition = deleteTransition.toDocumentTransition()
|
|
84
|
-
|
|
85
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
86
|
-
assert.notEqual(deleteTransition.__wbg_ptr, 0)
|
|
87
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
it('should allow to create Document Batch Transition from Document Transitions', () => {
|
|
91
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
92
|
-
const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
|
|
93
|
-
|
|
94
|
-
const documentTransition = deleteTransition.toDocumentTransition()
|
|
95
|
-
|
|
96
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
97
|
-
|
|
98
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
99
|
-
assert.notEqual(deleteTransition.__wbg_ptr, 0)
|
|
100
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
101
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
|
|
105
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
106
|
-
const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
|
|
107
|
-
|
|
108
|
-
const documentTransition = deleteTransition.toDocumentTransition()
|
|
109
|
-
|
|
110
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
111
|
-
|
|
112
|
-
const st = batchTransition.toStateTransition()
|
|
113
|
-
|
|
114
|
-
const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
|
|
115
|
-
|
|
116
|
-
const deserializedTransitions = deserializedBatch.transitions
|
|
117
|
-
|
|
118
|
-
assert.equal(deserializedTransitions.length, 2)
|
|
119
|
-
|
|
120
|
-
const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().deleteTransition
|
|
121
|
-
|
|
122
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
123
|
-
assert.notEqual(deleteTransition.__wbg_ptr, 0)
|
|
124
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
125
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
126
|
-
assert.notEqual(st.__wbg_ptr, 0)
|
|
127
|
-
assert.notEqual(deserializedBatch.__wbg_ptr, 0)
|
|
128
|
-
assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
describe('document Replace transition', function () {
|
|
133
|
-
it('should allow to create ReplaceTransition from document', () => {
|
|
134
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
135
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
136
|
-
|
|
137
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
138
|
-
assert.notEqual(replaceTransition.__wbg_ptr, 0)
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
it('should allow to create Document Transition from Replace transition', () => {
|
|
142
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
143
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
144
|
-
|
|
145
|
-
const documentTransition = replaceTransition.toDocumentTransition()
|
|
146
|
-
|
|
147
|
-
assert.notEqual(replaceTransition.__wbg_ptr, 0)
|
|
148
|
-
assert.notEqual(replaceTransition.__wbg_ptr, 0)
|
|
149
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
it('should allow to create Document Batch Transition from Document Transitions', () => {
|
|
153
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
154
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
155
|
-
|
|
156
|
-
const documentTransition = replaceTransition.toDocumentTransition()
|
|
157
|
-
|
|
158
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
159
|
-
|
|
160
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
161
|
-
assert.notEqual(replaceTransition.__wbg_ptr, 0)
|
|
162
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
163
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
|
|
167
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
168
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
169
|
-
|
|
170
|
-
const documentTransition = replaceTransition.toDocumentTransition()
|
|
171
|
-
|
|
172
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
173
|
-
|
|
174
|
-
const st = batchTransition.toStateTransition()
|
|
175
|
-
|
|
176
|
-
const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
|
|
177
|
-
|
|
178
|
-
const deserializedTransitions = deserializedBatch.transitions
|
|
179
|
-
|
|
180
|
-
assert.equal(deserializedTransitions.length, 2)
|
|
181
|
-
|
|
182
|
-
const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().replaceTransition
|
|
183
|
-
|
|
184
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
185
|
-
assert.notEqual(replaceTransition.__wbg_ptr, 0)
|
|
186
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
187
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
188
|
-
assert.notEqual(st.__wbg_ptr, 0)
|
|
189
|
-
assert.notEqual(deserializedBatch.__wbg_ptr, 0)
|
|
190
|
-
assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
|
|
191
|
-
})
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
describe('document Transfer transition', function () {
|
|
195
|
-
it('should allow to create ReplaceTransition from document', () => {
|
|
196
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
197
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
198
|
-
|
|
199
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
200
|
-
assert.notEqual(transferTransition.__wbg_ptr, 0)
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
it('should allow to create Document Transition from Replace transition', () => {
|
|
204
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
205
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
206
|
-
|
|
207
|
-
const documentTransition = transferTransition.toDocumentTransition()
|
|
208
|
-
|
|
209
|
-
assert.notEqual(transferTransition.__wbg_ptr, 0)
|
|
210
|
-
assert.notEqual(transferTransition.__wbg_ptr, 0)
|
|
211
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
it('should allow to create Document Batch Transition from Document Transitions', () => {
|
|
215
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
216
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
217
|
-
|
|
218
|
-
const documentTransition = transferTransition.toDocumentTransition()
|
|
219
|
-
|
|
220
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
221
|
-
|
|
222
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
223
|
-
assert.notEqual(transferTransition.__wbg_ptr, 0)
|
|
224
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
225
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
226
|
-
})
|
|
227
|
-
|
|
228
|
-
it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
|
|
229
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
230
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
231
|
-
|
|
232
|
-
const documentTransition = transferTransition.toDocumentTransition()
|
|
233
|
-
|
|
234
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
235
|
-
|
|
236
|
-
const st = batchTransition.toStateTransition()
|
|
237
|
-
|
|
238
|
-
const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
|
|
239
|
-
|
|
240
|
-
const deserializedTransitions = deserializedBatch.transitions
|
|
241
|
-
|
|
242
|
-
assert.equal(deserializedTransitions.length, 2)
|
|
243
|
-
|
|
244
|
-
const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().transferTransition
|
|
245
|
-
|
|
246
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
247
|
-
assert.notEqual(transferTransition.__wbg_ptr, 0)
|
|
248
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
249
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
250
|
-
assert.notEqual(st.__wbg_ptr, 0)
|
|
251
|
-
assert.notEqual(deserializedBatch.__wbg_ptr, 0)
|
|
252
|
-
assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
|
|
253
|
-
})
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
describe('document UpdatePrice transition', function () {
|
|
257
|
-
it('should allow to create UpdatePriceTransition from document', () => {
|
|
258
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
259
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
260
|
-
|
|
261
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
262
|
-
assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
it('should allow to create Document Transition from UpdatePrice transition', () => {
|
|
266
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
267
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
268
|
-
|
|
269
|
-
const documentTransition = updatePriceTransition.toDocumentTransition()
|
|
270
|
-
|
|
271
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
272
|
-
assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
|
|
273
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
274
|
-
})
|
|
275
|
-
|
|
276
|
-
it('should allow to create Document Batch Transition from Document Transitions', () => {
|
|
277
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
278
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
279
|
-
|
|
280
|
-
const documentTransition = updatePriceTransition.toDocumentTransition()
|
|
281
|
-
|
|
282
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
283
|
-
|
|
284
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
285
|
-
assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
|
|
286
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
287
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
288
|
-
})
|
|
289
|
-
|
|
290
|
-
it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
|
|
291
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
292
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
293
|
-
|
|
294
|
-
const documentTransition = updatePriceTransition.toDocumentTransition()
|
|
295
|
-
|
|
296
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
297
|
-
|
|
298
|
-
const st = batchTransition.toStateTransition()
|
|
299
|
-
|
|
300
|
-
const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
|
|
301
|
-
|
|
302
|
-
const deserializedTransitions = deserializedBatch.transitions
|
|
303
|
-
|
|
304
|
-
assert.equal(deserializedTransitions.length, 2)
|
|
305
|
-
|
|
306
|
-
const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().updatePriceTransition
|
|
307
|
-
|
|
308
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
309
|
-
assert.notEqual(updatePriceTransition.__wbg_ptr, 0)
|
|
310
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
311
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
312
|
-
assert.notEqual(st.__wbg_ptr, 0)
|
|
313
|
-
assert.notEqual(deserializedBatch.__wbg_ptr, 0)
|
|
314
|
-
assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
|
|
315
|
-
})
|
|
316
|
-
})
|
|
317
|
-
|
|
318
|
-
describe('document Purchase transition', function () {
|
|
319
|
-
it('should allow to create PurchaseTransition from document', () => {
|
|
320
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
321
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
322
|
-
|
|
323
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
324
|
-
assert.notEqual(purchaseTransition.__wbg_ptr, 0)
|
|
325
|
-
})
|
|
326
|
-
|
|
327
|
-
it('should allow to create Document Transition from PurchaseTransition transition', () => {
|
|
328
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
329
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
330
|
-
|
|
331
|
-
const documentTransition = purchaseTransition.toDocumentTransition()
|
|
332
|
-
|
|
333
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
334
|
-
assert.notEqual(purchaseTransition.__wbg_ptr, 0)
|
|
335
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
336
|
-
})
|
|
337
|
-
|
|
338
|
-
it('should allow to create Document Batch Transition from Document Transitions', () => {
|
|
339
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
340
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
341
|
-
|
|
342
|
-
const documentTransition = purchaseTransition.toDocumentTransition()
|
|
343
|
-
|
|
344
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
345
|
-
|
|
346
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
347
|
-
assert.notEqual(purchaseTransition.__wbg_ptr, 0)
|
|
348
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
349
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
it('should allow to create state document_transitions from document and convert state transition to document batch', () => {
|
|
353
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
354
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
355
|
-
|
|
356
|
-
const documentTransition = purchaseTransition.toDocumentTransition()
|
|
357
|
-
|
|
358
|
-
const batchTransition = wasm.BatchTransitionWASM.fromV0Transitions([documentTransition, documentTransition], documentInstance.ownerId, 1, 1)
|
|
359
|
-
|
|
360
|
-
const st = batchTransition.toStateTransition()
|
|
361
|
-
|
|
362
|
-
const deserializedBatch = wasm.BatchTransitionWASM.fromStateTransition(st)
|
|
363
|
-
|
|
364
|
-
const deserializedTransitions = deserializedBatch.transitions
|
|
365
|
-
|
|
366
|
-
assert.equal(deserializedTransitions.length, 2)
|
|
367
|
-
|
|
368
|
-
const deserializedPurchaseTransition = deserializedTransitions[0].toTransition().purchaseTransition
|
|
369
|
-
|
|
370
|
-
assert.notEqual(documentInstance.__wbg_ptr, 0)
|
|
371
|
-
assert.notEqual(purchaseTransition.__wbg_ptr, 0)
|
|
372
|
-
assert.notEqual(documentTransition.__wbg_ptr, 0)
|
|
373
|
-
assert.notEqual(batchTransition.__wbg_ptr, 0)
|
|
374
|
-
assert.notEqual(st.__wbg_ptr, 0)
|
|
375
|
-
assert.notEqual(deserializedBatch.__wbg_ptr, 0)
|
|
376
|
-
assert.notEqual(deserializedPurchaseTransition.__wbg_ptr, 0)
|
|
377
|
-
})
|
|
378
|
-
})
|
|
379
|
-
})
|
|
380
|
-
describe('getters', function () {
|
|
381
|
-
describe('document Create transition', function () {
|
|
382
|
-
it('get data', () => {
|
|
383
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
384
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
385
|
-
|
|
386
|
-
assert.deepEqual(createTransition.data, document)
|
|
387
|
-
})
|
|
388
|
-
|
|
389
|
-
it('get base', () => {
|
|
390
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
391
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
392
|
-
|
|
393
|
-
assert.equal(createTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
|
|
394
|
-
})
|
|
395
|
-
|
|
396
|
-
it('get entropy', () => {
|
|
397
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
398
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
399
|
-
|
|
400
|
-
assert.deepEqual(createTransition.entropy, documentInstance.entropy)
|
|
401
|
-
})
|
|
402
|
-
|
|
403
|
-
it('get prefunded voting balance', () => {
|
|
404
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
405
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
406
|
-
|
|
407
|
-
assert.equal(createTransition.prefundedVotingBalance, undefined)
|
|
408
|
-
})
|
|
409
|
-
})
|
|
410
|
-
|
|
411
|
-
describe('document Delete transition', function () {
|
|
412
|
-
it('get base', () => {
|
|
413
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
414
|
-
const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
|
|
415
|
-
|
|
416
|
-
assert.equal(deleteTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
|
|
417
|
-
})
|
|
418
|
-
})
|
|
419
|
-
|
|
420
|
-
describe('document Replace transition', function () {
|
|
421
|
-
it('get data', () => {
|
|
422
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
423
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
424
|
-
|
|
425
|
-
assert.deepEqual(replaceTransition.data, document)
|
|
426
|
-
})
|
|
427
|
-
|
|
428
|
-
it('get base', () => {
|
|
429
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
430
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
431
|
-
|
|
432
|
-
assert.equal(replaceTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
|
|
433
|
-
})
|
|
434
|
-
|
|
435
|
-
it('get revision', () => {
|
|
436
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
437
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
438
|
-
|
|
439
|
-
assert.equal(replaceTransition.revision, BigInt(2))
|
|
440
|
-
})
|
|
441
|
-
})
|
|
442
|
-
|
|
443
|
-
describe('document Transfer transition', function () {
|
|
444
|
-
it('get base', () => {
|
|
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
|
-
assert.equal(transferTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
|
|
449
|
-
})
|
|
450
|
-
|
|
451
|
-
it('get recipient', () => {
|
|
452
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
453
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
454
|
-
|
|
455
|
-
assert.deepEqual(transferTransition.recipientId.base58(), documentInstance.ownerId.base58())
|
|
456
|
-
})
|
|
457
|
-
})
|
|
458
|
-
|
|
459
|
-
describe('document Update Price transition', function () {
|
|
460
|
-
it('get base', () => {
|
|
461
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
462
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
463
|
-
|
|
464
|
-
assert.equal(updatePriceTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
|
|
465
|
-
})
|
|
466
|
-
|
|
467
|
-
it('get price', () => {
|
|
468
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
469
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
470
|
-
|
|
471
|
-
assert.deepEqual(updatePriceTransition.price, BigInt(100))
|
|
472
|
-
})
|
|
473
|
-
})
|
|
474
|
-
|
|
475
|
-
describe('document Purchase transition', function () {
|
|
476
|
-
it('get base', () => {
|
|
477
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
478
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
479
|
-
|
|
480
|
-
assert.equal(purchaseTransition.base.constructor.name, 'DocumentBaseTransitionWASM')
|
|
481
|
-
})
|
|
482
|
-
|
|
483
|
-
it('get price', () => {
|
|
484
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
485
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
486
|
-
|
|
487
|
-
assert.deepEqual(purchaseTransition.price, BigInt(100))
|
|
488
|
-
})
|
|
489
|
-
})
|
|
490
|
-
})
|
|
491
|
-
|
|
492
|
-
describe('setters', function () {
|
|
493
|
-
describe('document Create transition', function () {
|
|
494
|
-
it('set data', () => {
|
|
495
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
496
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
497
|
-
|
|
498
|
-
const newData = { message: 'bebra' }
|
|
499
|
-
|
|
500
|
-
createTransition.data = newData
|
|
501
|
-
|
|
502
|
-
assert.deepEqual(createTransition.data, newData)
|
|
503
|
-
})
|
|
504
|
-
|
|
505
|
-
it('set base', () => {
|
|
506
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
507
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
508
|
-
|
|
509
|
-
const newBase = new wasm.DocumentBaseTransitionWASM(
|
|
510
|
-
documentInstance.id,
|
|
511
|
-
BigInt(12350),
|
|
512
|
-
'bbbbb',
|
|
513
|
-
dataContractId
|
|
514
|
-
)
|
|
515
|
-
|
|
516
|
-
createTransition.base = newBase
|
|
517
|
-
|
|
518
|
-
assert.equal(createTransition.base.identityContractNonce, newBase.identityContractNonce)
|
|
519
|
-
assert.notEqual(newBase.__wbg_ptr, 0)
|
|
520
|
-
})
|
|
521
|
-
|
|
522
|
-
it('set entropy', () => {
|
|
523
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
524
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
525
|
-
|
|
526
|
-
const newEntropy = new Uint8Array(32)
|
|
527
|
-
|
|
528
|
-
createTransition.entropy = newEntropy
|
|
529
|
-
|
|
530
|
-
assert.deepEqual(createTransition.entropy, newEntropy)
|
|
531
|
-
})
|
|
532
|
-
|
|
533
|
-
it('set prefunded voting balance', () => {
|
|
534
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
535
|
-
const createTransition = new wasm.DocumentCreateTransitionWASM(documentInstance, BigInt(1))
|
|
536
|
-
|
|
537
|
-
const newPrefundedVotingBalance = new wasm.PrefundedVotingBalanceWASM('note', BigInt(9999))
|
|
538
|
-
|
|
539
|
-
createTransition.prefundedVotingBalance = newPrefundedVotingBalance
|
|
540
|
-
|
|
541
|
-
assert.equal(createTransition.prefundedVotingBalance.indexName, newPrefundedVotingBalance.indexName)
|
|
542
|
-
assert.equal(createTransition.prefundedVotingBalance.credits, newPrefundedVotingBalance.credits)
|
|
543
|
-
})
|
|
544
|
-
})
|
|
545
|
-
|
|
546
|
-
describe('document Delete transition', function () {
|
|
547
|
-
it('set base', () => {
|
|
548
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
549
|
-
const deleteTransition = new wasm.DocumentDeleteTransitionWASM(documentInstance, BigInt(1))
|
|
550
|
-
|
|
551
|
-
const newBase = new wasm.DocumentBaseTransitionWASM(
|
|
552
|
-
documentInstance.id,
|
|
553
|
-
BigInt(12350),
|
|
554
|
-
'bbbbb',
|
|
555
|
-
dataContractId
|
|
556
|
-
)
|
|
557
|
-
|
|
558
|
-
deleteTransition.base = newBase
|
|
559
|
-
|
|
560
|
-
assert.equal(deleteTransition.base.identityContractNonce, newBase.identityContractNonce)
|
|
561
|
-
assert.notEqual(newBase.__wbg_ptr, 0)
|
|
562
|
-
})
|
|
563
|
-
})
|
|
564
|
-
|
|
565
|
-
describe('document Replace transition', function () {
|
|
566
|
-
it('set data', () => {
|
|
567
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
568
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
569
|
-
|
|
570
|
-
const newData = { message: 'bebra' }
|
|
571
|
-
|
|
572
|
-
replaceTransition.data = newData
|
|
573
|
-
|
|
574
|
-
assert.deepEqual(replaceTransition.data, newData)
|
|
575
|
-
})
|
|
576
|
-
|
|
577
|
-
it('set base', () => {
|
|
578
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
579
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
580
|
-
|
|
581
|
-
const newBase = new wasm.DocumentBaseTransitionWASM(
|
|
582
|
-
documentInstance.id,
|
|
583
|
-
BigInt(12350),
|
|
584
|
-
'bbbbb',
|
|
585
|
-
dataContractId
|
|
586
|
-
)
|
|
587
|
-
|
|
588
|
-
replaceTransition.base = newBase
|
|
589
|
-
|
|
590
|
-
assert.equal(replaceTransition.base.identityContractNonce, newBase.identityContractNonce)
|
|
591
|
-
assert.notEqual(newBase.__wbg_ptr, 0)
|
|
592
|
-
})
|
|
593
|
-
|
|
594
|
-
it('set revision', () => {
|
|
595
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
596
|
-
const replaceTransition = new wasm.DocumentReplaceTransitionWASM(documentInstance, BigInt(1))
|
|
597
|
-
|
|
598
|
-
replaceTransition.revision = BigInt(11)
|
|
599
|
-
|
|
600
|
-
assert.equal(replaceTransition.revision, BigInt(11))
|
|
601
|
-
})
|
|
602
|
-
})
|
|
603
|
-
|
|
604
|
-
describe('document Transfer transition', function () {
|
|
605
|
-
it('set base', () => {
|
|
606
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
607
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
608
|
-
|
|
609
|
-
const newBase = new wasm.DocumentBaseTransitionWASM(
|
|
610
|
-
documentInstance.id,
|
|
611
|
-
BigInt(12350),
|
|
612
|
-
'bbbbb',
|
|
613
|
-
dataContractId
|
|
614
|
-
)
|
|
615
|
-
|
|
616
|
-
transferTransition.base = newBase
|
|
617
|
-
|
|
618
|
-
assert.equal(transferTransition.base.identityContractNonce, newBase.identityContractNonce)
|
|
619
|
-
assert.notEqual(newBase.__wbg_ptr, 0)
|
|
620
|
-
})
|
|
621
|
-
|
|
622
|
-
it('set recipient', () => {
|
|
623
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
624
|
-
const transferTransition = new wasm.DocumentTransferTransitionWASM(documentInstance, BigInt(1), documentInstance.ownerId)
|
|
625
|
-
|
|
626
|
-
const newRecipient = new Uint8Array(32)
|
|
627
|
-
|
|
628
|
-
transferTransition.recipientId = newRecipient
|
|
629
|
-
|
|
630
|
-
assert.deepEqual(transferTransition.recipientId.bytes(), newRecipient)
|
|
631
|
-
})
|
|
632
|
-
})
|
|
633
|
-
|
|
634
|
-
describe('document Update Price transition', function () {
|
|
635
|
-
it('set base', () => {
|
|
636
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
637
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
638
|
-
|
|
639
|
-
const newBase = new wasm.DocumentBaseTransitionWASM(
|
|
640
|
-
documentInstance.id,
|
|
641
|
-
BigInt(12350),
|
|
642
|
-
'bbbbb',
|
|
643
|
-
dataContractId
|
|
644
|
-
)
|
|
645
|
-
|
|
646
|
-
updatePriceTransition.base = newBase
|
|
647
|
-
|
|
648
|
-
assert.equal(updatePriceTransition.base.identityContractNonce, newBase.identityContractNonce)
|
|
649
|
-
assert.notEqual(newBase.__wbg_ptr, 0)
|
|
650
|
-
})
|
|
651
|
-
|
|
652
|
-
it('set price', () => {
|
|
653
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
654
|
-
const updatePriceTransition = new wasm.DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
655
|
-
|
|
656
|
-
updatePriceTransition.price = BigInt(1111)
|
|
657
|
-
|
|
658
|
-
assert.deepEqual(updatePriceTransition.price, BigInt(1111))
|
|
659
|
-
})
|
|
660
|
-
})
|
|
661
|
-
|
|
662
|
-
describe('document Purchase transition', function () {
|
|
663
|
-
it('set base', () => {
|
|
664
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
665
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
666
|
-
|
|
667
|
-
const newBase = new wasm.DocumentBaseTransitionWASM(
|
|
668
|
-
documentInstance.id,
|
|
669
|
-
BigInt(12350),
|
|
670
|
-
'bbbbb',
|
|
671
|
-
dataContractId
|
|
672
|
-
)
|
|
673
|
-
|
|
674
|
-
purchaseTransition.base = newBase
|
|
675
|
-
|
|
676
|
-
assert.equal(purchaseTransition.base.identityContractNonce, newBase.identityContractNonce)
|
|
677
|
-
assert.notEqual(newBase.__wbg_ptr, 0)
|
|
678
|
-
})
|
|
679
|
-
|
|
680
|
-
it('set price', () => {
|
|
681
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
682
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
683
|
-
|
|
684
|
-
purchaseTransition.price = BigInt(1111)
|
|
685
|
-
|
|
686
|
-
assert.deepEqual(purchaseTransition.price, BigInt(1111))
|
|
687
|
-
})
|
|
688
|
-
|
|
689
|
-
it('set revision', () => {
|
|
690
|
-
const documentInstance = new wasm.DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
|
|
691
|
-
const purchaseTransition = new wasm.DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), BigInt(100))
|
|
692
|
-
|
|
693
|
-
purchaseTransition.revision = BigInt(1111)
|
|
694
|
-
|
|
695
|
-
assert.deepEqual(purchaseTransition.revision, BigInt(1111))
|
|
696
|
-
})
|
|
697
|
-
})
|
|
698
|
-
})
|
|
699
|
-
})
|