@dashevo/wasm-dpp 4.2.0-beta.1 → 4.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wasm/wasm_dpp.d.ts +1057 -998
- package/dist/wasm/wasm_dpp.js +70 -44
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/lib/wasm/wasm_dpp.d.ts +1057 -998
- package/package.json +2 -2
- package/src/errors/consensus/consensus_error.rs +23 -2
- package/src/state_transition/state_transition_factory.rs +3 -0
- package/src/validation/validation_result.rs +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/wasm-dpp",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.2",
|
|
4
4
|
"description": "The JavaScript implementation of the Dash Platform Protocol",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/core": "^7.26.10",
|
|
45
45
|
"@babel/preset-env": "^7.26.9",
|
|
46
46
|
"@dashevo/dashcore-lib": "~0.22.0",
|
|
47
|
-
"@dashevo/dpns-contract": "4.2.0-beta.
|
|
47
|
+
"@dashevo/dpns-contract": "4.2.0-beta.2",
|
|
48
48
|
"@types/bs58": "^4.0.1",
|
|
49
49
|
"@types/node": "^20.10.0",
|
|
50
50
|
"@yarnpkg/pnpify": "^4.0.0-rc.42",
|
|
@@ -98,12 +98,17 @@ use dpp::consensus::state::group::{GroupActionAlreadyCompletedError, GroupAction
|
|
|
98
98
|
use dpp::consensus::state::identity::identity_for_token_configuration_not_found_error::IdentityInTokenConfigurationNotFoundError;
|
|
99
99
|
use dpp::consensus::state::identity::identity_public_key_already_exists_for_unique_contract_bounds_error::IdentityPublicKeyAlreadyExistsForUniqueContractBoundsError;
|
|
100
100
|
use dpp::consensus::basic::identity::{
|
|
101
|
-
IdentityPublicKeyLimitsNotAllowedError,
|
|
101
|
+
IdentityKeyLimitsUpdateEmptyError, IdentityPublicKeyLimitsNotAllowedError,
|
|
102
102
|
IdentityPublicKeyLimitsNotAllowedInShieldedIdentityCreationError,
|
|
103
103
|
InvalidIdentityPublicKeyBudgetError,
|
|
104
104
|
};
|
|
105
|
-
use dpp::consensus::signature::{
|
|
105
|
+
use dpp::consensus::signature::{
|
|
106
|
+
PublicKeyBudgetExhaustedError, PublicKeyExpiredError,
|
|
107
|
+
PublicKeyWithLimitsCannotUpdateKeyLimitsError,
|
|
108
|
+
};
|
|
106
109
|
use dpp::consensus::state::identity::identity_public_key_already_expired_error::IdentityPublicKeyAlreadyExpiredError;
|
|
110
|
+
use dpp::consensus::state::identity::identity_public_key_limit_not_raised_error::IdentityPublicKeyLimitNotRaisedError;
|
|
111
|
+
use dpp::consensus::state::identity::identity_public_key_limit_not_set_error::IdentityPublicKeyLimitNotSetError;
|
|
107
112
|
use dpp::consensus::state::identity::identity_public_key_budget_exceeded_error::IdentityPublicKeyBudgetExceededError;
|
|
108
113
|
use dpp::consensus::state::identity::identity_to_freeze_does_not_exist_error::IdentityToFreezeDoesNotExistError;
|
|
109
114
|
use dpp::consensus::state::identity::master_public_key_update_error::MasterPublicKeyUpdateError;
|
|
@@ -119,6 +124,7 @@ use dpp::consensus::state::document::referenced_identity_key_disabled_error::Ref
|
|
|
119
124
|
use dpp::consensus::state::document::referenced_identity_key_not_found_error::ReferencedIdentityKeyNotFoundError;
|
|
120
125
|
use dpp::consensus::state::document::referenced_document_property_agreement_invalid_error::ReferencedDocumentPropertyAgreementInvalidError;
|
|
121
126
|
use dpp::consensus::state::document::referenced_document_property_mismatch_error::ReferencedDocumentPropertyMismatchError;
|
|
127
|
+
use dpp::consensus::state::document::document_immutable_property_changed_error::DocumentImmutablePropertyChangedError;
|
|
122
128
|
use dpp::consensus::state::document::referenced_key_id_property_invalid_error::ReferencedKeyIdPropertyInvalidError;
|
|
123
129
|
use dpp::consensus::state::document::referenced_document_type_not_found_error::ReferencedDocumentTypeNotFoundError;
|
|
124
130
|
use dpp::consensus::state::shielded::insufficient_pool_notes_error::InsufficientPoolNotesError;
|
|
@@ -543,6 +549,15 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
|
|
|
543
549
|
StateError::IdentityPublicKeyAlreadyExpiredError(e) => {
|
|
544
550
|
generic_consensus_error!(IdentityPublicKeyAlreadyExpiredError, e).into()
|
|
545
551
|
}
|
|
552
|
+
StateError::IdentityPublicKeyLimitNotSetError(e) => {
|
|
553
|
+
generic_consensus_error!(IdentityPublicKeyLimitNotSetError, e).into()
|
|
554
|
+
}
|
|
555
|
+
StateError::IdentityPublicKeyLimitNotRaisedError(e) => {
|
|
556
|
+
generic_consensus_error!(IdentityPublicKeyLimitNotRaisedError, e).into()
|
|
557
|
+
}
|
|
558
|
+
StateError::DocumentImmutablePropertyChangedError(e) => {
|
|
559
|
+
generic_consensus_error!(DocumentImmutablePropertyChangedError, e).into()
|
|
560
|
+
}
|
|
546
561
|
}
|
|
547
562
|
}
|
|
548
563
|
|
|
@@ -1096,6 +1111,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
1096
1111
|
)
|
|
1097
1112
|
.into()
|
|
1098
1113
|
}
|
|
1114
|
+
BasicError::IdentityKeyLimitsUpdateEmptyError(e) => {
|
|
1115
|
+
generic_consensus_error!(IdentityKeyLimitsUpdateEmptyError, e).into()
|
|
1116
|
+
}
|
|
1099
1117
|
}
|
|
1100
1118
|
}
|
|
1101
1119
|
|
|
@@ -1144,6 +1162,9 @@ fn from_signature_error(signature_error: &SignatureError) -> JsValue {
|
|
|
1144
1162
|
SignatureError::PublicKeyExpiredError(e) => {
|
|
1145
1163
|
generic_consensus_error!(PublicKeyExpiredError, e).into()
|
|
1146
1164
|
}
|
|
1165
|
+
SignatureError::PublicKeyWithLimitsCannotUpdateKeyLimitsError(e) => {
|
|
1166
|
+
generic_consensus_error!(PublicKeyWithLimitsCannotUpdateKeyLimitsError, e).into()
|
|
1167
|
+
}
|
|
1147
1168
|
}
|
|
1148
1169
|
}
|
|
1149
1170
|
|
|
@@ -89,6 +89,9 @@ impl StateTransitionFactoryWasm {
|
|
|
89
89
|
| StateTransition::IdentityTopUpFromShieldedPool(_) => Err(JsValue::from_str(
|
|
90
90
|
"shielded transitions are not yet supported in wasm-dpp StateTransitionFactory",
|
|
91
91
|
)),
|
|
92
|
+
StateTransition::IdentityKeyLimitsUpdate(_) => Err(JsValue::from_str(
|
|
93
|
+
"identity key limits update transitions are not supported in wasm-dpp StateTransitionFactory; use wasm-dpp2",
|
|
94
|
+
)),
|
|
92
95
|
},
|
|
93
96
|
Err(dpp::ProtocolError::StateTransitionError(e)) => match e {
|
|
94
97
|
StateTransitionError::InvalidStateTransitionError {
|
|
@@ -4,7 +4,6 @@ use crate::{
|
|
|
4
4
|
};
|
|
5
5
|
|
|
6
6
|
use dpp::{consensus::ConsensusError, validation::ConsensusValidationResult};
|
|
7
|
-
use js_sys::JsString;
|
|
8
7
|
use wasm_bindgen::prelude::*;
|
|
9
8
|
|
|
10
9
|
#[wasm_bindgen(js_name=ValidationResult)]
|
|
@@ -35,13 +34,6 @@ impl ValidationResultWasm {
|
|
|
35
34
|
Ok(Self(ConsensusValidationResult::new_with_errors(vec![])))
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
/// This is just a test method - doesn't need to be in the resulted binding. Please
|
|
39
|
-
/// remove before shipping
|
|
40
|
-
#[wasm_bindgen(js_name=errorsText)]
|
|
41
|
-
pub fn errors_text(&self) -> Vec<JsString> {
|
|
42
|
-
self.0.errors.iter().map(|e| e.to_string().into()).collect()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
37
|
#[wasm_bindgen(js_name=isValid)]
|
|
46
38
|
pub fn is_valid(&self) -> bool {
|
|
47
39
|
self.0.is_valid()
|