Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
58872cb
added revision to documents when needed
QuantumExplorer Feb 15, 2023
8bf90ef
more work on serialization
QuantumExplorer Feb 16, 2023
3f5ffdc
all tests passing
QuantumExplorer Feb 16, 2023
23df7e1
Merge branch 'v0.24-dev' into refactor/removeDocumentStub
QuantumExplorer Feb 20, 2023
7fb9a26
more work
QuantumExplorer Feb 21, 2023
283350b
merge and fixes
QuantumExplorer Feb 25, 2023
2755443
compiles
QuantumExplorer Feb 25, 2023
358eeb2
many more fixes
QuantumExplorer Feb 25, 2023
871329b
everything passing
QuantumExplorer Feb 25, 2023
84ef989
fix
QuantumExplorer Feb 25, 2023
dffbfd4
fixes
QuantumExplorer Feb 25, 2023
0c0acc1
Merge branch 'v0.24-dev' into refactor/removeDocumentStub
QuantumExplorer Feb 25, 2023
a74d0dc
fixes
QuantumExplorer Feb 25, 2023
faeb3db
fixes
QuantumExplorer Feb 25, 2023
5a0ceb7
fixes
QuantumExplorer Feb 25, 2023
4e4831e
small refactoring
QuantumExplorer Feb 26, 2023
2d6ff0a
test(wasm-dpp): use DocumentInStateTransition instead of Document
markin-io Feb 27, 2023
31a8440
small fixes
QuantumExplorer Feb 28, 2023
0e3a010
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Feb 28, 2023
ffa19a1
renamed to extended document
QuantumExplorer Feb 28, 2023
abf4e80
more refactoring
QuantumExplorer Feb 28, 2023
927a660
added path searching
QuantumExplorer Feb 28, 2023
8138ca2
insertion methods
QuantumExplorer Feb 28, 2023
7e68b24
more work
QuantumExplorer Feb 28, 2023
c255b7e
more work
QuantumExplorer Mar 1, 2023
83535d0
more work
QuantumExplorer Mar 1, 2023
65ba3be
added identifier to platform value
QuantumExplorer Mar 1, 2023
f6390a4
more work
QuantumExplorer Mar 1, 2023
51732d2
more work
QuantumExplorer Mar 2, 2023
2f60d15
more work
QuantumExplorer Mar 2, 2023
08c5e36
more fixes
QuantumExplorer Mar 2, 2023
f662caf
fixed issue
QuantumExplorer Mar 2, 2023
1f32e76
fixed another issue
fominok Mar 2, 2023
385e22f
tests passing
QuantumExplorer Mar 3, 2023
a2363bf
Merge branch 'v0.24-dev' into refactor/removeDocumentStub
QuantumExplorer Mar 3, 2023
7324cb0
fixes
QuantumExplorer Mar 3, 2023
1c5d05b
more fixes
QuantumExplorer Mar 3, 2023
5a0ac64
last fixes
QuantumExplorer Mar 3, 2023
417c80f
clippy fixes
QuantumExplorer Mar 3, 2023
a99b188
added another convenience method
QuantumExplorer Mar 3, 2023
47ed827
attempt to fix appy_document_batch_transition
antouhou Mar 3, 2023
09b8e0d
Merge remote-tracking branch 'origin/refactor/removeDocumentStub' int…
antouhou Mar 3, 2023
e5c225a
fix bytes replacement
antouhou Mar 3, 2023
497b47a
fix fetch extended document test
antouhou Mar 4, 2023
6d26833
fmt
QuantumExplorer Mar 5, 2023
f3cbc31
much more work
QuantumExplorer Mar 5, 2023
43fe274
more work
QuantumExplorer Mar 5, 2023
f954d6a
more work
QuantumExplorer Mar 5, 2023
8b30f85
compiles again
QuantumExplorer Mar 5, 2023
9ac0ff8
more fixes
QuantumExplorer Mar 5, 2023
169d0ea
more fixes
QuantumExplorer Mar 5, 2023
92a52a2
more fixes
QuantumExplorer Mar 5, 2023
1fa33ee
more fixes
QuantumExplorer Mar 5, 2023
2b58cd4
more work
QuantumExplorer Mar 5, 2023
d90d949
fmt
QuantumExplorer Mar 5, 2023
9470006
fixes
QuantumExplorer Mar 5, 2023
51dff8a
wasm fixes
QuantumExplorer Mar 5, 2023
779e264
fixes
QuantumExplorer Mar 6, 2023
c92318f
fixes
QuantumExplorer Mar 6, 2023
7fd2ea9
fixes
QuantumExplorer Mar 6, 2023
6d382c2
fmt
QuantumExplorer Mar 6, 2023
f2d3d32
fix wasm build error
antouhou Mar 6, 2023
f3b9cbd
fix create_document
antouhou Mar 6, 2023
f5b1f8c
fixes
QuantumExplorer Mar 6, 2023
cb9bf5b
fix Document test
antouhou Mar 6, 2023
d228b98
another small fix
QuantumExplorer Mar 6, 2023
bcd7e09
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Mar 6, 2023
9a84d32
more fixes
QuantumExplorer Mar 6, 2023
e529670
more fixes
QuantumExplorer Mar 6, 2023
f2ec484
remove some debugs
QuantumExplorer Mar 6, 2023
2035b24
fix Document test
antouhou Mar 6, 2023
e05713d
Merge remote-tracking branch 'origin/refactor/removeDocumentStub' int…
antouhou Mar 6, 2023
b206bb3
fix linting issue
antouhou Mar 6, 2023
b941aa6
fix some document uniqueness validation tests
antouhou Mar 6, 2023
e16e77a
removed contract and document type from document getter
QuantumExplorer Mar 6, 2023
1ea8872
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Mar 6, 2023
ed6015c
fix the other test
antouhou Mar 6, 2023
bd24f1e
more fixes
QuantumExplorer Mar 6, 2023
4dce677
fix
QuantumExplorer Mar 6, 2023
9ff42e7
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Mar 6, 2023
ffbdc1c
trial
QuantumExplorer Mar 6, 2023
bbeb34c
more fixes
QuantumExplorer Mar 6, 2023
a176469
more work
QuantumExplorer Mar 6, 2023
7892054
fmt
QuantumExplorer Mar 6, 2023
1464e93
more fixes
QuantumExplorer Mar 6, 2023
3617039
added another test
QuantumExplorer Mar 6, 2023
e49ee14
more fixes
QuantumExplorer Mar 6, 2023
e4f5b26
more fixes
QuantumExplorer Mar 6, 2023
182e1bf
more fixes
QuantumExplorer Mar 6, 2023
df66bc0
fixed some warnings
QuantumExplorer Mar 7, 2023
42b4ecc
more work
QuantumExplorer Mar 7, 2023
c2f77cf
renamed classes
QuantumExplorer Mar 7, 2023
8251007
more fixes
QuantumExplorer Mar 7, 2023
ad4edb0
fixes
QuantumExplorer Mar 7, 2023
adedff8
more fixes
QuantumExplorer Mar 7, 2023
1415c55
more fixes
QuantumExplorer Mar 7, 2023
40b352c
another fix
QuantumExplorer Mar 7, 2023
d3d6116
fixes for serialization
QuantumExplorer Mar 7, 2023
206b09e
another fix
QuantumExplorer Mar 7, 2023
236db0d
fix errors produced by not being able to mock the validator any more
antouhou Mar 7, 2023
a99d282
Merge remote-tracking branch 'origin/refactor/removeDocumentStub' int…
antouhou Mar 7, 2023
54250c7
merged
QuantumExplorer Mar 7, 2023
e929476
small typo fix
QuantumExplorer Mar 8, 2023
f2c5b56
another fix
QuantumExplorer Mar 8, 2023
bf199b7
fix DocumentBatchTransition.spec.js
antouhou Mar 8, 2023
2394f79
Merge remote-tracking branch 'origin/refactor/removeDocumentStub' int…
antouhou Mar 8, 2023
5e65fda
Merge branch 'v0.24-dev' into refactor/removeDocumentStub
antouhou Mar 8, 2023
4da3ec4
resolve merge conflicts
antouhou Mar 8, 2023
ac1c8da
resolve compilation errors
antouhou Mar 8, 2023
0805694
fix wrong constructor for the data triggers
antouhou Mar 8, 2023
5aa8f7b
fix another test error
antouhou Mar 8, 2023
91fe05b
in porgress
antouhou Mar 8, 2023
11968c6
sledgehammer
QuantumExplorer Mar 9, 2023
0418d31
more work
QuantumExplorer Mar 10, 2023
b14c4a8
more work
QuantumExplorer Mar 11, 2023
ec57013
more break makes sam happy
QuantumExplorer Mar 11, 2023
6e5b6b6
moooor
QuantumExplorer Mar 11, 2023
ce8f437
more work
QuantumExplorer Mar 11, 2023
0858b75
more work
QuantumExplorer Mar 12, 2023
67f52a3
some cleanup
QuantumExplorer Mar 12, 2023
46801a8
more work on deserialization
QuantumExplorer Mar 12, 2023
1b3b42d
even more work on deserialization
fominok Mar 13, 2023
14111ee
more work
QuantumExplorer Mar 13, 2023
7c509e0
more work
QuantumExplorer Mar 13, 2023
d32b6b6
more work
QuantumExplorer Mar 13, 2023
55be6e0
more work
QuantumExplorer Mar 14, 2023
f95be93
more work
QuantumExplorer Mar 15, 2023
fde5bc4
less errors
QuantumExplorer Mar 15, 2023
90ad260
more work
QuantumExplorer Mar 15, 2023
5fd484d
more fixes
QuantumExplorer Mar 15, 2023
ac432b1
work on platform value
QuantumExplorer Mar 15, 2023
e45a723
fixes
QuantumExplorer Mar 15, 2023
b892dc1
more work
QuantumExplorer Mar 15, 2023
b1a4d2e
more work
QuantumExplorer Mar 15, 2023
7b6b9f8
more work
QuantumExplorer Mar 15, 2023
040170a
more fixes
QuantumExplorer Mar 16, 2023
8a9736b
compiling
QuantumExplorer Mar 16, 2023
c4439de
added arrays to set value at path
QuantumExplorer Mar 16, 2023
3a553c4
more fixes
QuantumExplorer Mar 16, 2023
f35c9c1
fixes
QuantumExplorer Mar 16, 2023
87c2522
more fixes
QuantumExplorer Mar 16, 2023
eeedb84
more fixes
QuantumExplorer Mar 16, 2023
be510bb
dbg
QuantumExplorer Mar 16, 2023
62823e9
more fixes
QuantumExplorer Mar 16, 2023
c624e26
more fixes
QuantumExplorer Mar 17, 2023
82f4dad
more fixes
QuantumExplorer Mar 17, 2023
2fa3dd4
more work
QuantumExplorer Mar 17, 2023
b32c022
more fixes
QuantumExplorer Mar 17, 2023
a87a8c6
more fixes
QuantumExplorer Mar 17, 2023
822ab23
more work
QuantumExplorer Mar 17, 2023
a4f318b
more fixes
QuantumExplorer Mar 17, 2023
afdd8cd
more fixes
QuantumExplorer Mar 17, 2023
b581135
more fixes
QuantumExplorer Mar 17, 2023
cc9cb58
more work
QuantumExplorer Mar 17, 2023
ef16f86
more fixes
QuantumExplorer Mar 17, 2023
d19a63a
more fixes
QuantumExplorer Mar 17, 2023
0b12011
dpp tests all passing
QuantumExplorer Mar 18, 2023
b8173e3
fmt
QuantumExplorer Mar 18, 2023
892a9d8
fixes
QuantumExplorer Mar 18, 2023
1638c04
fixes
QuantumExplorer Mar 18, 2023
8a3981c
fixes
QuantumExplorer Mar 18, 2023
f6624ae
more fixes
QuantumExplorer Mar 18, 2023
8b711f3
more fixes
QuantumExplorer Mar 18, 2023
5da08d5
more work
QuantumExplorer Mar 18, 2023
234fdca
fixed rs-drive
QuantumExplorer Mar 18, 2023
1544a83
fixed compilation issues
QuantumExplorer Mar 18, 2023
25113b0
more fixes
QuantumExplorer Mar 18, 2023
e0a3e9d
more fixes
QuantumExplorer Mar 18, 2023
bff7b09
fixes
QuantumExplorer Mar 18, 2023
5efa74f
small change
QuantumExplorer Mar 18, 2023
124197a
merge
QuantumExplorer Mar 18, 2023
361bfc1
fixes
QuantumExplorer Mar 18, 2023
112ca72
fixes
QuantumExplorer Mar 18, 2023
bae60a6
more clippy fixes
QuantumExplorer Mar 18, 2023
f325875
fix
QuantumExplorer Mar 18, 2023
2548506
more clippy fixes
QuantumExplorer Mar 18, 2023
cd5d373
refactoring of replacement methods
QuantumExplorer Mar 19, 2023
7d23113
work on having better replacement methods that support arrays
QuantumExplorer Mar 19, 2023
9618db6
more fixes
QuantumExplorer Mar 19, 2023
1605125
more fixes
QuantumExplorer Mar 19, 2023
f605bc3
more clean up
QuantumExplorer Mar 19, 2023
21b925e
more fixes
QuantumExplorer Mar 19, 2023
3d629d2
more work
QuantumExplorer Mar 19, 2023
3419cbe
more fixes
QuantumExplorer Mar 19, 2023
4427640
more fixes
QuantumExplorer Mar 19, 2023
a96fd1d
more fixes
QuantumExplorer Mar 19, 2023
fa964db
trials
QuantumExplorer Mar 19, 2023
a44de5c
another fix
QuantumExplorer Mar 20, 2023
c1a0e39
more fixes
QuantumExplorer Mar 20, 2023
632ed2a
more fixes
QuantumExplorer Mar 20, 2023
1b9c7fe
more fixes
QuantumExplorer Mar 20, 2023
19d1eb5
more fixes
QuantumExplorer Mar 20, 2023
f1146de
more fixes
QuantumExplorer Mar 20, 2023
b6e633c
more fixes
QuantumExplorer Mar 20, 2023
223873d
more fixes
QuantumExplorer Mar 20, 2023
8caa5fb
merged in v24
QuantumExplorer Mar 20, 2023
e28d365
more fixes
QuantumExplorer Mar 20, 2023
bbb2fac
more fixes
QuantumExplorer Mar 20, 2023
754e793
more fixes
QuantumExplorer Mar 21, 2023
737865a
slight change
QuantumExplorer Mar 21, 2023
2c7afdb
Merge branch 'v0.24-dev' into refactor/removeDocumentStub
antouhou Mar 21, 2023
bc55f10
fix $type should be present for document factory
antouhou Mar 21, 2023
2356e8d
fixed duplicate validation error with $ownerId
QuantumExplorer Mar 21, 2023
d09023e
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Mar 21, 2023
945bf15
fixes
QuantumExplorer Mar 21, 2023
3949de7
test(wasm-dpp): fix state transition facade validation tests
markin-io Mar 21, 2023
29b8042
clean recursive
QuantumExplorer Mar 21, 2023
452cbc3
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
markin-io Mar 21, 2023
850227e
fix(rs-dpp): use to_cleaned_object in to_buffer
markin-io Mar 21, 2023
38181b4
remove values matching path
QuantumExplorer Mar 21, 2023
3f796a6
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
markin-io Mar 21, 2023
d8a87a4
fix
QuantumExplorer Mar 21, 2023
4de3d23
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
markin-io Mar 21, 2023
48e1fe6
fix(rs-dpp): remove public keys signatures
markin-io Mar 21, 2023
9bab7d4
fixes
QuantumExplorer Mar 21, 2023
963fac8
another fix
QuantumExplorer Mar 21, 2023
54b5e64
fix
QuantumExplorer Mar 21, 2023
f0ac157
another fix
QuantumExplorer Mar 21, 2023
fdc68f7
another fix
QuantumExplorer Mar 21, 2023
e9e237b
more logging
QuantumExplorer Mar 21, 2023
8d6fa9e
added test
QuantumExplorer Mar 21, 2023
0b32504
fix
QuantumExplorer Mar 21, 2023
8170f31
fix
QuantumExplorer Mar 21, 2023
61a8c2d
refactor(rs-dpp): use get_optional_array_slice
markin-io Mar 21, 2023
cc09396
test(wasm-dpp): fix Buffer byte size in validateDocumentsBatchTransit…
markin-io Mar 21, 2023
1a31cec
test(wasm-dpp): fix Buffer byte size in validateDocumentsBatchTransit…
markin-io Mar 21, 2023
dd4dacf
another fix
QuantumExplorer Mar 21, 2023
646749a
remove optional value path
QuantumExplorer Mar 21, 2023
4aaa396
fix
QuantumExplorer Mar 21, 2023
7a41890
fix(wasm-dpp): use to_cleaned_object in IdentityFacade validate
markin-io Mar 21, 2023
ed84a64
refactor(wasm-dpp): dpp rework path removal functions in to_object
markin-io Mar 21, 2023
8e84332
refactor(wasm-dpp): eslint
markin-io Mar 21, 2023
97c6542
renamed method
QuantumExplorer Mar 21, 2023
5205383
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Mar 21, 2023
bfae9c8
fixes
QuantumExplorer Mar 21, 2023
df23c37
test(wasm-dpp): add getIdentityUpdateTransitionFixture.js
markin-io Mar 21, 2023
390eb2e
more fixes
QuantumExplorer Mar 21, 2023
29b94be
Merge branch 'refactor/removeDocumentStub' of github.com:dashpay/plat…
QuantumExplorer Mar 21, 2023
157e128
formatting
QuantumExplorer Mar 21, 2023
7c13ffa
more refactoring
QuantumExplorer Mar 21, 2023
afd2bd1
more fixes
QuantumExplorer Mar 21, 2023
0c51c90
tests: update document query to allow limit null
shumkov Mar 22, 2023
21869d5
tests: add query document by createAt test
shumkov Mar 22, 2023
deb36fe
fixed test with timestamp
QuantumExplorer Mar 22, 2023
fc86d4c
fmt
QuantumExplorer Mar 22, 2023
7e81918
fix
QuantumExplorer Mar 22, 2023
ccfd543
fix
QuantumExplorer Mar 22, 2023
77b816b
small changes exposing verify
QuantumExplorer Mar 22, 2023
83b5c04
fixes for verify
QuantumExplorer Mar 22, 2023
73d2240
tests: fix document repository timestamp tests
shumkov Mar 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 25 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js-dpp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
### Bug Fixes

* do not allow to change `ownerId` and `entropy` ([bff5807](https://github.com/dashevo/js-dpp/commit/bff580701322e2100e484989c476d583d26af38a))
* json schema for `signaturePublicKeyId` ([#161](https://github.com/dashevo/js-dpp/issues/161))
* json schema for `signature_public_key_id` ([#161](https://github.com/dashevo/js-dpp/issues/161))
* wrong entropy size ([#157](https://github.com/dashevo/js-dpp/issues/157))
* data contract definitions might be `null` or `undefined` ([#153](https://github.com/dashevo/js-dpp/issues/153))
* identity existence validation in data contract structure validation ([#149](https://github.com/dashevo/js-dpp/issues/149))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = function getIdentityUpdateTransitionFixture() {
const rawStateTransition = {
protocolVersion: protocolVersion.latestVersion,
type: stateTransitionTypes.IDENTITY_UPDATE,
assetLockProof: getInstantAssetLockProofFixture().toObject(),
assetLockProof: getInstantAssetLockProofFixture()
.toObject(),
identityId: generateRandomIdentifier(),
revision: 0,
addPublicKeys: [
Expand Down
2 changes: 2 additions & 0 deletions packages/js-dpp/lib/test/mocks/createStateRepositoryMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* createDataContract: *,
* updateDataContract: *,
* fetchDocuments: *,
* fetchExtendedDocuments: *,
* createDocument: *,
* updateDocument: *,
* removeDocument: *,
Expand Down Expand Up @@ -37,6 +38,7 @@ module.exports = function createStateRepositoryMock(sinonSandbox) {
createDataContract: sinonSandbox.stub(),
updateDataContract: sinonSandbox.stub(),
fetchDocuments: sinonSandbox.stub(),
fetchExtendedDocuments: sinonSandbox.stub(),
createDocument: sinonSandbox.stub(),
updateDocument: sinonSandbox.stub(),
removeDocument: sinonSandbox.stub(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,6 @@ const nonNumberTestCases = [
typesTestCases.buffer,
];

const nonNumberAndUndefinedTestCases = [
typesTestCases.string,
typesTestCases.boolean,
typesTestCases.null,
typesTestCases.object,
typesTestCases.buffer,
];

const nonNumberNullAndUndefinedTestCases = [
typesTestCases.string,
typesTestCases.boolean,
Expand Down Expand Up @@ -1511,7 +1503,7 @@ describe('DocumentRepository', function main() {
expect.fail('should throw an error');
} catch (e) {
expect(e).to.be.instanceOf(InvalidQueryError);
expect(e.message).to.equal('value error: structure Error: value is not a float');
expect(e.message).to.equal('value error: structure error: value is not a float');
}
});
});
Expand Down Expand Up @@ -1851,7 +1843,9 @@ describe('DocumentRepository', function main() {

expect.fail('should throw an error');
} catch (e) {
expect(e.message).to.equal('value error: structure Error: value is not a float');
expect(e.message).to.startsWith(
'value error: structure error: value is not an integer',
);
expect(e).to.be.instanceOf(InvalidQueryError);
}
});
Expand All @@ -1865,8 +1859,8 @@ describe('DocumentRepository', function main() {
expect.fail('should throw an error');
} catch (e) {
expect(e).to.be.instanceOf(InvalidQueryError);
expect(e.message).to.equal(
'value error: structure Error: value is not a float',
expect(e.message).to.startsWith(
'value error: structure error: value is not an integer',
);
}
});
Expand Down Expand Up @@ -1984,7 +1978,7 @@ describe('DocumentRepository', function main() {
expect.fail('should throw an error');
} catch (e) {
expect(e).to.be.instanceOf(InvalidQueryError);
expect(e.message).to.equal('value error: structure Error: value is not a float');
expect(e.message).to.equal('value error: structure error: value is not a float');
}
});
});
Expand Down Expand Up @@ -2607,11 +2601,11 @@ describe('DocumentRepository', function main() {
expect.fail('should throw an error');
} catch (e) {
expect(e).to.be.instanceOf(InvalidQueryError);
expect(e.message).to.equal('value error: structure Error: value is not an integer');
expect(e.message).to.equal('value error: structure error: value is not an integer');
}
});

nonNumberAndUndefinedTestCases.forEach(({ type, value }) => {
nonNumberNullAndUndefinedTestCases.forEach(({ type, value }) => {
it(`should return invalid result if "limit" is not a number, but ${type}`, async () => {
try {
await documentRepository.find(queryDataContract, 'documentNumber', {
Expand All @@ -2625,7 +2619,7 @@ describe('DocumentRepository', function main() {
expect.fail('should throw an error');
} catch (e) {
expect(e).to.be.instanceOf(InvalidQueryError);
expect(e.message).to.equal('value error: structure Error: value is not an integer');
expect(e.message).to.equal('value error: structure error: value is not an integer');
}
});
});
Expand Down Expand Up @@ -2799,7 +2793,7 @@ describe('DocumentRepository', function main() {
expect.fail('should throw an error');
} catch (e) {
expect(e).to.be.instanceOf(InvalidQueryError);
expect(e.message).to.equal('value error: structure Error: value are not bytes, a string, or an array of values representing bytes');
expect(e.message).to.equal('value error: structure error: value are not bytes, a string, or an array of values representing bytes');
}
});
});
Expand Down
26 changes: 4 additions & 22 deletions packages/rs-dpp/schema/document/documentBase.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,24 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"$protocolVersion": {
"type": "integer",
"$comment": "Maximum is the latest protocol version"
},
"$id": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"$type": {
"type": "string"
},
"$revision": {
"type": "integer",
"minimum": 1
},
"$dataContractId": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"$ownerId": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"$revision": {
"type": "integer",
"minimum": 1
},
"$createdAt": {
"type": "integer",
"minimum": 0
Expand All @@ -44,11 +30,7 @@
}
},
"required": [
"$protocolVersion",
"$id",
"$type",
"$revision",
"$dataContractId",
"$ownerId"
],
"additionalProperties": false
Expand Down
55 changes: 55 additions & 0 deletions packages/rs-dpp/schema/document/documentExtended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"$protocolVersion": {
"type": "integer",
"$comment": "Maximum is the latest protocol version"
},
"$id": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"$type": {
"type": "string"
},
"$revision": {
"type": "integer",
"minimum": 1
},
"$dataContractId": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"$ownerId": {
"type": "array",
"byteArray": true,
"minItems": 32,
"maxItems": 32,
"contentMediaType": "application/x.dash.dpp.identifier"
},
"$createdAt": {
"type": "integer",
"minimum": 0
},
"$updatedAt": {
"type": "integer",
"minimum": 0
}
},
"required": [
"$protocolVersion",
"$id",
"$type",
"$revision",
"$dataContractId",
"$ownerId"
],
"additionalProperties": false
}
1 change: 1 addition & 0 deletions packages/rs-dpp/src/bls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{ProtocolError, PublicKeyValidationError};
#[cfg(not(target_arch = "wasm32"))]
use anyhow::anyhow;
use bls_signatures::{verify_messages, PrivateKey, PublicKey, Serialize};
use std::convert::TryInto;
Expand Down
10 changes: 8 additions & 2 deletions packages/rs-dpp/src/convertible.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
use platform_value::Value;
use serde_json::Value as JsonValue;

use crate::ProtocolError;

pub trait Convertible {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's out of context of this refactoring, but I want to speak out load that this trait is a joke and the concept of clean objects is also weird; looking at DataContract's implementation of this trait it becomes obvious that there must be two different types, dirty/clean if you want (I suppose one is input data rather than an actual data contract structure -- a good candidate for a separate type) but these magic tricks on untyped data (json/value) is something we should get rid of, what do you think about creating a ticket to get a clear view on what our entities are and possibly stop mixing them?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I complete agree, I had to do this in baby steps though. We will have to do a proper refactoring, but now is not the right time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you create a ticket for it?

/// Returns the [`platform_value::Value`] instance on an object
fn to_object(&self) -> Result<Value, ProtocolError>;
fn to_cleaned_object(&self) -> Result<Value, ProtocolError>;
/// Returns the [`platform_value::Value`] instance on an object
fn into_object(self) -> Result<Value, ProtocolError>;
/// Returns the [`serde_json::Value`] instance that preserves the `Vec<u8>` representation
/// for Identifiers and binary data
fn to_object(&self) -> Result<JsonValue, ProtocolError>;
fn to_json_object(&self) -> Result<JsonValue, ProtocolError>;
/// Returns the [`serde_json::Value`] instance that encodes:
/// - Identifiers - with base58
/// - Binary data - with base64
fn to_json(&self) -> Result<JsonValue, ProtocolError>;
/// Returns the cibor-encoded bytes representation of the object. The data is prefixed by 4 bytes containing
/// Returns the cbor-encoded bytes representation of the object. The data is prefixed by 4 bytes containing
/// the Protocol Version
fn to_buffer(&self) -> Result<Vec<u8>, ProtocolError>;
}
Loading