@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.
@@ -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
- newRawDocument.$type,
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(newRawDocument.$type);
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(async () => {
7
+ beforeEach(() => {
9
8
  error = new Error('Some error');
10
9
 
11
- const [document] = await getDocumentsFixture();
12
- rawDocument = document.toObject();
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
  ],