@dashevo/wasm-dpp 4.0.0 → 4.1.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/Cargo.toml +0 -4
- package/dist/wasm/wasm_dpp.d.ts +964 -966
- package/dist/wasm/wasm_dpp.js +57 -60
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/lib/wasm/wasm_dpp.d.ts +964 -966
- package/package.json +2 -2
- package/src/data_contract/data_contract.rs +11 -14
- package/src/data_contract/state_transition/data_contract_create_transition/mod.rs +40 -13
- package/src/data_contract/state_transition/data_contract_update_transition/mod.rs +40 -13
- package/src/document/extended_document.rs +17 -60
- package/src/document/mod.rs +22 -5
- package/src/identity/state_transition/asset_lock_proof/chain/chain_asset_lock_proof.rs +4 -1
- package/src/identity/state_transition/asset_lock_proof/instant/instant_asset_lock_proof.rs +5 -1
- package/src/utils.rs +51 -1
- package/test/integration/document/Document.spec.js +0 -60
- package/test/unit/dataContract/DataContract.spec.js +22 -2
- package/test/unit/dataContract/stateTransition/DataContractCreateTransition/DataContractCreateTransition.spec.js +1 -1
- package/test/unit/dataContract/stateTransition/DataContractUpdateTransition/DataContractUpdateTransition.spec.js +3 -2
- package/test/unit/document/Document.spec.js +0 -22
- package/test/unit/document/DocumentFactory.spec.js +2 -4
- package/test/unit/document/errors/InvalidDocumentError.spec.js +5 -4
- package/test/unit/identity/Identity.spec.js +0 -2
|
@@ -49,7 +49,6 @@ describe('DocumentFactory', () => {
|
|
|
49
49
|
ownerId = documents[0].getOwnerId();
|
|
50
50
|
|
|
51
51
|
([, , , document] = documents);
|
|
52
|
-
rawDocument = document.toObject();
|
|
53
52
|
|
|
54
53
|
factory = new DocumentFactory(1, { generate: () => crypto.randomBytes(32) });
|
|
55
54
|
});
|
|
@@ -62,7 +61,6 @@ describe('DocumentFactory', () => {
|
|
|
62
61
|
// the mocked DataContract validator always returned true.
|
|
63
62
|
const [niceDocument] = documents;
|
|
64
63
|
|
|
65
|
-
const newRawDocument = niceDocument.toObject();
|
|
66
64
|
const contractId = bs58.decode('FQco85WbwNgb5ix8QQAH6wurMcgEC5ENSCv5ixG9cj12');
|
|
67
65
|
const name = 'Cutie';
|
|
68
66
|
|
|
@@ -74,13 +72,13 @@ describe('DocumentFactory', () => {
|
|
|
74
72
|
const newDocument = factory.create(
|
|
75
73
|
dataContract,
|
|
76
74
|
ownerIdJs,
|
|
77
|
-
|
|
75
|
+
niceDocument.getType(),
|
|
78
76
|
{ name },
|
|
79
77
|
);
|
|
80
78
|
|
|
81
79
|
expect(newDocument).to.be.an.instanceOf(ExtendedDocument);
|
|
82
80
|
|
|
83
|
-
expect(newDocument.getType()).to.equal(
|
|
81
|
+
expect(newDocument.getType()).to.equal(niceDocument.getType());
|
|
84
82
|
|
|
85
83
|
expect(newDocument.get('name')).to.equal(name);
|
|
86
84
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
const { InvalidDocumentError } = require('../../../..');
|
|
2
|
-
const getDocumentsFixture = require('../../../../lib/test/fixtures/getDocumentsFixture');
|
|
3
2
|
|
|
4
3
|
describe('InvalidDocumentError', () => {
|
|
5
4
|
let rawDocument;
|
|
6
5
|
let error;
|
|
7
6
|
|
|
8
|
-
beforeEach(
|
|
7
|
+
beforeEach(() => {
|
|
9
8
|
error = new Error('Some error');
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
// ExtendedDocument no longer exposes toObject(); InvalidDocumentError stores
|
|
11
|
+
// the raw document opaquely (round-tripped as a JsValue), so a representative
|
|
12
|
+
// plain object is sufficient for these wrapper tests.
|
|
13
|
+
rawDocument = { $type: 'niceDocument', name: 'someName' };
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
it('should return errors', () => {
|
|
@@ -72,7 +72,6 @@ describe('Identity', () => {
|
|
|
72
72
|
purpose: KeyPurpose.AUTHENTICATION,
|
|
73
73
|
securityLevel: KeySecurityLevel.HIGH,
|
|
74
74
|
readOnly: false,
|
|
75
|
-
disabledAt: null,
|
|
76
75
|
contractBounds: null,
|
|
77
76
|
};
|
|
78
77
|
|
|
@@ -151,7 +150,6 @@ describe('Identity', () => {
|
|
|
151
150
|
purpose: KeyPurpose.AUTHENTICATION,
|
|
152
151
|
securityLevel: KeySecurityLevel.HIGH,
|
|
153
152
|
readOnly: false,
|
|
154
|
-
disabledAt: null,
|
|
155
153
|
contractBounds: null,
|
|
156
154
|
},
|
|
157
155
|
],
|