Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

fix: wrong entropy size #157

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions schema/dataContract/stateTransition/dataContractCreate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"entropy": {
"type": "string",
"minLength": 34,
"maxLength": 34,
"minLength": 26,
"maxLength": 35,
"pattern": "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"properties": {
"$entropy": {
"type": "string",
"minLength": 34,
"maxLength": 34
"minLength": 26,
"maxLength": 35
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ describe('validateDocumentsBatchTransitionStructureFactory', () => {
expect(error.keyword).to.equal('type');
});

it('should be no less than 34 chars', async () => {
it('should be no less than 26 chars', async () => {
const [documentTransition] = rawStateTransition.transitions;

documentTransition.$entropy = '1'.repeat(33);
documentTransition.$entropy = '1'.repeat(24);

const result = await validateStructure(rawStateTransition);

Expand All @@ -197,10 +197,10 @@ describe('validateDocumentsBatchTransitionStructureFactory', () => {
expect(error.keyword).to.equal('minLength');
});

it('should be no longer than 34 chars', async () => {
it('should be no longer than 35 chars', async () => {
const [documentTransition] = rawStateTransition.transitions;

documentTransition.$entropy = '1'.repeat(35);
documentTransition.$entropy = '1'.repeat(36);

const result = await validateStructure(rawStateTransition);

Expand Down