@dashevo/wasm-dpp 0.23.0-dev.15 → 0.24.0-dev.11
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/.eslintignore +1 -0
- package/Cargo.toml +25 -0
- package/README.md +21 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +8 -0
- package/dist/lib/patchIdentifier.d.ts +2 -0
- package/dist/wasm/wasm_dpp.d.ts +2850 -0
- package/index.ts +30 -0
- package/karma.conf.js +6 -3
- package/lib/patchIdentifier.ts +37 -0
- package/lib/test/.eslintrc +9 -0
- package/lib/test/bootstrap.js +27 -0
- package/lib/test/expect/expectError.js +34 -0
- package/lib/test/karma/loader.js +6 -0
- package/lib/test/utils/generateRandomIdentifierAsync.js +14 -0
- package/package.json +31 -55
- package/scripts/build.sh +69 -0
- package/scripts/clean.sh +4 -0
- package/src/bls_adapter.rs +71 -0
- package/src/buffer.rs +15 -0
- package/src/dash_platform_protocol.rs +26 -0
- package/src/data_contract/data_contract.rs +290 -0
- package/src/data_contract/errors/data_contract_already_exists.rs +1 -0
- package/src/data_contract/errors/invalid_data_contract.rs +29 -0
- package/src/data_contract/errors/invalid_document_type.rs +33 -0
- package/src/data_contract/errors/mod.rs +37 -0
- package/src/data_contract/index.rs +61 -0
- package/src/data_contract/mod.rs +10 -0
- package/src/data_contract/state_transition/data_contract_create_transition/apply.rs +44 -0
- package/src/data_contract/state_transition/data_contract_create_transition/mod.rs +138 -0
- package/src/data_contract/state_transition/data_contract_create_transition/validation.rs +24 -0
- package/src/data_contract/state_transition/mod.rs +3 -0
- package/src/data_contract_factory/data_contract_factory.rs +155 -0
- package/src/data_contract_factory/mod.rs +1 -0
- package/src/document/errors/document_already_exists_error.rs +28 -0
- package/src/document/errors/document_not_provided_error.rs +28 -0
- package/src/document/errors/invalid_action_name_error.rs +24 -0
- package/src/document/errors/invalid_document_action_error.rs +28 -0
- package/src/document/errors/invalid_document_error.rs +32 -0
- package/src/document/errors/invalid_initial_revision_error.rs +25 -0
- package/src/document/errors/mismatch_owners_ids_error.rs +27 -0
- package/src/document/errors/mod.rs +55 -0
- package/src/document/errors/no_documents_supplied_error.rs +22 -0
- package/src/document/mod.rs +158 -0
- package/src/document/state_transition/document_batch_transition/document_transition/document_create_transition.rs +22 -0
- package/src/document/state_transition/document_batch_transition/document_transition/document_delete_transition.rs +22 -0
- package/src/document/state_transition/document_batch_transition/document_transition/document_update_transition.rs +22 -0
- package/src/document/state_transition/document_batch_transition/document_transition/mod.rs +24 -0
- package/src/document/state_transition/document_batch_transition/mod.rs +1 -0
- package/src/document/state_transition/mod.rs +1 -0
- package/src/errors/consensus/basic/data_contract/data_contract_have_new_unique_index_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/data_contract_immutable_properties_update_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/data_contract_invalid_index_definition_update_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/data_contract_max_depth_exceed_error.rs +26 -0
- package/src/errors/consensus/basic/data_contract/data_contract_unique_indices_changed_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/duplicate_index_name_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/incompatible_data_contract_schema_error.rs +66 -0
- package/src/errors/consensus/basic/data_contract/incompatible_re2_pattern_error.rs +43 -0
- package/src/errors/consensus/basic/data_contract/index_error/duplicate_index_error.rs +39 -0
- package/src/errors/consensus/basic/data_contract/index_error/invalid_compound_index_error.rs +39 -0
- package/src/errors/consensus/basic/data_contract/index_error/invalid_index_property_type_error.rs +59 -0
- package/src/errors/consensus/basic/data_contract/index_error/invalid_indexed_property_constraint_error.rs +67 -0
- package/src/errors/consensus/basic/data_contract/index_error/mod.rs +15 -0
- package/src/errors/consensus/basic/data_contract/index_error/system_property_index_already_present_error.rs +51 -0
- package/src/errors/consensus/basic/data_contract/index_error/undefined_index_property_error.rs +51 -0
- package/src/errors/consensus/basic/data_contract/index_error/unique_indices_limit_reached_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/invalid_data_contract_id_error.rs +37 -0
- package/src/errors/consensus/basic/data_contract/invalid_data_contract_version_error.rs +36 -0
- package/src/errors/consensus/basic/data_contract/invalid_json_schema_ref_error.rs +26 -0
- package/src/errors/consensus/basic/data_contract/mod.rs +25 -0
- package/src/errors/consensus/basic/decode/mod.rs +5 -0
- package/src/errors/consensus/basic/decode/protocol_version_parsing_error.rs +29 -0
- package/src/errors/consensus/basic/decode/serialized_object_parsing_error.rs +29 -0
- package/src/errors/consensus/basic/document/data_contract_not_present_error.rs +32 -0
- package/src/errors/consensus/basic/document/duplicate_document_transitions_with_ids_error.rs +36 -0
- package/src/errors/consensus/basic/document/inconsistent_compound_index_data_error.rs +40 -0
- package/src/errors/consensus/basic/document/invalid_document_transition_action_error.rs +26 -0
- package/src/errors/consensus/basic/document/invalid_document_transition_id_error.rs +38 -0
- package/src/errors/consensus/basic/document/invalid_document_type_error.rs +39 -0
- package/src/errors/consensus/basic/document/missing_data_contract_id_error.rs +20 -0
- package/src/errors/consensus/basic/document/missing_document_transition_action_error.rs +20 -0
- package/src/errors/consensus/basic/document/missing_document_type_error.rs +20 -0
- package/src/errors/consensus/basic/document/mod.rs +19 -0
- package/src/errors/consensus/basic/identity/duplicated_identity_public_key_error.rs +32 -0
- package/src/errors/consensus/basic/identity/duplicated_identity_public_key_id_error.rs +32 -0
- package/src/errors/consensus/basic/identity/identity_asset_lock_proof_locked_transaction_mismatch_error.rs +38 -0
- package/src/errors/consensus/basic/identity/identity_asset_lock_transaction_is_not_found_error.rs +31 -0
- package/src/errors/consensus/basic/identity/identity_asset_lock_transaction_out_point_already_exists_error.rs +37 -0
- package/src/errors/consensus/basic/identity/identity_asset_lock_transaction_output_not_found_error.rs +29 -0
- package/src/errors/consensus/basic/identity/identity_insufficient_balance_error.rs +33 -0
- package/src/errors/consensus/basic/identity/invalid_asset_lock_proof_core_chain_height_error.rs +34 -0
- package/src/errors/consensus/basic/identity/invalid_asset_lock_proof_transaction_height_error.rs +34 -0
- package/src/errors/consensus/basic/identity/invalid_asset_lock_transaction_output_return_size_error.rs +29 -0
- package/src/errors/consensus/basic/identity/invalid_identity_asset_lock_transaction_error.rs +60 -0
- package/src/errors/consensus/basic/identity/invalid_identity_asset_lock_transaction_output_error.rs +29 -0
- package/src/errors/consensus/basic/identity/invalid_identity_credit_withdrawal_transition_core_fee_error.rs +29 -0
- package/src/errors/consensus/basic/identity/invalid_identity_credit_withdrawal_transition_output_script_error.rs +32 -0
- package/src/errors/consensus/basic/identity/invalid_identity_key_signature_error.rs +29 -0
- package/src/errors/consensus/basic/identity/invalid_identity_public_key_data_error.rs +39 -0
- package/src/errors/consensus/basic/identity/invalid_identity_public_key_security_level_error.rs +42 -0
- package/src/errors/consensus/basic/identity/invalid_identity_public_key_type_error.rs +30 -0
- package/src/errors/consensus/basic/identity/invalid_instant_asset_lock_proof_error.rs +22 -0
- package/src/errors/consensus/basic/identity/invalid_instant_asset_lock_proof_signature_error.rs +24 -0
- package/src/errors/consensus/basic/identity/missing_master_public_key_error.rs +22 -0
- package/src/errors/consensus/basic/identity/missing_public_key_error.rs +29 -0
- package/src/errors/consensus/basic/identity/mod.rs +45 -0
- package/src/errors/consensus/basic/incompatible_protocol_version_error.rs +32 -0
- package/src/errors/consensus/basic/invalid_identifier_error.rs +36 -0
- package/src/errors/consensus/basic/invalid_signature_public_key_security_level_error.rs +41 -0
- package/src/errors/consensus/basic/invalid_state_transition_signature_error.rs +20 -0
- package/src/errors/consensus/basic/json_schema_compilation_error.rs +26 -0
- package/src/errors/consensus/basic/json_schema_error.rs +274 -0
- package/src/errors/consensus/basic/mod.rs +30 -0
- package/src/errors/consensus/basic/public_key_is_disabled_error.rs +30 -0
- package/src/errors/consensus/basic/public_key_security_level_not_met_error.rs +41 -0
- package/src/errors/consensus/basic/state_transition/invalid_state_transition_type_error.rs +29 -0
- package/src/errors/consensus/basic/state_transition/missing_state_transition_type_error.rs +20 -0
- package/src/errors/consensus/basic/state_transition/mod.rs +7 -0
- package/src/errors/consensus/basic/state_transition/state_transition_max_size_exceeded_error.rs +36 -0
- package/src/errors/consensus/basic/test_consensus_error.rs +21 -0
- package/src/errors/consensus/basic/unsupported_protocol_version_error.rs +32 -0
- package/src/errors/consensus/basic/wrong_public_key_purpose_error.rs +37 -0
- package/src/errors/consensus/fee/balance_is_not_enough_error.rs +32 -0
- package/src/errors/consensus/fee/mod.rs +3 -0
- package/src/errors/consensus/mod.rs +4 -0
- package/src/errors/consensus/signature/identity_not_found_error.rs +29 -0
- package/src/errors/consensus/signature/mod.rs +3 -0
- package/src/errors/consensus/state/data_contract/data_contract_already_present_error.rs +31 -0
- package/src/errors/consensus/state/data_contract/data_trigger/data_trigger_condition_error.rs +74 -0
- package/src/errors/consensus/state/data_contract/data_trigger/data_trigger_execution_error.rs +82 -0
- package/src/errors/consensus/state/data_contract/data_trigger/data_trigger_invalid_result_error.rs +66 -0
- package/src/errors/consensus/state/data_contract/data_trigger/mod.rs +7 -0
- package/src/errors/consensus/state/data_contract/mod.rs +4 -0
- package/src/errors/consensus/state/document/document_already_present_error.rs +28 -0
- package/src/errors/consensus/state/document/document_not_found_error.rs +28 -0
- package/src/errors/consensus/state/document/document_owner_id_mismatch_error.rs +50 -0
- package/src/errors/consensus/state/document/document_timestamp_window_violation_error.rs +72 -0
- package/src/errors/consensus/state/document/document_timestamps_mismatch_error.rs +28 -0
- package/src/errors/consensus/state/document/duplicate_unique_index_error.rs +42 -0
- package/src/errors/consensus/state/document/invalid_document_revision_error.rs +38 -0
- package/src/errors/consensus/state/document/mod.rs +15 -0
- package/src/errors/consensus/state/identity/identity_already_exists_error.rs +28 -0
- package/src/errors/consensus/state/identity/identity_public_key_disabled_at_window_violation_error.rs +49 -0
- package/src/errors/consensus/state/identity/identity_public_key_is_disabled_error.rs +31 -0
- package/src/errors/consensus/state/identity/identity_public_key_is_read_only_error.rs +28 -0
- package/src/errors/consensus/state/identity/invalid_identity_public_key_id_error.rs +28 -0
- package/src/errors/consensus/state/identity/invalid_identity_revision_error.rs +38 -0
- package/src/errors/consensus/state/identity/max_identity_public_key_limit_reached_error.rs +26 -0
- package/src/errors/consensus/state/identity/mod.rs +15 -0
- package/src/errors/consensus/state/mod.rs +3 -0
- package/src/errors/consensus_error.rs +612 -0
- package/src/errors/from.rs +24 -0
- package/src/errors/js_conversion.rs +63 -0
- package/src/errors/mod.rs +10 -0
- package/src/errors/public_key_validation_error.rs +23 -0
- package/src/identifier.rs +103 -0
- package/src/identity.rs +253 -0
- package/src/identity_facade.rs +55 -0
- package/src/identity_public_key/key_type.rs +22 -0
- package/src/identity_public_key/mod.rs +192 -0
- package/src/identity_public_key/public_keys_validator.rs +44 -0
- package/src/identity_public_key/purpose.rs +24 -0
- package/src/identity_public_key/security_level.rs +21 -0
- package/src/lib.rs +29 -0
- package/src/metadata.rs +54 -0
- package/src/state_repository.rs +229 -0
- package/src/state_transition/mod.rs +41 -0
- package/src/utils.rs +59 -0
- package/src/validation_result.rs +41 -0
- package/test/integration/DashPlatformProtocol.spec.js +4 -4
- package/test/integration/ajv/keywords/byteArray/addByteArrayKeyword.spec.js +2 -2
- package/test/integration/dataContract/DataContractFacade.spec.js +6 -6
- package/test/integration/dataContract/stateTransition/DataContractCreateTransition/validation/basic/validateDataContractCreateTransitionBasicFactory.spec.js +10 -10
- package/test/integration/dataContract/stateTransition/DataContractUpdateTransition/validation/basic/validateDataContractUpdateTransitionBasicFactory.spec.js +14 -14
- package/test/integration/dataContract/validation/validateDataContractFactory.spec.js +22 -22
- package/test/integration/document/Document.spec.js +10 -5
- package/test/integration/document/DocumentFacade.spec.js +11 -11
- package/test/integration/document/stateTransition/DocumentsBatchTransition/DocumentBatchTransition.spec.js +5 -5
- package/test/integration/document/stateTransition/DocumentsBatchTransition/validation/basic/validateDocumentsBatchTransitionBasicFactory.spec.js +25 -25
- package/test/integration/document/stateTransition/DocumentsBatchTransition/validation/state/executeDataTriggersFactory.spec.js +15 -15
- package/test/integration/document/validation/validateDocumentFactory.spec.js +12 -12
- package/test/integration/error/consensus/createConsensusError.spec.js +3 -3
- package/test/integration/identity/IdentityFacade.spec.js +13 -13
- package/test/integration/identity/stateTransition/IdentityCreateTransition/validation/basic/validateIdentityCreateTransitionBasicFactory.spec.js +12 -12
- package/test/integration/identity/stateTransition/IdentityTopUpTransition/validation/basic/validateIdentityTopUpTransitionBasicFactory.spec.js +11 -11
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/basic/validateIdentityUpdateTransitionBasicFactory.spec.js +8 -8
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js +24 -39
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validatePublicKeysState.spec.js +7 -7
- package/test/integration/identity/stateTransition/assetLockProof/chain/validateChainAssetLockProofStructureFactory.spec.js +29 -35
- package/test/integration/identity/stateTransition/assetLockProof/fetchAssetLockTransactionOutputFactory.spec.js +8 -8
- package/test/integration/identity/stateTransition/assetLockProof/instant/validateInstantAssetLockProofStructureFactory.spec.js +11 -11
- package/test/integration/identity/stateTransition/assetLockProof/validateAssetLockTransactionFactory.spec.js +10 -10
- package/test/integration/identity/stateTransition/validatePublicKeySignaturesFactory.spec.js +7 -7
- package/test/integration/identity/validation/validateIdentityFactory.spec.js +8 -8
- package/test/integration/identity/validation/validatePublicKeysFactory.spec.js +50 -24
- package/test/integration/stateTransition/AbstractStateTransitionIdentitySigned.spec.js +14 -14
- package/test/integration/stateTransition/StateTransitionFacade.spec.js +15 -19
- package/test/integration/stateTransition/calculateStateTransitionFee.spec.js +8 -11
- package/test/integration/util/generateEntropy.spec.js +1 -1
- package/test/integration/util/serializer.spec.js +2 -2
- package/test/unit/DashPlatformProtocol.spec.js +4 -4
- package/test/unit/Identifier.spec.js +2 -2
- package/test/unit/Metadata.spec.js +1 -1
- package/test/unit/dataContract/DataContract.spec.js +100 -159
- package/test/unit/dataContract/DataContractFactory.spec.js +55 -111
- package/test/unit/dataContract/createDataContract.spec.js +20 -10
- package/test/unit/dataContract/errors/InvalidDataContractError.spec.js +2 -2
- package/test/unit/dataContract/generateDataContractId.spec.js +23 -6
- package/test/unit/dataContract/getBinaryPropertiesFromSchema.spec.js +1 -1
- package/test/unit/dataContract/getPropertyDefinitionByPath.spec.js +1 -1
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +20 -67
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/applyDataContractCreateTransitionFactory.spec.js +29 -23
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/validation/state/validateDataContractCreateTransitionStateFactory.spec.js +48 -45
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/DataContractUpdateTransition.spec.js +8 -8
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/applyDataContractUpdateTransitionFactory.spec.js +6 -6
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/validation/basic/validateIndicesAreBackwardCompatible.spec.js +6 -6
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/validation/state/validateDataContractUpdateTransitionStateFactory.spec.js +9 -9
- package/test/unit/dataContract/validation/validateDataContractMaxDepthFactory.spec.js +6 -6
- package/test/unit/dataContract/validation/validateDataContractPatternsFactory.spec.js +3 -3
- package/test/unit/dataTrigger/DataTrigger.spec.js +8 -8
- package/test/unit/dataTrigger/DataTriggerExecutionContext.spec.js +4 -4
- package/test/unit/dataTrigger/dashpayDataTriggers/createContactRequestDataTrigger.spec.js +13 -15
- package/test/unit/dataTrigger/dpnsTriggers/createDomainDataTrigger.spec.js +12 -12
- package/test/unit/dataTrigger/featureFlagDataTriggers/createFeatureFlagDataTrigger.spec.js +11 -13
- package/test/unit/dataTrigger/getDataTriggersFactory.spec.js +7 -7
- package/test/unit/dataTrigger/rejectDataTrigger.spec.js +8 -8
- package/test/unit/dataTrigger/rewardShareDataTriggers/createMasternodeRewardSharesDataTrigger.spec.js +9 -9
- package/test/unit/decodeProtocolEntityFactory.spec.js +4 -4
- package/test/unit/document/Document.spec.js +9 -9
- package/test/unit/document/DocumentFactory.spec.js +19 -19
- package/test/unit/document/errors/InvalidDocumentError.spec.js +2 -2
- package/test/unit/document/fetchAndValidateDataContractFactory.spec.js +8 -8
- package/test/unit/document/stateTransition/DocumetsBatchTransition/DocumentsBatchTransition.spec.js +8 -8
- package/test/unit/document/stateTransition/DocumetsBatchTransition/applyDocumentsBatchTransitionFactory.spec.js +16 -17
- package/test/unit/document/stateTransition/DocumetsBatchTransition/documentTransition/DocumentCreateTransition.spec.js +1 -1
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/basic/findDuplicatesById.spec.js +2 -2
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/basic/findDuplicatesByIndices.spec.js +6 -6
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/basic/validatePartialCompoundIndices.spec.js +7 -7
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/state/fetchDocumentsFactory.spec.js +6 -6
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/state/validateDocumentsBatchTransitionStateFactory.spec.js +27 -34
- package/test/unit/document/stateTransition/DocumetsBatchTransition/validation/state/validateDocumentsUniquenessByIndicesFactory.spec.js +9 -9
- package/test/unit/errors/consensus/codes.spec.js +7 -7
- package/test/unit/identity/Identity.spec.js +98 -69
- package/test/unit/identity/IdentityFactory.spec.js +15 -15
- package/test/unit/identity/IdentityPublicKey.spec.js +53 -66
- package/test/unit/identity/creditsConverter.spec.js +1 -1
- package/test/unit/identity/errors/InvalidIdentityError.spec.js +2 -2
- package/test/unit/identity/stateTransition/IdentityCreateTransition/IdentityCreateTransition.spec.js +7 -7
- package/test/unit/identity/stateTransition/IdentityCreateTransition/applyIdentityCreateTransitionFactory.spec.js +8 -8
- package/test/unit/identity/stateTransition/IdentityCreateTransition/validation/state/validateIdentityCreateTransitionStateFactory.spec.js +6 -6
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/IdentityTopUpTransition.spec.js +4 -4
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/applyIdentityTopUpTransitionFactory.spec.js +7 -7
- package/test/unit/identity/stateTransition/IdentityTopUpTransition/validation/state/validateIdentityTopUpTransitionStateFactory.spec.js +2 -2
- package/test/unit/identity/stateTransition/IdentityUpdateTransition/IdentityUpdateTransition.spec.js +6 -6
- package/test/unit/identity/stateTransition/IdentityUpdateTransition/applyIdentityUpdateTransitionFactory.spec.js +6 -6
- package/test/unit/identity/stateTransition/assetLockProof/createAssetLockProofInstance.spec.js +5 -5
- package/test/unit/identity/stateTransition/assetLockProof/fetchAssetLockPublicKeyHashFactory.spec.js +3 -3
- package/test/unit/identity/validation/validateRequiredPurposeAndSecurityLevelFactory.spec.js +5 -5
- package/test/unit/stateTransition/StateTransitionFactory.spec.js +8 -8
- package/test/unit/stateTransition/createStateTransitionFactory.spec.js +8 -8
- package/test/unit/stateTransition/errors/InvalidStateTransitionError.spec.js +3 -3
- package/test/unit/stateTransition/validation/validateStateTransitionBasicFactory.spec.js +12 -12
- package/test/unit/stateTransition/validation/validateStateTransitionFeeFactory.spec.js +15 -15
- package/test/unit/stateTransition/validation/validateStateTransitionIdentitySignatureFactory.spec.js +22 -22
- package/test/unit/stateTransition/validation/validateStateTransitionKeySignatureFactory.spec.js +6 -6
- package/test/unit/stateTransition/validation/validateStateTransitionStateFactory.spec.js +9 -9
- package/test/unit/version/validateProtocolVersionFactory.spec.js +7 -7
- package/tsconfig.json +18 -0
- package/wasm/wasm_dpp.d.ts +2850 -0
- package/wasm/wasm_dpp.js +7978 -0
- package/wasm/wasm_dpp_bg.js +1 -0
- package/wasm/wasm_dpp_bg.wasm +0 -0
- package/wasm/wasm_dpp_bg.wasm.d.ts +536 -0
- package/webpack.config.js +22 -19
- package/CHANGELOG.md +0 -397
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pub mod document_batch_transition;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=DataContractHaveNewUniqueIndexError)]
|
|
4
|
+
pub struct DataContractHaveNewUniqueIndexErrorWasm {
|
|
5
|
+
document_type: String,
|
|
6
|
+
index_name: String,
|
|
7
|
+
code: u32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl DataContractHaveNewUniqueIndexErrorWasm {
|
|
11
|
+
pub fn new(document_type: String, index_name: String, code: u32) -> Self {
|
|
12
|
+
DataContractHaveNewUniqueIndexErrorWasm {
|
|
13
|
+
document_type,
|
|
14
|
+
index_name,
|
|
15
|
+
code,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[wasm_bindgen(js_class=DataContractHaveNewUniqueIndexError)]
|
|
21
|
+
impl DataContractHaveNewUniqueIndexErrorWasm {
|
|
22
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
23
|
+
pub fn get_document_type(&self) -> String {
|
|
24
|
+
self.document_type.clone()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[wasm_bindgen(js_name=getIndexName)]
|
|
28
|
+
pub fn get_index_name(&self) -> String {
|
|
29
|
+
self.index_name.clone()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
33
|
+
pub fn get_code(&self) -> u32 {
|
|
34
|
+
self.code
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/errors/consensus/basic/data_contract/data_contract_immutable_properties_update_error.rs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=DataContractImmutablePropertiesUpdateError)]
|
|
4
|
+
pub struct DataContractImmutablePropertiesUpdateErrorWasm {
|
|
5
|
+
operation: String,
|
|
6
|
+
field_path: String,
|
|
7
|
+
code: u32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl DataContractImmutablePropertiesUpdateErrorWasm {
|
|
11
|
+
pub fn new(operation: String, field_path: String, code: u32) -> Self {
|
|
12
|
+
DataContractImmutablePropertiesUpdateErrorWasm {
|
|
13
|
+
operation,
|
|
14
|
+
field_path,
|
|
15
|
+
code,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[wasm_bindgen(js_class=DataContractImmutablePropertiesUpdateError)]
|
|
21
|
+
impl DataContractImmutablePropertiesUpdateErrorWasm {
|
|
22
|
+
#[wasm_bindgen(js_name=getOperation)]
|
|
23
|
+
pub fn get_operation(&self) -> String {
|
|
24
|
+
self.operation.clone()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[wasm_bindgen(js_name=getFieldPath)]
|
|
28
|
+
pub fn get_field_path(&self) -> String {
|
|
29
|
+
self.field_path.clone()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
33
|
+
pub fn get_code(&self) -> u32 {
|
|
34
|
+
self.code
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=DataContractInvalidIndexDefinitionUpdateError)]
|
|
4
|
+
pub struct DataContractInvalidIndexDefinitionUpdateErrorWasm {
|
|
5
|
+
document_type: String,
|
|
6
|
+
index_name: String,
|
|
7
|
+
code: u32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl DataContractInvalidIndexDefinitionUpdateErrorWasm {
|
|
11
|
+
pub fn new(document_type: String, index_name: String, code: u32) -> Self {
|
|
12
|
+
DataContractInvalidIndexDefinitionUpdateErrorWasm {
|
|
13
|
+
document_type,
|
|
14
|
+
index_name,
|
|
15
|
+
code,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[wasm_bindgen(js_class=DataContractInvalidIndexDefinitionUpdateError)]
|
|
21
|
+
impl DataContractInvalidIndexDefinitionUpdateErrorWasm {
|
|
22
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
23
|
+
pub fn get_document_type(&self) -> String {
|
|
24
|
+
self.document_type.clone()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[wasm_bindgen(js_name=getIndexName)]
|
|
28
|
+
pub fn get_index_name(&self) -> String {
|
|
29
|
+
self.index_name.clone()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
33
|
+
pub fn get_code(&self) -> u32 {
|
|
34
|
+
self.code
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=DataContractMaxDepthError)]
|
|
4
|
+
pub struct DataContractMaxDepthErrorWasm {
|
|
5
|
+
depth: usize,
|
|
6
|
+
code: u32,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl DataContractMaxDepthErrorWasm {
|
|
10
|
+
pub fn new(depth: usize, code: u32) -> Self {
|
|
11
|
+
DataContractMaxDepthErrorWasm { depth, code }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#[wasm_bindgen(js_class=DataContractMaxDepthError)]
|
|
16
|
+
impl DataContractMaxDepthErrorWasm {
|
|
17
|
+
#[wasm_bindgen(js_name=getDepth)]
|
|
18
|
+
pub fn get_expected_version(&self) -> usize {
|
|
19
|
+
self.depth
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
23
|
+
pub fn get_code(&self) -> u32 {
|
|
24
|
+
self.code
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/errors/consensus/basic/data_contract/data_contract_unique_indices_changed_error.rs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=DataContractUniqueIndicesChangedError)]
|
|
4
|
+
pub struct DataContractUniqueIndicesChangedErrorWasm {
|
|
5
|
+
document_type: String,
|
|
6
|
+
index_name: String,
|
|
7
|
+
code: u32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl DataContractUniqueIndicesChangedErrorWasm {
|
|
11
|
+
pub fn new(document_type: String, index_name: String, code: u32) -> Self {
|
|
12
|
+
DataContractUniqueIndicesChangedErrorWasm {
|
|
13
|
+
document_type,
|
|
14
|
+
index_name,
|
|
15
|
+
code,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[wasm_bindgen(js_class=DataContractUniqueIndicesChangedError)]
|
|
21
|
+
impl DataContractUniqueIndicesChangedErrorWasm {
|
|
22
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
23
|
+
pub fn get_document_type(&self) -> String {
|
|
24
|
+
self.document_type.clone()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[wasm_bindgen(js_name=getIndexName)]
|
|
28
|
+
pub fn get_index_name(&self) -> String {
|
|
29
|
+
self.index_name.clone()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
33
|
+
pub fn get_code(&self) -> u32 {
|
|
34
|
+
self.code
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=DuplicateIndexNameError)]
|
|
4
|
+
pub struct DuplicateIndexNameErrorWasm {
|
|
5
|
+
document_type: String,
|
|
6
|
+
duplicate_index_name: String,
|
|
7
|
+
code: u32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl DuplicateIndexNameErrorWasm {
|
|
11
|
+
pub fn new(document_type: String, duplicate_index_name: String, code: u32) -> Self {
|
|
12
|
+
DuplicateIndexNameErrorWasm {
|
|
13
|
+
document_type,
|
|
14
|
+
duplicate_index_name,
|
|
15
|
+
code,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[wasm_bindgen(js_class=DuplicateIndexNameError)]
|
|
21
|
+
impl DuplicateIndexNameErrorWasm {
|
|
22
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
23
|
+
pub fn get_document_type(&self) -> String {
|
|
24
|
+
self.document_type.clone()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[wasm_bindgen(js_name=getDuplicateIndexName)]
|
|
28
|
+
pub fn get_duplicate_index_name(&self) -> String {
|
|
29
|
+
self.duplicate_index_name.clone()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
33
|
+
pub fn get_code(&self) -> u32 {
|
|
34
|
+
self.code
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
use crate::buffer::Buffer;
|
|
2
|
+
use dpp::prelude::Identifier;
|
|
3
|
+
use wasm_bindgen::prelude::*;
|
|
4
|
+
|
|
5
|
+
#[wasm_bindgen(js_name=IncompatibleDataContractSchemaError)]
|
|
6
|
+
pub struct IncompatibleDataContractSchemaErrorWasm {
|
|
7
|
+
data_contract_id: Identifier,
|
|
8
|
+
operation: String,
|
|
9
|
+
field_path: String,
|
|
10
|
+
old_schema: serde_json::Value,
|
|
11
|
+
new_schema: serde_json::Value,
|
|
12
|
+
code: u32,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl IncompatibleDataContractSchemaErrorWasm {
|
|
16
|
+
pub fn new(
|
|
17
|
+
data_contract_id: Identifier,
|
|
18
|
+
operation: String,
|
|
19
|
+
field_path: String,
|
|
20
|
+
old_schema: serde_json::Value,
|
|
21
|
+
new_schema: serde_json::Value,
|
|
22
|
+
code: u32,
|
|
23
|
+
) -> Self {
|
|
24
|
+
IncompatibleDataContractSchemaErrorWasm {
|
|
25
|
+
data_contract_id,
|
|
26
|
+
operation,
|
|
27
|
+
field_path,
|
|
28
|
+
old_schema,
|
|
29
|
+
new_schema,
|
|
30
|
+
code,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#[wasm_bindgen(js_class=IncompatibleDataContractSchemaError)]
|
|
36
|
+
impl IncompatibleDataContractSchemaErrorWasm {
|
|
37
|
+
#[wasm_bindgen(js_name=getDataContractId)]
|
|
38
|
+
pub fn get_data_contract_id(&self) -> Buffer {
|
|
39
|
+
Buffer::from_bytes(self.data_contract_id.as_bytes())
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#[wasm_bindgen(js_name=getOperation)]
|
|
43
|
+
pub fn get_operation(&self) -> String {
|
|
44
|
+
self.operation.clone()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#[wasm_bindgen(js_name=getFieldPath)]
|
|
48
|
+
pub fn get_field_path(&self) -> String {
|
|
49
|
+
self.field_path.clone()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
#[wasm_bindgen(js_name=getOldSchema)]
|
|
53
|
+
pub fn get_old_schema(&self) -> Result<JsValue, JsError> {
|
|
54
|
+
serde_wasm_bindgen::to_value(&self.old_schema).map_err(JsError::from)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#[wasm_bindgen(js_name=getNewSchema)]
|
|
58
|
+
pub fn get_new_schema(&self) -> Result<JsValue, JsError> {
|
|
59
|
+
serde_wasm_bindgen::to_value(&self.new_schema).map_err(JsError::from)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
63
|
+
pub fn get_code(&self) -> u32 {
|
|
64
|
+
self.code
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=IncompatibleRe2PatternError)]
|
|
4
|
+
pub struct IncompatibleRe2PatternErrorWasm {
|
|
5
|
+
pattern: String,
|
|
6
|
+
path: String,
|
|
7
|
+
message: String,
|
|
8
|
+
code: u32,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
impl IncompatibleRe2PatternErrorWasm {
|
|
12
|
+
pub fn new(pattern: String, path: String, message: String, code: u32) -> Self {
|
|
13
|
+
IncompatibleRe2PatternErrorWasm {
|
|
14
|
+
pattern,
|
|
15
|
+
path,
|
|
16
|
+
message,
|
|
17
|
+
code,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#[wasm_bindgen(js_class=IncompatibleRe2PatternError)]
|
|
23
|
+
impl IncompatibleRe2PatternErrorWasm {
|
|
24
|
+
#[wasm_bindgen(js_name=getPattern)]
|
|
25
|
+
pub fn get_pattern(&self) -> String {
|
|
26
|
+
self.pattern.clone()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#[wasm_bindgen(js_name=getPath)]
|
|
30
|
+
pub fn get_path(&self) -> String {
|
|
31
|
+
self.path.clone()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#[wasm_bindgen(js_name=getMessage)]
|
|
35
|
+
pub fn get_message(&self) -> String {
|
|
36
|
+
self.message.clone()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
40
|
+
pub fn get_code(&self) -> u32 {
|
|
41
|
+
self.code
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
use dpp::util::json_schema::Index;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
use crate::IndexDefinitionWasm;
|
|
5
|
+
|
|
6
|
+
#[wasm_bindgen(js_name=DuplicateIndexError)]
|
|
7
|
+
pub struct DuplicateIndexErrorWasm {
|
|
8
|
+
document_type: String,
|
|
9
|
+
index_definition: Index,
|
|
10
|
+
code: u32,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
impl DuplicateIndexErrorWasm {
|
|
14
|
+
pub fn new(document_type: String, index_definition: Index, code: u32) -> Self {
|
|
15
|
+
DuplicateIndexErrorWasm {
|
|
16
|
+
document_type,
|
|
17
|
+
index_definition,
|
|
18
|
+
code,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#[wasm_bindgen(js_class=DuplicateIndexError)]
|
|
24
|
+
impl DuplicateIndexErrorWasm {
|
|
25
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
26
|
+
pub fn get_document_type(&self) -> String {
|
|
27
|
+
self.document_type.clone()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[wasm_bindgen(js_name=getIndexDefinition)]
|
|
31
|
+
pub fn get_index_definition(&self) -> JsValue {
|
|
32
|
+
IndexDefinitionWasm::from(self.index_definition.clone()).into()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
36
|
+
pub fn get_code(&self) -> u32 {
|
|
37
|
+
self.code
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
use dpp::util::json_schema::Index;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
use crate::IndexDefinitionWasm;
|
|
5
|
+
|
|
6
|
+
#[wasm_bindgen(js_name=InvalidCompoundIndexError)]
|
|
7
|
+
pub struct InvalidCompoundIndexErrorWasm {
|
|
8
|
+
document_type: String,
|
|
9
|
+
index_definition: Index,
|
|
10
|
+
code: u32,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
impl InvalidCompoundIndexErrorWasm {
|
|
14
|
+
pub fn new(document_type: String, index_definition: Index, code: u32) -> Self {
|
|
15
|
+
InvalidCompoundIndexErrorWasm {
|
|
16
|
+
document_type,
|
|
17
|
+
index_definition,
|
|
18
|
+
code,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#[wasm_bindgen(js_class=InvalidCompoundIndexError)]
|
|
24
|
+
impl InvalidCompoundIndexErrorWasm {
|
|
25
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
26
|
+
pub fn get_document_type(&self) -> String {
|
|
27
|
+
self.document_type.clone()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[wasm_bindgen(js_name=getIndexDefinition)]
|
|
31
|
+
pub fn get_index_definition(&self) -> JsValue {
|
|
32
|
+
IndexDefinitionWasm::from(self.index_definition.clone()).into()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
36
|
+
pub fn get_code(&self) -> u32 {
|
|
37
|
+
self.code
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/errors/consensus/basic/data_contract/index_error/invalid_index_property_type_error.rs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
use dpp::util::json_schema::Index;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
use crate::IndexDefinitionWasm;
|
|
5
|
+
|
|
6
|
+
#[wasm_bindgen(js_name=InvalidIndexPropertyTypeError)]
|
|
7
|
+
pub struct InvalidIndexPropertyTypeErrorWasm {
|
|
8
|
+
document_type: String,
|
|
9
|
+
index_definition: Index,
|
|
10
|
+
property_name: String,
|
|
11
|
+
property_type: String,
|
|
12
|
+
code: u32,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl InvalidIndexPropertyTypeErrorWasm {
|
|
16
|
+
pub fn new(
|
|
17
|
+
document_type: String,
|
|
18
|
+
index_definition: Index,
|
|
19
|
+
property_name: String,
|
|
20
|
+
property_type: String,
|
|
21
|
+
code: u32,
|
|
22
|
+
) -> Self {
|
|
23
|
+
InvalidIndexPropertyTypeErrorWasm {
|
|
24
|
+
document_type,
|
|
25
|
+
index_definition,
|
|
26
|
+
property_name,
|
|
27
|
+
property_type,
|
|
28
|
+
code,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#[wasm_bindgen(js_class=InvalidIndexPropertyTypeError)]
|
|
34
|
+
impl InvalidIndexPropertyTypeErrorWasm {
|
|
35
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
36
|
+
pub fn get_document_type(&self) -> String {
|
|
37
|
+
self.document_type.clone()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#[wasm_bindgen(js_name=getIndexDefinition)]
|
|
41
|
+
pub fn get_index_definition(&self) -> JsValue {
|
|
42
|
+
IndexDefinitionWasm::from(self.index_definition.clone()).into()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#[wasm_bindgen(js_name=getPropertyName)]
|
|
46
|
+
pub fn get_property_name(&self) -> String {
|
|
47
|
+
self.property_name.clone()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#[wasm_bindgen(js_name=getPropertyType)]
|
|
51
|
+
pub fn get_property_type(&self) -> String {
|
|
52
|
+
self.property_type.clone()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
56
|
+
pub fn get_code(&self) -> u32 {
|
|
57
|
+
self.code
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
use dpp::util::json_schema::Index;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
use crate::IndexDefinitionWasm;
|
|
5
|
+
|
|
6
|
+
#[wasm_bindgen(js_name=InvalidIndexedPropertyConstraintError)]
|
|
7
|
+
pub struct InvalidIndexedPropertyConstraintErrorWasm {
|
|
8
|
+
document_type: String,
|
|
9
|
+
index_definition: Index,
|
|
10
|
+
property_name: String,
|
|
11
|
+
constraint_name: String,
|
|
12
|
+
reason: String,
|
|
13
|
+
code: u32,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
impl InvalidIndexedPropertyConstraintErrorWasm {
|
|
17
|
+
pub fn new(
|
|
18
|
+
document_type: String,
|
|
19
|
+
index_definition: Index,
|
|
20
|
+
property_name: String,
|
|
21
|
+
constraint_name: String,
|
|
22
|
+
reason: String,
|
|
23
|
+
code: u32,
|
|
24
|
+
) -> Self {
|
|
25
|
+
InvalidIndexedPropertyConstraintErrorWasm {
|
|
26
|
+
document_type,
|
|
27
|
+
index_definition,
|
|
28
|
+
property_name,
|
|
29
|
+
constraint_name,
|
|
30
|
+
reason,
|
|
31
|
+
code,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#[wasm_bindgen(js_class=InvalidIndexedPropertyConstraintError)]
|
|
37
|
+
impl InvalidIndexedPropertyConstraintErrorWasm {
|
|
38
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
39
|
+
pub fn get_document_type(&self) -> String {
|
|
40
|
+
self.document_type.clone()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#[wasm_bindgen(js_name=getIndexDefinition)]
|
|
44
|
+
pub fn get_index_definition(&self) -> JsValue {
|
|
45
|
+
IndexDefinitionWasm::from(self.index_definition.clone()).into()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#[wasm_bindgen(js_name=getPropertyName)]
|
|
49
|
+
pub fn get_property_name(&self) -> String {
|
|
50
|
+
self.property_name.clone()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#[wasm_bindgen(js_name=getConstraintName)]
|
|
54
|
+
pub fn get_constraint_name(&self) -> String {
|
|
55
|
+
self.constraint_name.clone()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#[wasm_bindgen(js_name=getReason)]
|
|
59
|
+
pub fn get_reason(&self) -> String {
|
|
60
|
+
self.reason.clone()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
64
|
+
pub fn get_code(&self) -> u32 {
|
|
65
|
+
self.code
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
mod duplicate_index_error;
|
|
2
|
+
mod invalid_compound_index_error;
|
|
3
|
+
mod invalid_index_property_type_error;
|
|
4
|
+
mod invalid_indexed_property_constraint_error;
|
|
5
|
+
mod system_property_index_already_present_error;
|
|
6
|
+
mod undefined_index_property_error;
|
|
7
|
+
mod unique_indices_limit_reached_error;
|
|
8
|
+
|
|
9
|
+
pub use duplicate_index_error::*;
|
|
10
|
+
pub use invalid_compound_index_error::*;
|
|
11
|
+
pub use invalid_index_property_type_error::*;
|
|
12
|
+
pub use invalid_indexed_property_constraint_error::*;
|
|
13
|
+
pub use system_property_index_already_present_error::*;
|
|
14
|
+
pub use undefined_index_property_error::*;
|
|
15
|
+
pub use unique_indices_limit_reached_error::*;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
use dpp::util::json_schema::Index;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
use crate::IndexDefinitionWasm;
|
|
5
|
+
|
|
6
|
+
#[wasm_bindgen(js_name=SystemPropertyIndexAlreadyPresentError)]
|
|
7
|
+
pub struct SystemPropertyIndexAlreadyPresentErrorWasm {
|
|
8
|
+
document_type: String,
|
|
9
|
+
index_definition: Index,
|
|
10
|
+
property_name: String,
|
|
11
|
+
code: u32,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl SystemPropertyIndexAlreadyPresentErrorWasm {
|
|
15
|
+
pub fn new(
|
|
16
|
+
document_type: String,
|
|
17
|
+
index_definition: Index,
|
|
18
|
+
property_name: String,
|
|
19
|
+
code: u32,
|
|
20
|
+
) -> Self {
|
|
21
|
+
SystemPropertyIndexAlreadyPresentErrorWasm {
|
|
22
|
+
document_type,
|
|
23
|
+
index_definition,
|
|
24
|
+
property_name,
|
|
25
|
+
code,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[wasm_bindgen(js_class=SystemPropertyIndexAlreadyPresentError)]
|
|
31
|
+
impl SystemPropertyIndexAlreadyPresentErrorWasm {
|
|
32
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
33
|
+
pub fn get_document_type(&self) -> String {
|
|
34
|
+
self.document_type.clone()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#[wasm_bindgen(js_name=getIndexDefinition)]
|
|
38
|
+
pub fn get_index_definition(&self) -> JsValue {
|
|
39
|
+
IndexDefinitionWasm::from(self.index_definition.clone()).into()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#[wasm_bindgen(js_name=getPropertyName)]
|
|
43
|
+
pub fn get_property_name(&self) -> String {
|
|
44
|
+
self.property_name.clone()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
48
|
+
pub fn get_code(&self) -> u32 {
|
|
49
|
+
self.code
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/errors/consensus/basic/data_contract/index_error/undefined_index_property_error.rs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
use dpp::util::json_schema::Index;
|
|
2
|
+
use wasm_bindgen::prelude::*;
|
|
3
|
+
|
|
4
|
+
use crate::IndexDefinitionWasm;
|
|
5
|
+
|
|
6
|
+
#[wasm_bindgen(js_name=UndefinedIndexPropertyError)]
|
|
7
|
+
pub struct UndefinedIndexPropertyErrorWasm {
|
|
8
|
+
document_type: String,
|
|
9
|
+
index_definition: Index,
|
|
10
|
+
property_name: String,
|
|
11
|
+
code: u32,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl UndefinedIndexPropertyErrorWasm {
|
|
15
|
+
pub fn new(
|
|
16
|
+
document_type: String,
|
|
17
|
+
index_definition: Index,
|
|
18
|
+
property_name: String,
|
|
19
|
+
code: u32,
|
|
20
|
+
) -> Self {
|
|
21
|
+
UndefinedIndexPropertyErrorWasm {
|
|
22
|
+
document_type,
|
|
23
|
+
index_definition,
|
|
24
|
+
property_name,
|
|
25
|
+
code,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[wasm_bindgen(js_class=UndefinedIndexPropertyError)]
|
|
31
|
+
impl UndefinedIndexPropertyErrorWasm {
|
|
32
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
33
|
+
pub fn get_document_type(&self) -> String {
|
|
34
|
+
self.document_type.clone()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#[wasm_bindgen(js_name=getIndexDefinition)]
|
|
38
|
+
pub fn get_index_definition(&self) -> JsValue {
|
|
39
|
+
IndexDefinitionWasm::from(self.index_definition.clone()).into()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#[wasm_bindgen(js_name=getPropertyName)]
|
|
43
|
+
pub fn get_property_name(&self) -> String {
|
|
44
|
+
self.property_name.clone()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
48
|
+
pub fn get_code(&self) -> u32 {
|
|
49
|
+
self.code
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/errors/consensus/basic/data_contract/index_error/unique_indices_limit_reached_error.rs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use wasm_bindgen::prelude::*;
|
|
2
|
+
|
|
3
|
+
#[wasm_bindgen(js_name=UniqueIndicesLimitReachedError)]
|
|
4
|
+
pub struct UniqueIndicesLimitReachedErrorWasm {
|
|
5
|
+
document_type: String,
|
|
6
|
+
index_limit: usize,
|
|
7
|
+
code: u32,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl UniqueIndicesLimitReachedErrorWasm {
|
|
11
|
+
pub fn new(document_type: String, index_limit: usize, code: u32) -> Self {
|
|
12
|
+
UniqueIndicesLimitReachedErrorWasm {
|
|
13
|
+
document_type,
|
|
14
|
+
index_limit,
|
|
15
|
+
code,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[wasm_bindgen(js_class=UniqueIndicesLimitReachedError)]
|
|
21
|
+
impl UniqueIndicesLimitReachedErrorWasm {
|
|
22
|
+
#[wasm_bindgen(js_name=getDocumentType)]
|
|
23
|
+
pub fn get_document_type(&self) -> String {
|
|
24
|
+
self.document_type.clone()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[wasm_bindgen(js_name=getIndexLimit)]
|
|
28
|
+
pub fn get_index_limit(&self) -> usize {
|
|
29
|
+
self.index_limit
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
33
|
+
pub fn get_code(&self) -> u32 {
|
|
34
|
+
self.code
|
|
35
|
+
}
|
|
36
|
+
}
|