@dashevo/wasm-dpp 3.0.1 → 3.1.0-dev.3
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/Cargo.toml +5 -12
- package/babel.config.json +1 -1
- package/dist/dpp.js +24 -10
- package/dist/errors/patchConsensusErrors.js +1 -2
- package/dist/identifier/Identifier.d.ts +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -11
- package/dist/utils/extend.js +1 -2
- package/dist/wasm/wasm_dpp.d.ts +4859 -4003
- package/dist/wasm/wasm_dpp.js +1670 -1592
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/eslint.config.mjs +30 -0
- package/lib/index.ts +0 -1
- package/lib/wasm/wasm_dpp.d.ts +4859 -4003
- package/package.json +8 -10
- package/scripts/build-wasm.sh +4 -2
- package/src/data_contract/data_contract.rs +1 -1
- package/src/data_contract/state_transition/data_contract_create_transition/mod.rs +1 -0
- package/src/data_contract/state_transition/data_contract_update_transition/mod.rs +1 -0
- package/src/document/extended_document.rs +1 -1
- package/src/document/state_transition/batch_transition/mod.rs +1 -0
- package/src/errors/consensus/basic/identity/identity_asset_lock_transaction_too_many_inputs_error.rs +41 -0
- package/src/errors/consensus/basic/identity/mod.rs +2 -0
- package/src/errors/consensus/consensus_error.rs +44 -3
- package/src/errors/from.rs +1 -1
- package/src/errors/generic_consensus_error.rs +1 -1
- package/src/identity/state_transition/identity_create_transition/transition.rs +1 -0
- package/src/identity/state_transition/identity_credit_transfer_transition/transition.rs +1 -0
- package/src/identity/state_transition/identity_credit_withdrawal_transition/transition.rs +1 -0
- package/src/identity/state_transition/identity_topup_transition/transition.rs +1 -0
- package/src/identity/state_transition/identity_update_transition/transition.rs +1 -0
- package/src/identity/state_transition/transition_types.rs +1 -0
- package/src/state_transition/state_transition_factory.rs +7 -0
- package/src/voting/state_transition/masternode_vote_transition/mod.rs +6 -4
- package/test/integration/dataContract/validation/validateDataContractFactory.spec.js +2 -2
- package/test/integration/document/DocumentFacade.spec.js +1 -1
- package/test/unit/dataContract/DataContract.spec.js +6 -6
- package/test/unit/identity/Identity.spec.js +3 -3
- package/test/unit/identity/IdentityPublicKey.spec.js +2 -2
- package/tsconfig.json +1 -1
- package/.eslintignore +0 -2
- package/.eslintrc +0 -18
- package/lib/test/.eslintrc +0 -9
- package/test/.eslintrc +0 -12
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validateIdentityUpdateTransitionStateFactory.spec.js +0 -253
- package/test/integration/identity/stateTransition/IdentityUpdateTransition/validation/state/validatePublicKeysState.spec.js +0 -100
package/Cargo.toml
CHANGED
|
@@ -18,31 +18,24 @@ serde_json = { version = "1.0", features = ["preserve_order"] }
|
|
|
18
18
|
# Meantime if you want to update wasm-bindgen you also need to update version in:
|
|
19
19
|
# - packages/wasm-dpp/scripts/build-wasm.sh
|
|
20
20
|
# - Dockerfile
|
|
21
|
-
wasm-bindgen = { version = "=0.2.
|
|
21
|
+
wasm-bindgen = { version = "=0.2.108" }
|
|
22
22
|
js-sys = "0.3.64"
|
|
23
23
|
web-sys = { version = "0.3.64", features = ["console"] }
|
|
24
24
|
thiserror = { version = "2.0.17" }
|
|
25
25
|
serde-wasm-bindgen = { git = "https://github.com/QuantumExplorer/serde-wasm-bindgen", branch = "feat/not_human_readable" }
|
|
26
26
|
dpp = { path = "../rs-dpp", default-features = false, features = [
|
|
27
|
-
"
|
|
28
|
-
"state-transition-value-conversion",
|
|
29
|
-
"data-contract-value-conversion",
|
|
30
|
-
"data-contract-json-conversion",
|
|
27
|
+
"json-conversion",
|
|
31
28
|
"state-transitions",
|
|
32
29
|
"cbor",
|
|
33
30
|
"platform-value",
|
|
34
31
|
"json-object",
|
|
35
|
-
"identity-value-conversion",
|
|
36
32
|
"identity-hashing",
|
|
37
33
|
"factories",
|
|
38
34
|
"client",
|
|
39
35
|
"validation",
|
|
40
36
|
"state-transition-signing",
|
|
41
37
|
"state-transition-validation",
|
|
42
|
-
"state-transition-json-conversion",
|
|
43
38
|
"extended-document",
|
|
44
|
-
"document-value-conversion",
|
|
45
|
-
"document-json-conversion",
|
|
46
39
|
"data-contracts",
|
|
47
40
|
] }
|
|
48
41
|
itertools = { version = "0.13" }
|
|
@@ -50,12 +43,12 @@ log = { version = "0.4.6" }
|
|
|
50
43
|
wasm-logger = { version = "0.2.0" }
|
|
51
44
|
num_enum = "0.7"
|
|
52
45
|
hex = { version = "0.4" }
|
|
53
|
-
|
|
46
|
+
pastey = "0.2.1"
|
|
54
47
|
anyhow = { version = "1.0.75" }
|
|
55
48
|
# required, cargo-machete false positive
|
|
56
|
-
wasm-bindgen-futures = "0.4.
|
|
49
|
+
wasm-bindgen-futures = "0.4.58"
|
|
57
50
|
async-trait = "0.1.59"
|
|
58
|
-
bincode = { version = "=2.0.
|
|
51
|
+
bincode = { version = "=2.0.1" }
|
|
59
52
|
|
|
60
53
|
[profile.release]
|
|
61
54
|
lto = true
|
package/babel.config.json
CHANGED
package/dist/dpp.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
15
|
}) : function(o, v) {
|
|
12
16
|
o["default"] = v;
|
|
13
17
|
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
21
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
-
for (var p in m) if (p !== "default" && !
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
37
|
};
|
|
24
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -29,7 +43,7 @@ const dpp_module = __importStar(require("./wasm/wasm_dpp"));
|
|
|
29
43
|
const patchConsensusErrors_1 = require("./errors/patchConsensusErrors");
|
|
30
44
|
const Identifier_1 = __importDefault(require("./identifier/Identifier"));
|
|
31
45
|
const IdentifierError_1 = __importDefault(require("./identifier/errors/IdentifierError"));
|
|
32
|
-
patchConsensusErrors_1.patchConsensusErrors();
|
|
46
|
+
(0, patchConsensusErrors_1.patchConsensusErrors)();
|
|
33
47
|
// While we declared it above, those fields do not hold any values - let's assign them.
|
|
34
48
|
// We need to suppress the compiler here, as he won't be happy about those reassignments.
|
|
35
49
|
// @ts-ignore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchConsensusErrors =
|
|
3
|
+
exports.patchConsensusErrors = patchConsensusErrors;
|
|
4
4
|
function patchConsensusErrors() {
|
|
5
5
|
// TODO(versioning): restore this
|
|
6
6
|
// extend(dpp_module.ProtocolVersionParsingError, AbstractConsensusError);
|
|
@@ -97,4 +97,3 @@ function patchConsensusErrors() {
|
|
|
97
97
|
// extend(dpp_module.DuplicatedIdentityPublicKeyIdStateError, AbstractConsensusError);
|
|
98
98
|
// extend(dpp_module.DuplicatedIdentityPublicKeyStateError, AbstractConsensusError);
|
|
99
99
|
}
|
|
100
|
-
exports.patchConsensusErrors = patchConsensusErrors;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
declare type CborEncoder = {
|
|
1
|
+
type CborEncoder = {
|
|
3
2
|
pushAny: (buffer: Buffer) => void;
|
|
4
3
|
};
|
|
5
|
-
|
|
4
|
+
type IdentifierEncoding = BufferEncoding | 'base58';
|
|
6
5
|
/**
|
|
7
6
|
* @param {Buffer} buffer
|
|
8
7
|
* @returns {Identifier}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
15
|
}) : function(o, v) {
|
|
12
16
|
o["default"] = v;
|
|
13
17
|
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
21
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
-
for (var p in m) if (p !== "default" && !
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
37
|
};
|
|
24
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
25
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -34,6 +48,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35
49
|
};
|
|
36
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.default = loadDpp;
|
|
37
52
|
const wasm_dpp_1 = __importDefault(require("./wasm/wasm_dpp"));
|
|
38
53
|
// Ignore the following line, it's not present in the lib/wasm,
|
|
39
54
|
// but added to the dist/wasm by the build process
|
|
@@ -57,7 +72,6 @@ function loadDpp() {
|
|
|
57
72
|
return dpp_module;
|
|
58
73
|
});
|
|
59
74
|
}
|
|
60
|
-
exports.default = loadDpp;
|
|
61
75
|
;
|
|
62
76
|
const loadDppModule = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
77
|
// @ts-ignore
|
|
@@ -65,7 +79,7 @@ const loadDppModule = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
65
79
|
if (typeof window !== 'undefined') {
|
|
66
80
|
let blob = new Blob([bytes], { type: "application/wasm" });
|
|
67
81
|
let wasmUrl = URL.createObjectURL(blob);
|
|
68
|
-
yield wasm_dpp_1.default(wasmUrl);
|
|
82
|
+
yield (0, wasm_dpp_1.default)(wasmUrl);
|
|
69
83
|
}
|
|
70
84
|
else {
|
|
71
85
|
dpp_module.initSync({ module: bytes });
|
package/dist/utils/extend.js
CHANGED