pshenmic-dpp 1.1.2-dev.7 → 2.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -99
- package/dist/binaries/bindingsTypes.d.ts +1696 -0
- package/dist/binaries/bindingsTypes.js +98 -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 +166 -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 +166 -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 +110 -0
- package/dist/src/dpp/dpp.js +110 -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/Address/AddressWitness.d.ts +12 -0
- package/dist/src/dpp/structs/Address/AddressWitness.js +23 -0
- package/dist/src/dpp/structs/Address/PlatformAddress.d.ts +14 -0
- package/dist/src/dpp/structs/Address/PlatformAddress.js +32 -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 +14 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +32 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +12 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +26 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +12 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +29 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.d.ts +19 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +51 -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 +13 -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 +32 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.js +74 -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 +20 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.js +92 -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 +21 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +53 -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 +35 -0
- package/dist/src/dpp/structs/DataContract.js +116 -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 +43 -0
- package/dist/src/dpp/structs/IdentityPublicKey.js +126 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +30 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +77 -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/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 +38 -0
- package/dist/src/dpp/structs/StateTransition.js +100 -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 +274 -0
- package/dist/src/dpp/types.js +1 -0
- package/dist/src/dpp/utils.d.ts +5 -0
- package/dist/src/dpp/utils.js +64 -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/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 +86 -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 -128
- 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 -4789
- package/dist/wasm/pshenmic_dpp.js +0 -23182
- 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 -1477
- 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,102 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { value, dataContractsBytes } = require('./mocks/DataContract/index.js')
|
|
4
|
-
const { fromHexString } = require('./utils/hex')
|
|
5
|
-
const { default: wasm } = require('..')
|
|
6
|
-
|
|
7
|
-
describe('DataContract Create Transition', function () {
|
|
8
|
-
describe('serialization / deserialization', function () {
|
|
9
|
-
it('should allow to create document_transitions from data contract', () => {
|
|
10
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
11
|
-
|
|
12
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
13
|
-
|
|
14
|
-
assert.notEqual(dataContractTransition.__wbg_ptr, 0)
|
|
15
|
-
assert.notEqual(dataContract.__wbg_ptr, 0)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('should allow to convert document_transitions to bytes and create from bytes', () => {
|
|
19
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
20
|
-
|
|
21
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
22
|
-
|
|
23
|
-
const bytes = dataContractTransition.bytes()
|
|
24
|
-
|
|
25
|
-
const newDataContractTransition = wasm.DataContractCreateTransitionWASM.fromBytes(bytes)
|
|
26
|
-
|
|
27
|
-
assert.deepEqual(newDataContractTransition.bytes(), bytes)
|
|
28
|
-
assert.notEqual(newDataContractTransition.__wbg_ptr, 0)
|
|
29
|
-
assert.notEqual(dataContractTransition.__wbg_ptr, 0)
|
|
30
|
-
assert.notEqual(dataContract.__wbg_ptr, 0)
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('should allow to convert data contract transition to state document_transitions and create data contract transition from state transition', () => {
|
|
34
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
35
|
-
|
|
36
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
37
|
-
|
|
38
|
-
const stateTransition = dataContractTransition.toStateTransition()
|
|
39
|
-
|
|
40
|
-
const newDataContractTransition = wasm.DataContractCreateTransitionWASM.fromStateTransition(stateTransition)
|
|
41
|
-
|
|
42
|
-
assert.deepEqual(dataContractTransition.bytes(), newDataContractTransition.bytes())
|
|
43
|
-
})
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
describe('getters', function () {
|
|
47
|
-
it('should allow to get feature version', () => {
|
|
48
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
49
|
-
|
|
50
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
51
|
-
|
|
52
|
-
assert.equal(dataContractTransition.featureVersion, 0)
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('should allow to verify protocol version', () => {
|
|
56
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
57
|
-
|
|
58
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
59
|
-
|
|
60
|
-
assert.equal(dataContractTransition.verifyProtocolVersion(1), true)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
it('should allow to verify incorrect protocol version', () => {
|
|
64
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
65
|
-
|
|
66
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
dataContractTransition.verifyProtocolVersion(20)
|
|
70
|
-
assert.equal(true, false)
|
|
71
|
-
} catch (error) {
|
|
72
|
-
assert.equal(false, false)
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
it('should allow to get data contract', () => {
|
|
77
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
78
|
-
|
|
79
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
80
|
-
|
|
81
|
-
const newDataContract = dataContractTransition.getDataContract()
|
|
82
|
-
|
|
83
|
-
assert.deepEqual(dataContract.bytes(), newDataContract.bytes())
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
describe('setters', function () {
|
|
88
|
-
it('should allow to set the data contract', () => {
|
|
89
|
-
const [dataContractBytes] = dataContractsBytes
|
|
90
|
-
|
|
91
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
92
|
-
|
|
93
|
-
const dataContractTransition = new wasm.DataContractCreateTransitionWASM(dataContract, BigInt(1))
|
|
94
|
-
|
|
95
|
-
const newDataContract = wasm.DataContractWASM.fromBytes(fromHexString(dataContractBytes), false)
|
|
96
|
-
|
|
97
|
-
dataContractTransition.setDataContract(newDataContract)
|
|
98
|
-
|
|
99
|
-
assert.deepEqual(fromHexString(dataContractBytes), dataContractTransition.getDataContract().bytes())
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
})
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { value, dataContractsBytes } = require('./mocks/DataContract/index.js')
|
|
4
|
-
const { PlatformVersionWASM } = require('..')
|
|
5
|
-
const { fromHexString } = require('./utils/hex')
|
|
6
|
-
const { default: wasm } = require('..')
|
|
7
|
-
|
|
8
|
-
describe('DataContract Updatet Transition', function () {
|
|
9
|
-
describe('serialization / deserialization', function () {
|
|
10
|
-
it('should allow to create document_transitions from data contract', () => {
|
|
11
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
12
|
-
|
|
13
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
14
|
-
|
|
15
|
-
assert.notEqual(dataContractTransition.__wbg_ptr, 0)
|
|
16
|
-
assert.notEqual(dataContract.__wbg_ptr, 0)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should allow to convert document_transitions to bytes and create from bytes', () => {
|
|
20
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
21
|
-
|
|
22
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
23
|
-
|
|
24
|
-
const bytes = dataContractTransition.bytes()
|
|
25
|
-
|
|
26
|
-
const newDataContractTransition = wasm.DataContractUpdateTransitionWASM.fromBytes(bytes)
|
|
27
|
-
|
|
28
|
-
assert.deepEqual(newDataContractTransition.bytes(), bytes)
|
|
29
|
-
assert.notEqual(newDataContractTransition.__wbg_ptr, 0)
|
|
30
|
-
assert.notEqual(dataContractTransition.__wbg_ptr, 0)
|
|
31
|
-
assert.notEqual(dataContract.__wbg_ptr, 0)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should allow to convert data contract transition to state document_transitions and create data contract transition from state transition', () => {
|
|
35
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
36
|
-
|
|
37
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
38
|
-
|
|
39
|
-
const stateTransition = dataContractTransition.toStateTransition()
|
|
40
|
-
|
|
41
|
-
const newDataContractTransition = wasm.DataContractUpdateTransitionWASM.fromStateTransition(stateTransition)
|
|
42
|
-
|
|
43
|
-
assert.deepEqual(dataContractTransition.bytes(), newDataContractTransition.bytes())
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
describe('getters', function () {
|
|
48
|
-
it('should allow to get feature version', () => {
|
|
49
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
50
|
-
|
|
51
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
52
|
-
|
|
53
|
-
assert.equal(dataContractTransition.featureVersion, 0)
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('should allow to verify protocol version', () => {
|
|
57
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
58
|
-
|
|
59
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
60
|
-
|
|
61
|
-
assert.equal(dataContractTransition.verifyProtocolVersion(1), true)
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
it('should allow to verify incorrect protocol version', () => {
|
|
65
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
66
|
-
|
|
67
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
dataContractTransition.verifyProtocolVersion(20)
|
|
71
|
-
assert.equal(true, false)
|
|
72
|
-
} catch (error) {
|
|
73
|
-
assert.equal(false, false)
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
it('should allow to get data contract', () => {
|
|
78
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
79
|
-
|
|
80
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
81
|
-
|
|
82
|
-
const newDataContract = dataContractTransition.getDataContract()
|
|
83
|
-
|
|
84
|
-
assert.deepEqual(dataContract.bytes(), newDataContract.bytes())
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
describe('setters', function () {
|
|
89
|
-
it('should allow to set the data contract', () => {
|
|
90
|
-
const [dataContractBytes] = dataContractsBytes
|
|
91
|
-
|
|
92
|
-
const dataContract = wasm.DataContractWASM.fromValue(value, false)
|
|
93
|
-
|
|
94
|
-
const dataContractTransition = new wasm.DataContractUpdateTransitionWASM(dataContract, BigInt(1))
|
|
95
|
-
|
|
96
|
-
const newDataContract = wasm.DataContractWASM.fromBytes(fromHexString(dataContractBytes), false)
|
|
97
|
-
|
|
98
|
-
dataContractTransition.setDataContract(newDataContract)
|
|
99
|
-
|
|
100
|
-
assert.deepEqual(fromHexString(dataContractBytes), newDataContract.bytes())
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
})
|
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('..')
|
|
4
|
-
|
|
5
|
-
describe('DistributionFunction', function () {
|
|
6
|
-
describe('serialization / deserialization', function () {
|
|
7
|
-
it('shoulda allow to create FixedAmountDistribution', () => {
|
|
8
|
-
const distributionFunction = wasm.DistributionFunctionWASM.FixedAmountDistribution(
|
|
9
|
-
BigInt(111)
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('shoulda allow to create Random', () => {
|
|
16
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Random(
|
|
17
|
-
BigInt(111),
|
|
18
|
-
BigInt(113)
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('shoulda allow to create StepDecreasingAmount', () => {
|
|
25
|
-
const distributionFunction = wasm.DistributionFunctionWASM.StepDecreasingAmount(
|
|
26
|
-
11,
|
|
27
|
-
11,
|
|
28
|
-
11,
|
|
29
|
-
undefined,
|
|
30
|
-
undefined,
|
|
31
|
-
BigInt(111),
|
|
32
|
-
BigInt(113),
|
|
33
|
-
BigInt(1)
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
it('shoulda allow to create Stepwise', () => {
|
|
40
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Stepwise(
|
|
41
|
-
{
|
|
42
|
-
11111111121: BigInt(111)
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('shoulda allow to create Linear', () => {
|
|
50
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Linear(
|
|
51
|
-
BigInt(111),
|
|
52
|
-
BigInt(113),
|
|
53
|
-
undefined,
|
|
54
|
-
BigInt(113),
|
|
55
|
-
undefined,
|
|
56
|
-
undefined
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
it('shoulda allow to create Polynomial', () => {
|
|
63
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Polynomial(
|
|
64
|
-
BigInt(111),
|
|
65
|
-
BigInt(113),
|
|
66
|
-
BigInt(113),
|
|
67
|
-
BigInt(113),
|
|
68
|
-
BigInt(113),
|
|
69
|
-
undefined,
|
|
70
|
-
BigInt(113),
|
|
71
|
-
undefined,
|
|
72
|
-
undefined
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
it('shoulda allow to create Exponential', () => {
|
|
79
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Exponential(
|
|
80
|
-
BigInt(111),
|
|
81
|
-
BigInt(113),
|
|
82
|
-
BigInt(113),
|
|
83
|
-
BigInt(113),
|
|
84
|
-
BigInt(113),
|
|
85
|
-
undefined,
|
|
86
|
-
BigInt(113),
|
|
87
|
-
undefined,
|
|
88
|
-
undefined
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
it('shoulda allow to create Logarithmic', () => {
|
|
95
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Logarithmic(
|
|
96
|
-
BigInt(111),
|
|
97
|
-
BigInt(113),
|
|
98
|
-
BigInt(113),
|
|
99
|
-
BigInt(113),
|
|
100
|
-
BigInt(113),
|
|
101
|
-
undefined,
|
|
102
|
-
BigInt(113),
|
|
103
|
-
undefined,
|
|
104
|
-
undefined
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('shoulda allow to create InvertedLogarithmic', () => {
|
|
111
|
-
const distributionFunction = wasm.DistributionFunctionWASM.InvertedLogarithmic(
|
|
112
|
-
BigInt(111),
|
|
113
|
-
BigInt(113),
|
|
114
|
-
BigInt(113),
|
|
115
|
-
BigInt(113),
|
|
116
|
-
BigInt(113),
|
|
117
|
-
undefined,
|
|
118
|
-
BigInt(113),
|
|
119
|
-
undefined,
|
|
120
|
-
undefined
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
assert.notEqual(distributionFunction.__wbg_ptr, 0)
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
describe('getters', function () {
|
|
128
|
-
describe('function name', function () {
|
|
129
|
-
it('FixedAmountDistribution', () => {
|
|
130
|
-
const distributionFunction = wasm.DistributionFunctionWASM.FixedAmountDistribution(
|
|
131
|
-
BigInt(111)
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'FixedAmount')
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
it('Random', () => {
|
|
138
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Random(
|
|
139
|
-
BigInt(111),
|
|
140
|
-
BigInt(113)
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'Random')
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
it('StepDecreasingAmount', () => {
|
|
147
|
-
const distributionFunction = wasm.DistributionFunctionWASM.StepDecreasingAmount(
|
|
148
|
-
11,
|
|
149
|
-
11,
|
|
150
|
-
11,
|
|
151
|
-
undefined,
|
|
152
|
-
undefined,
|
|
153
|
-
BigInt(111),
|
|
154
|
-
BigInt(113),
|
|
155
|
-
BigInt(1)
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'StepDecreasingAmount')
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
it('Stepwise', () => {
|
|
162
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Stepwise(
|
|
163
|
-
{
|
|
164
|
-
11111111121: BigInt(111)
|
|
165
|
-
}
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'Stepwise')
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
it('Linear', () => {
|
|
172
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Linear(
|
|
173
|
-
BigInt(111),
|
|
174
|
-
BigInt(113),
|
|
175
|
-
undefined,
|
|
176
|
-
BigInt(113),
|
|
177
|
-
undefined,
|
|
178
|
-
undefined
|
|
179
|
-
)
|
|
180
|
-
|
|
181
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'Linear')
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
it('Polynomial', () => {
|
|
185
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Polynomial(
|
|
186
|
-
BigInt(111),
|
|
187
|
-
BigInt(113),
|
|
188
|
-
BigInt(113),
|
|
189
|
-
BigInt(113),
|
|
190
|
-
BigInt(113),
|
|
191
|
-
undefined,
|
|
192
|
-
BigInt(113),
|
|
193
|
-
undefined,
|
|
194
|
-
undefined
|
|
195
|
-
)
|
|
196
|
-
|
|
197
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'Polynomial')
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
it('Exponential', () => {
|
|
201
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Exponential(
|
|
202
|
-
BigInt(111),
|
|
203
|
-
BigInt(113),
|
|
204
|
-
BigInt(113),
|
|
205
|
-
BigInt(113),
|
|
206
|
-
BigInt(113),
|
|
207
|
-
undefined,
|
|
208
|
-
BigInt(113),
|
|
209
|
-
undefined,
|
|
210
|
-
undefined
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'Exponential')
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
it('Logarithmic', () => {
|
|
217
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Logarithmic(
|
|
218
|
-
BigInt(111),
|
|
219
|
-
BigInt(113),
|
|
220
|
-
BigInt(113),
|
|
221
|
-
BigInt(113),
|
|
222
|
-
BigInt(113),
|
|
223
|
-
undefined,
|
|
224
|
-
BigInt(113),
|
|
225
|
-
undefined,
|
|
226
|
-
undefined
|
|
227
|
-
)
|
|
228
|
-
|
|
229
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'Logarithmic')
|
|
230
|
-
})
|
|
231
|
-
|
|
232
|
-
it('InvertedLogarithmic', () => {
|
|
233
|
-
const distributionFunction = wasm.DistributionFunctionWASM.InvertedLogarithmic(
|
|
234
|
-
BigInt(111),
|
|
235
|
-
BigInt(113),
|
|
236
|
-
BigInt(113),
|
|
237
|
-
BigInt(113),
|
|
238
|
-
BigInt(113),
|
|
239
|
-
undefined,
|
|
240
|
-
BigInt(113),
|
|
241
|
-
undefined,
|
|
242
|
-
undefined
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
assert.deepEqual(distributionFunction.getFunctionName(), 'InvertedLogarithmic')
|
|
246
|
-
})
|
|
247
|
-
})
|
|
248
|
-
describe('function value', function () {
|
|
249
|
-
it('FixedAmountDistribution', () => {
|
|
250
|
-
const distributionFunction = wasm.DistributionFunctionWASM.FixedAmountDistribution(
|
|
251
|
-
BigInt(111)
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
assert.deepEqual(distributionFunction.getFunctionValue().amount, 111n)
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
it('Random', () => {
|
|
258
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Random(
|
|
259
|
-
BigInt(111),
|
|
260
|
-
BigInt(113)
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
assert.deepEqual(distributionFunction.getFunctionValue().min, 111n)
|
|
264
|
-
assert.deepEqual(distributionFunction.getFunctionValue().max, 113n)
|
|
265
|
-
})
|
|
266
|
-
|
|
267
|
-
it('StepDecreasingAmount', () => {
|
|
268
|
-
const distributionFunction = wasm.DistributionFunctionWASM.StepDecreasingAmount(
|
|
269
|
-
11,
|
|
270
|
-
11,
|
|
271
|
-
11,
|
|
272
|
-
undefined,
|
|
273
|
-
undefined,
|
|
274
|
-
BigInt(111),
|
|
275
|
-
BigInt(113),
|
|
276
|
-
BigInt(1)
|
|
277
|
-
)
|
|
278
|
-
|
|
279
|
-
assert.deepEqual(distributionFunction.getFunctionValue().stepCount, 11)
|
|
280
|
-
assert.deepEqual(distributionFunction.getFunctionValue().decreasePerIntervalNumerator, 11)
|
|
281
|
-
assert.deepEqual(distributionFunction.getFunctionValue().decreasePerIntervalDenominator, 11)
|
|
282
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startDecreasingOffset, undefined)
|
|
283
|
-
assert.deepEqual(distributionFunction.getFunctionValue().maxIntervalCount, undefined)
|
|
284
|
-
assert.deepEqual(distributionFunction.getFunctionValue().distributionStartAmount, 111n)
|
|
285
|
-
assert.deepEqual(distributionFunction.getFunctionValue().trailingDistributionIntervalAmount, 113n)
|
|
286
|
-
assert.deepEqual(distributionFunction.getFunctionValue().minValue, 1n)
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
it('Stepwise', () => {
|
|
290
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Stepwise(
|
|
291
|
-
{
|
|
292
|
-
11111111121: BigInt(111)
|
|
293
|
-
}
|
|
294
|
-
)
|
|
295
|
-
|
|
296
|
-
assert.deepEqual(distributionFunction.getFunctionValue(), {
|
|
297
|
-
11111111121: BigInt(111)
|
|
298
|
-
})
|
|
299
|
-
})
|
|
300
|
-
|
|
301
|
-
it('Linear', () => {
|
|
302
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Linear(
|
|
303
|
-
BigInt(111),
|
|
304
|
-
BigInt(113),
|
|
305
|
-
undefined,
|
|
306
|
-
BigInt(113),
|
|
307
|
-
undefined,
|
|
308
|
-
undefined
|
|
309
|
-
)
|
|
310
|
-
|
|
311
|
-
assert.deepEqual(distributionFunction.getFunctionValue().a, 111n)
|
|
312
|
-
assert.deepEqual(distributionFunction.getFunctionValue().d, 113n)
|
|
313
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startStep, undefined)
|
|
314
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startingAmount, 113n)
|
|
315
|
-
assert.deepEqual(distributionFunction.getFunctionValue().minValue, undefined)
|
|
316
|
-
assert.deepEqual(distributionFunction.getFunctionValue().maxValue, undefined)
|
|
317
|
-
})
|
|
318
|
-
|
|
319
|
-
it('Polynomial', () => {
|
|
320
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Polynomial(
|
|
321
|
-
BigInt(111),
|
|
322
|
-
BigInt(113),
|
|
323
|
-
BigInt(113),
|
|
324
|
-
BigInt(113),
|
|
325
|
-
BigInt(113),
|
|
326
|
-
undefined,
|
|
327
|
-
BigInt(113),
|
|
328
|
-
undefined,
|
|
329
|
-
undefined
|
|
330
|
-
)
|
|
331
|
-
|
|
332
|
-
assert.deepEqual(distributionFunction.getFunctionValue().a, 111n)
|
|
333
|
-
assert.deepEqual(distributionFunction.getFunctionValue().d, 113n)
|
|
334
|
-
assert.deepEqual(distributionFunction.getFunctionValue().m, 113n)
|
|
335
|
-
assert.deepEqual(distributionFunction.getFunctionValue().n, 113n)
|
|
336
|
-
assert.deepEqual(distributionFunction.getFunctionValue().o, 113n)
|
|
337
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startMoment, undefined)
|
|
338
|
-
assert.deepEqual(distributionFunction.getFunctionValue().b, 113n)
|
|
339
|
-
assert.deepEqual(distributionFunction.getFunctionValue().minValue, undefined)
|
|
340
|
-
assert.deepEqual(distributionFunction.getFunctionValue().maxValue, undefined)
|
|
341
|
-
})
|
|
342
|
-
|
|
343
|
-
it('Exponential', () => {
|
|
344
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Exponential(
|
|
345
|
-
BigInt(111),
|
|
346
|
-
BigInt(113),
|
|
347
|
-
BigInt(113),
|
|
348
|
-
BigInt(113),
|
|
349
|
-
BigInt(113),
|
|
350
|
-
undefined,
|
|
351
|
-
BigInt(113),
|
|
352
|
-
undefined,
|
|
353
|
-
undefined
|
|
354
|
-
)
|
|
355
|
-
|
|
356
|
-
assert.deepEqual(distributionFunction.getFunctionValue().a, 111n)
|
|
357
|
-
assert.deepEqual(distributionFunction.getFunctionValue().d, 113n)
|
|
358
|
-
assert.deepEqual(distributionFunction.getFunctionValue().m, 113n)
|
|
359
|
-
assert.deepEqual(distributionFunction.getFunctionValue().n, 113n)
|
|
360
|
-
assert.deepEqual(distributionFunction.getFunctionValue().o, 113n)
|
|
361
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startMoment, undefined)
|
|
362
|
-
assert.deepEqual(distributionFunction.getFunctionValue().b, 113n)
|
|
363
|
-
assert.deepEqual(distributionFunction.getFunctionValue().minValue, undefined)
|
|
364
|
-
assert.deepEqual(distributionFunction.getFunctionValue().maxValue, undefined)
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
it('Logarithmic', () => {
|
|
368
|
-
const distributionFunction = wasm.DistributionFunctionWASM.Logarithmic(
|
|
369
|
-
BigInt(111),
|
|
370
|
-
BigInt(113),
|
|
371
|
-
BigInt(113),
|
|
372
|
-
BigInt(113),
|
|
373
|
-
BigInt(113),
|
|
374
|
-
undefined,
|
|
375
|
-
BigInt(113),
|
|
376
|
-
undefined,
|
|
377
|
-
undefined
|
|
378
|
-
)
|
|
379
|
-
|
|
380
|
-
assert.deepEqual(distributionFunction.getFunctionValue().a, 111n)
|
|
381
|
-
assert.deepEqual(distributionFunction.getFunctionValue().d, 113n)
|
|
382
|
-
assert.deepEqual(distributionFunction.getFunctionValue().m, 113n)
|
|
383
|
-
assert.deepEqual(distributionFunction.getFunctionValue().n, 113n)
|
|
384
|
-
assert.deepEqual(distributionFunction.getFunctionValue().o, 113n)
|
|
385
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startMoment, undefined)
|
|
386
|
-
assert.deepEqual(distributionFunction.getFunctionValue().b, 113n)
|
|
387
|
-
assert.deepEqual(distributionFunction.getFunctionValue().minValue, undefined)
|
|
388
|
-
assert.deepEqual(distributionFunction.getFunctionValue().maxValue, undefined)
|
|
389
|
-
})
|
|
390
|
-
|
|
391
|
-
it('InvertedLogarithmic', () => {
|
|
392
|
-
const distributionFunction = wasm.DistributionFunctionWASM.InvertedLogarithmic(
|
|
393
|
-
BigInt(111),
|
|
394
|
-
BigInt(113),
|
|
395
|
-
BigInt(113),
|
|
396
|
-
BigInt(113),
|
|
397
|
-
BigInt(113),
|
|
398
|
-
undefined,
|
|
399
|
-
BigInt(113),
|
|
400
|
-
undefined,
|
|
401
|
-
undefined
|
|
402
|
-
)
|
|
403
|
-
|
|
404
|
-
assert.deepEqual(distributionFunction.getFunctionValue().a, 111n)
|
|
405
|
-
assert.deepEqual(distributionFunction.getFunctionValue().d, 113n)
|
|
406
|
-
assert.deepEqual(distributionFunction.getFunctionValue().m, 113n)
|
|
407
|
-
assert.deepEqual(distributionFunction.getFunctionValue().n, 113n)
|
|
408
|
-
assert.deepEqual(distributionFunction.getFunctionValue().o, 113n)
|
|
409
|
-
assert.deepEqual(distributionFunction.getFunctionValue().startMoment, undefined)
|
|
410
|
-
assert.deepEqual(distributionFunction.getFunctionValue().b, 113n)
|
|
411
|
-
assert.deepEqual(distributionFunction.getFunctionValue().minValue, undefined)
|
|
412
|
-
assert.deepEqual(distributionFunction.getFunctionValue().maxValue, undefined)
|
|
413
|
-
})
|
|
414
|
-
})
|
|
415
|
-
})
|
|
416
|
-
})
|