@dashevo/dpns-contract 0.3.0-dev.5 → 0.21.4
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/README.md +2 -2
- package/package.json +9 -16
- package/schema/dpns-contract-documents.json +24 -15
- package/test/unit/dpnsContract.spec.js +38 -34
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
- package/.travis.yml +0 -42
- package/bin/travis-deploy.sh +0 -31
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# DPNS Contract
|
|
2
2
|
|
|
3
|
-
[](https://github.com/dashevo/dpns-contract/actions/workflows/test_and_release.yml)
|
|
4
4
|
[](https://npmjs.org/package/@dashevo/dpns-contract)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
JSON Contracts for Dash Platform Name Service
|
|
7
7
|
|
|
8
8
|
## Table of Contents
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dpns-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.4",
|
|
4
4
|
"description": "A contract and helper scripts for DPNS DApp",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"check-package": "npm run check-package:name && npm run check-package:version",
|
|
7
|
-
"check-package:name": "test $(jq -r .name package.json) = $(jq -r .name package-lock.json)",
|
|
8
|
-
"check-package:version": "test $(jq -r .version package.json) = $(jq -r .version package-lock.json)",
|
|
9
6
|
"lint": "eslint .",
|
|
10
7
|
"test": "npm run test:unit",
|
|
11
8
|
"test:unit": "mocha 'test/unit/**/*.spec.js'"
|
|
@@ -34,18 +31,14 @@
|
|
|
34
31
|
],
|
|
35
32
|
"license": "MIT",
|
|
36
33
|
"devDependencies": {
|
|
37
|
-
"@dashevo/
|
|
38
|
-
"
|
|
39
|
-
"@dashevo/dpp": "~0.16.0-dev.4",
|
|
40
|
-
"chai": "^4.2.0",
|
|
34
|
+
"@dashevo/dpp": "~0.21.4",
|
|
35
|
+
"chai": "^4.3.4",
|
|
41
36
|
"dirty-chai": "^2.0.1",
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint-config-airbnb-base": "^14.
|
|
44
|
-
"eslint-plugin-import": "^2.
|
|
45
|
-
"mocha": "^
|
|
46
|
-
"
|
|
47
|
-
"sinon": "^
|
|
48
|
-
"sinon-chai": "^3.4.0",
|
|
49
|
-
"yargs": "^15.3.1"
|
|
37
|
+
"eslint": "^7.32.0",
|
|
38
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
39
|
+
"eslint-plugin-import": "^2.24.2",
|
|
40
|
+
"mocha": "^9.1.2",
|
|
41
|
+
"sinon": "^11.1.2",
|
|
42
|
+
"sinon-chai": "^3.7.0"
|
|
50
43
|
}
|
|
51
44
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"domain": {
|
|
3
|
+
"type": "object",
|
|
3
4
|
"indices": [
|
|
4
5
|
{
|
|
5
6
|
"properties": [
|
|
@@ -19,55 +20,62 @@
|
|
|
19
20
|
}
|
|
20
21
|
],
|
|
21
22
|
"unique": true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"properties": [
|
|
26
|
+
{
|
|
27
|
+
"records.dashAliasIdentityId": "asc"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
22
30
|
}
|
|
23
31
|
],
|
|
24
32
|
"properties": {
|
|
25
33
|
"label": {
|
|
26
34
|
"type": "string",
|
|
27
|
-
"pattern": "^
|
|
35
|
+
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$",
|
|
28
36
|
"minLength": 3,
|
|
29
37
|
"maxLength": 63,
|
|
30
38
|
"description": "Domain label. e.g. 'Bob'."
|
|
31
39
|
},
|
|
32
40
|
"normalizedLabel": {
|
|
33
41
|
"type": "string",
|
|
34
|
-
"pattern": "^
|
|
42
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$",
|
|
35
43
|
"maxLength": 63,
|
|
36
44
|
"description": "Domain label in lowercase for case-insensitive uniqueness validation. e.g. 'bob'",
|
|
37
45
|
"$comment": "Must be equal to the label in lowercase. This property will be deprecated due to case insensitive indices"
|
|
38
46
|
},
|
|
39
47
|
"normalizedParentDomainName": {
|
|
40
48
|
"type": "string",
|
|
41
|
-
"pattern": "^$|^
|
|
49
|
+
"pattern": "^$|^[[a-z0-9][a-z0-9-\\.]{0,188}[a-z0-9]$",
|
|
42
50
|
"minLength": 0,
|
|
43
51
|
"maxLength": 190,
|
|
44
52
|
"description": "A full parent domain name in lowercase for case-insensitive uniqueness validation. e.g. 'dash'",
|
|
45
53
|
"$comment": "Must either be equal to an existing domain or empty to create a top level domain. Only the data contract owner can create top level domains."
|
|
46
54
|
},
|
|
47
55
|
"preorderSalt": {
|
|
48
|
-
"type": "
|
|
56
|
+
"type": "array",
|
|
49
57
|
"byteArray": true,
|
|
50
|
-
"
|
|
51
|
-
"
|
|
58
|
+
"minItems": 32,
|
|
59
|
+
"maxItems": 32,
|
|
52
60
|
"description": "Salt used in the preorder document"
|
|
53
61
|
},
|
|
54
62
|
"records": {
|
|
55
63
|
"type": "object",
|
|
56
64
|
"properties": {
|
|
57
65
|
"dashUniqueIdentityId": {
|
|
58
|
-
"type": "
|
|
66
|
+
"type": "array",
|
|
59
67
|
"byteArray": true,
|
|
60
|
-
"
|
|
61
|
-
"
|
|
68
|
+
"minItems": 32,
|
|
69
|
+
"maxItems": 32,
|
|
62
70
|
"contentMediaType": "application/x.dash.dpp.identifier",
|
|
63
71
|
"description": "Identity ID to be used to create the primary name the Identity",
|
|
64
72
|
"$comment": "Must be equal to the document owner"
|
|
65
73
|
},
|
|
66
74
|
"dashAliasIdentityId": {
|
|
67
|
-
"type": "
|
|
75
|
+
"type": "array",
|
|
68
76
|
"byteArray": true,
|
|
69
|
-
"
|
|
70
|
-
"
|
|
77
|
+
"minItems": 32,
|
|
78
|
+
"maxItems": 32,
|
|
71
79
|
"contentMediaType": "application/x.dash.dpp.identifier",
|
|
72
80
|
"description": "Identity ID to be used to create alias names for the Identity",
|
|
73
81
|
"$comment": "Must be equal to the document owner"
|
|
@@ -104,6 +112,7 @@
|
|
|
104
112
|
"$comment": "In order to register a domain you need to create a preorder. The preorder step is needed to prevent man-in-the-middle attacks. normalizedLabel + '.' + normalizedParentDomain must not be longer than 253 chars length as defined by RFC 1035. Domain documents are immutable: modification and deletion are restricted"
|
|
105
113
|
},
|
|
106
114
|
"preorder": {
|
|
115
|
+
"type": "object",
|
|
107
116
|
"indices": [
|
|
108
117
|
{
|
|
109
118
|
"properties": [
|
|
@@ -116,10 +125,10 @@
|
|
|
116
125
|
],
|
|
117
126
|
"properties": {
|
|
118
127
|
"saltedDomainHash": {
|
|
119
|
-
"type": "
|
|
128
|
+
"type": "array",
|
|
120
129
|
"byteArray": true,
|
|
121
|
-
"
|
|
122
|
-
"
|
|
130
|
+
"minItems": 32,
|
|
131
|
+
"maxItems": 32,
|
|
123
132
|
"description": "Double sha-256 of the concatenation of a 32 byte random salt and a normalized domain name"
|
|
124
133
|
}
|
|
125
134
|
},
|
|
@@ -11,7 +11,7 @@ describe('DPNS Contract', () => {
|
|
|
11
11
|
let dataContract;
|
|
12
12
|
let identityId;
|
|
13
13
|
|
|
14
|
-
beforeEach(function beforeEach() {
|
|
14
|
+
beforeEach(async function beforeEach() {
|
|
15
15
|
const fetchContractStub = this.sinon.stub();
|
|
16
16
|
|
|
17
17
|
dpp = new DashPlatformProtocol({
|
|
@@ -20,6 +20,8 @@ describe('DPNS Contract', () => {
|
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
await dpp.initialize();
|
|
24
|
+
|
|
23
25
|
identityId = generateRandomIdentifier();
|
|
24
26
|
|
|
25
27
|
dataContract = dpp.dataContract.create(identityId, dpnsContractDocumentsSchema);
|
|
@@ -27,7 +29,9 @@ describe('DPNS Contract', () => {
|
|
|
27
29
|
fetchContractStub.resolves(dataContract);
|
|
28
30
|
});
|
|
29
31
|
|
|
30
|
-
it('should have a valid contract definition', async ()
|
|
32
|
+
it('should have a valid contract definition', async function shouldHaveValidContract() {
|
|
33
|
+
this.timeout(5000);
|
|
34
|
+
|
|
31
35
|
const validationResult = await dpp.dataContract.validate(dataContract);
|
|
32
36
|
|
|
33
37
|
expect(validationResult.isValid()).to.be.true();
|
|
@@ -77,8 +81,8 @@ describe('DPNS Contract', () => {
|
|
|
77
81
|
const [error] = e.getErrors();
|
|
78
82
|
|
|
79
83
|
expect(error.name).to.equal('JsonSchemaError');
|
|
80
|
-
expect(error.keyword).to.equal('
|
|
81
|
-
expect(error.
|
|
84
|
+
expect(error.keyword).to.equal('minItems');
|
|
85
|
+
expect(error.instancePath).to.equal('/saltedDomainHash');
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
|
|
@@ -96,8 +100,8 @@ describe('DPNS Contract', () => {
|
|
|
96
100
|
const [error] = e.getErrors();
|
|
97
101
|
|
|
98
102
|
expect(error.name).to.equal('JsonSchemaError');
|
|
99
|
-
expect(error.keyword).to.equal('
|
|
100
|
-
expect(error.
|
|
103
|
+
expect(error.keyword).to.equal('minItems');
|
|
104
|
+
expect(error.instancePath).to.equal('/saltedDomainHash');
|
|
101
105
|
}
|
|
102
106
|
});
|
|
103
107
|
|
|
@@ -115,8 +119,8 @@ describe('DPNS Contract', () => {
|
|
|
115
119
|
const [error] = e.getErrors();
|
|
116
120
|
|
|
117
121
|
expect(error.name).to.equal('JsonSchemaError');
|
|
118
|
-
expect(error.keyword).to.equal('
|
|
119
|
-
expect(error.
|
|
122
|
+
expect(error.keyword).to.equal('maxItems');
|
|
123
|
+
expect(error.instancePath).to.equal('/saltedDomainHash');
|
|
120
124
|
}
|
|
121
125
|
});
|
|
122
126
|
});
|
|
@@ -202,7 +206,7 @@ describe('DPNS Contract', () => {
|
|
|
202
206
|
|
|
203
207
|
expect(error.name).to.equal('JsonSchemaError');
|
|
204
208
|
expect(error.keyword).to.equal('pattern');
|
|
205
|
-
expect(error.
|
|
209
|
+
expect(error.instancePath).to.equal('/label');
|
|
206
210
|
}
|
|
207
211
|
});
|
|
208
212
|
|
|
@@ -221,7 +225,7 @@ describe('DPNS Contract', () => {
|
|
|
221
225
|
|
|
222
226
|
expect(error.name).to.equal('JsonSchemaError');
|
|
223
227
|
expect(error.keyword).to.equal('minLength');
|
|
224
|
-
expect(error.
|
|
228
|
+
expect(error.instancePath).to.equal('/label');
|
|
225
229
|
}
|
|
226
230
|
});
|
|
227
231
|
|
|
@@ -240,7 +244,7 @@ describe('DPNS Contract', () => {
|
|
|
240
244
|
|
|
241
245
|
expect(error.name).to.equal('JsonSchemaError');
|
|
242
246
|
expect(error.keyword).to.equal('maxLength');
|
|
243
|
-
expect(error.
|
|
247
|
+
expect(error.instancePath).to.equal('/label');
|
|
244
248
|
}
|
|
245
249
|
});
|
|
246
250
|
});
|
|
@@ -280,7 +284,7 @@ describe('DPNS Contract', () => {
|
|
|
280
284
|
|
|
281
285
|
expect(error.name).to.equal('JsonSchemaError');
|
|
282
286
|
expect(error.keyword).to.equal('pattern');
|
|
283
|
-
expect(error.
|
|
287
|
+
expect(error.instancePath).to.equal('/normalizedLabel');
|
|
284
288
|
}
|
|
285
289
|
});
|
|
286
290
|
|
|
@@ -299,7 +303,7 @@ describe('DPNS Contract', () => {
|
|
|
299
303
|
|
|
300
304
|
expect(error.name).to.equal('JsonSchemaError');
|
|
301
305
|
expect(error.keyword).to.equal('maxLength');
|
|
302
|
-
expect(error.
|
|
306
|
+
expect(error.instancePath).to.equal('/normalizedLabel');
|
|
303
307
|
}
|
|
304
308
|
});
|
|
305
309
|
});
|
|
@@ -339,7 +343,7 @@ describe('DPNS Contract', () => {
|
|
|
339
343
|
|
|
340
344
|
expect(error.name).to.equal('JsonSchemaError');
|
|
341
345
|
expect(error.keyword).to.equal('maxLength');
|
|
342
|
-
expect(error.
|
|
346
|
+
expect(error.instancePath).to.equal('/normalizedParentDomainName');
|
|
343
347
|
}
|
|
344
348
|
});
|
|
345
349
|
|
|
@@ -358,7 +362,7 @@ describe('DPNS Contract', () => {
|
|
|
358
362
|
|
|
359
363
|
expect(error.name).to.equal('JsonSchemaError');
|
|
360
364
|
expect(error.keyword).to.equal('pattern');
|
|
361
|
-
expect(error.
|
|
365
|
+
expect(error.instancePath).to.equal('/normalizedParentDomainName');
|
|
362
366
|
}
|
|
363
367
|
});
|
|
364
368
|
});
|
|
@@ -397,8 +401,8 @@ describe('DPNS Contract', () => {
|
|
|
397
401
|
const [error] = e.getErrors();
|
|
398
402
|
|
|
399
403
|
expect(error.name).to.equal('JsonSchemaError');
|
|
400
|
-
expect(error.keyword).to.equal('
|
|
401
|
-
expect(error.
|
|
404
|
+
expect(error.keyword).to.equal('minItems');
|
|
405
|
+
expect(error.instancePath).to.equal('/preorderSalt');
|
|
402
406
|
}
|
|
403
407
|
});
|
|
404
408
|
|
|
@@ -416,8 +420,8 @@ describe('DPNS Contract', () => {
|
|
|
416
420
|
const [error] = e.getErrors();
|
|
417
421
|
|
|
418
422
|
expect(error.name).to.equal('JsonSchemaError');
|
|
419
|
-
expect(error.keyword).to.equal('
|
|
420
|
-
expect(error.
|
|
423
|
+
expect(error.keyword).to.equal('minItems');
|
|
424
|
+
expect(error.instancePath).to.equal('/preorderSalt');
|
|
421
425
|
}
|
|
422
426
|
});
|
|
423
427
|
|
|
@@ -435,8 +439,8 @@ describe('DPNS Contract', () => {
|
|
|
435
439
|
const [error] = e.getErrors();
|
|
436
440
|
|
|
437
441
|
expect(error.name).to.equal('JsonSchemaError');
|
|
438
|
-
expect(error.keyword).to.equal('
|
|
439
|
-
expect(error.
|
|
442
|
+
expect(error.keyword).to.equal('maxItems');
|
|
443
|
+
expect(error.instancePath).to.equal('/preorderSalt');
|
|
440
444
|
}
|
|
441
445
|
});
|
|
442
446
|
});
|
|
@@ -503,7 +507,7 @@ describe('DPNS Contract', () => {
|
|
|
503
507
|
|
|
504
508
|
expect(error.name).to.equal('JsonSchemaError');
|
|
505
509
|
expect(error.keyword).to.equal('minProperties');
|
|
506
|
-
expect(error.
|
|
510
|
+
expect(error.instancePath).to.equal('/records');
|
|
507
511
|
}
|
|
508
512
|
});
|
|
509
513
|
|
|
@@ -524,7 +528,7 @@ describe('DPNS Contract', () => {
|
|
|
524
528
|
|
|
525
529
|
expect(error.name).to.equal('JsonSchemaError');
|
|
526
530
|
expect(error.keyword).to.equal('additionalProperties');
|
|
527
|
-
expect(error.
|
|
531
|
+
expect(error.instancePath).to.equal('/records');
|
|
528
532
|
expect(error.params.additionalProperty).to.equal('someOtherProperty');
|
|
529
533
|
}
|
|
530
534
|
});
|
|
@@ -548,7 +552,7 @@ describe('DPNS Contract', () => {
|
|
|
548
552
|
|
|
549
553
|
expect(error.name).to.equal('JsonSchemaError');
|
|
550
554
|
expect(error.keyword).to.equal('maxProperties');
|
|
551
|
-
expect(error.
|
|
555
|
+
expect(error.instancePath).to.equal('/records');
|
|
552
556
|
}
|
|
553
557
|
});
|
|
554
558
|
|
|
@@ -569,8 +573,8 @@ describe('DPNS Contract', () => {
|
|
|
569
573
|
const [error] = e.getErrors();
|
|
570
574
|
|
|
571
575
|
expect(error.name).to.equal('JsonSchemaError');
|
|
572
|
-
expect(error.keyword).to.equal('
|
|
573
|
-
expect(error.
|
|
576
|
+
expect(error.keyword).to.equal('minItems');
|
|
577
|
+
expect(error.instancePath).to.equal('/records/dashUniqueIdentityId');
|
|
574
578
|
}
|
|
575
579
|
});
|
|
576
580
|
|
|
@@ -590,8 +594,8 @@ describe('DPNS Contract', () => {
|
|
|
590
594
|
const [error] = e.getErrors();
|
|
591
595
|
|
|
592
596
|
expect(error.name).to.equal('JsonSchemaError');
|
|
593
|
-
expect(error.keyword).to.equal('
|
|
594
|
-
expect(error.
|
|
597
|
+
expect(error.keyword).to.equal('maxItems');
|
|
598
|
+
expect(error.instancePath).to.equal('/records/dashUniqueIdentityId');
|
|
595
599
|
}
|
|
596
600
|
});
|
|
597
601
|
});
|
|
@@ -613,8 +617,8 @@ describe('DPNS Contract', () => {
|
|
|
613
617
|
const [error] = e.getErrors();
|
|
614
618
|
|
|
615
619
|
expect(error.name).to.equal('JsonSchemaError');
|
|
616
|
-
expect(error.keyword).to.equal('
|
|
617
|
-
expect(error.
|
|
620
|
+
expect(error.keyword).to.equal('minItems');
|
|
621
|
+
expect(error.instancePath).to.equal('/records/dashAliasIdentityId');
|
|
618
622
|
}
|
|
619
623
|
});
|
|
620
624
|
|
|
@@ -634,8 +638,8 @@ describe('DPNS Contract', () => {
|
|
|
634
638
|
const [error] = e.getErrors();
|
|
635
639
|
|
|
636
640
|
expect(error.name).to.equal('JsonSchemaError');
|
|
637
|
-
expect(error.keyword).to.equal('
|
|
638
|
-
expect(error.
|
|
641
|
+
expect(error.keyword).to.equal('maxItems');
|
|
642
|
+
expect(error.instancePath).to.equal('/records/dashAliasIdentityId');
|
|
639
643
|
}
|
|
640
644
|
});
|
|
641
645
|
});
|
|
@@ -677,7 +681,7 @@ describe('DPNS Contract', () => {
|
|
|
677
681
|
|
|
678
682
|
expect(error.name).to.equal('JsonSchemaError');
|
|
679
683
|
expect(error.keyword).to.equal('additionalProperties');
|
|
680
|
-
expect(error.
|
|
684
|
+
expect(error.instancePath).to.equal('/subdomainRules');
|
|
681
685
|
}
|
|
682
686
|
});
|
|
683
687
|
|
|
@@ -697,7 +701,7 @@ describe('DPNS Contract', () => {
|
|
|
697
701
|
|
|
698
702
|
expect(error.name).to.equal('JsonSchemaError');
|
|
699
703
|
expect(error.keyword).to.equal('type');
|
|
700
|
-
expect(error.
|
|
704
|
+
expect(error.instancePath).to.equal('/subdomainRules/allowSubdomains');
|
|
701
705
|
}
|
|
702
706
|
});
|
|
703
707
|
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: ''
|
|
5
|
-
labels: 'bug'
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<!--- Provide a general summary of the issue in the Title above -->
|
|
11
|
-
|
|
12
|
-
## Expected Behavior
|
|
13
|
-
<!--- Tell us what should happen -->
|
|
14
|
-
|
|
15
|
-
## Current Behavior
|
|
16
|
-
<!--- Tell us what happens instead of the expected behavior -->
|
|
17
|
-
|
|
18
|
-
## Possible Solution
|
|
19
|
-
<!--- Not obligatory, but suggest a fix/reason for the bug -->
|
|
20
|
-
|
|
21
|
-
## Steps to Reproduce (for bugs)
|
|
22
|
-
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
|
23
|
-
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
|
24
|
-
1.
|
|
25
|
-
2.
|
|
26
|
-
3.
|
|
27
|
-
4.
|
|
28
|
-
|
|
29
|
-
## Context
|
|
30
|
-
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
|
31
|
-
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
|
32
|
-
|
|
33
|
-
## Your Environment
|
|
34
|
-
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
|
35
|
-
* Version used:
|
|
36
|
-
* Environment name and version (e.g. Chrome 39, node.js 5.4):
|
|
37
|
-
* Operating System and version (desktop, server, or mobile):
|
|
38
|
-
* Link to your project:
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: ''
|
|
5
|
-
labels: 'enhancement'
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<!--- Provide a general summary of the feature request in the Title above -->
|
|
11
|
-
|
|
12
|
-
## Expected Behavior
|
|
13
|
-
<!--- A clear and concise description of what you want to happen -->
|
|
14
|
-
|
|
15
|
-
## Current Behavior
|
|
16
|
-
<!--- Explain the difference from current behavior -->
|
|
17
|
-
|
|
18
|
-
## Possible Solution
|
|
19
|
-
<!--- Suggest ideas of how to implement the addition or change -->
|
|
20
|
-
|
|
21
|
-
## Alternatives Considered
|
|
22
|
-
<!--- A clear and concise description of any alternative solutions or features you've considered -->
|
|
23
|
-
|
|
24
|
-
## Additional Context
|
|
25
|
-
<!--- Add any other context or screenshots about the feature request here. -->
|
|
26
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!--- Provide a general summary of your changes in the Title above -->
|
|
2
|
-
<!--- Pull request titles must use the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format -->
|
|
3
|
-
|
|
4
|
-
## Issue being fixed or feature implemented
|
|
5
|
-
<!--- Why is this change required? What problem does it solve? -->
|
|
6
|
-
<!--- If it fixes an open issue, please link to the issue here. -->
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## What was done?
|
|
10
|
-
<!--- Describe your changes in detail -->
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## How Has This Been Tested?
|
|
14
|
-
<!--- Please describe in detail how you tested your changes. -->
|
|
15
|
-
<!--- Include details of your testing environment, and the tests you ran to -->
|
|
16
|
-
<!--- see how your change affects other areas of the code, etc. -->
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Breaking Changes
|
|
20
|
-
<!--- Please describe any breaking changes your code introduces and verify that -->
|
|
21
|
-
<!--- the title includes "!" following the conventional commit type (e.g. "feat!: ..."-->
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Checklist:
|
|
25
|
-
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
|
26
|
-
- [ ] I have performed a self-review of my own code
|
|
27
|
-
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
28
|
-
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
|
|
29
|
-
- [ ] I have made corresponding changes to the documentation
|
|
30
|
-
|
|
31
|
-
**For repository code-owners and collaborators only**
|
|
32
|
-
- [ ] I have assigned this pull request to a milestone
|
package/.travis.yml
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
sudo: false
|
|
2
|
-
dist: trusty
|
|
3
|
-
language: node_js
|
|
4
|
-
|
|
5
|
-
node_js:
|
|
6
|
-
- '12'
|
|
7
|
-
- '14'
|
|
8
|
-
|
|
9
|
-
branches:
|
|
10
|
-
only:
|
|
11
|
-
- master
|
|
12
|
-
- /^v(0|[1-9]\d*)\.(0|[1-9]\d*)$/
|
|
13
|
-
- /^v(0|[1-9]\d*)\.(0|[1-9]\d*)-dev$/
|
|
14
|
-
- /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
|
|
15
|
-
|
|
16
|
-
services:
|
|
17
|
-
- docker
|
|
18
|
-
|
|
19
|
-
addons:
|
|
20
|
-
apt:
|
|
21
|
-
packages:
|
|
22
|
-
- docker-ce
|
|
23
|
-
|
|
24
|
-
before_install:
|
|
25
|
-
# Login to NPM registry
|
|
26
|
-
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
|
|
27
|
-
|
|
28
|
-
install:
|
|
29
|
-
- npm ci
|
|
30
|
-
|
|
31
|
-
script:
|
|
32
|
-
- npm run check-package
|
|
33
|
-
- npm run lint
|
|
34
|
-
- npm run test
|
|
35
|
-
|
|
36
|
-
deploy:
|
|
37
|
-
provider: script
|
|
38
|
-
skip_cleanup: true
|
|
39
|
-
script: bash bin/travis-deploy.sh
|
|
40
|
-
on:
|
|
41
|
-
tags: true
|
|
42
|
-
repo: dashevo/dpns-contract
|
package/bin/travis-deploy.sh
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#! /bin/sh
|
|
2
|
-
|
|
3
|
-
set -xe
|
|
4
|
-
|
|
5
|
-
# Update this whenever the latest Node.js LTS version changes (~ every year).
|
|
6
|
-
# Do not forget to add this version to .travis.yml config also.
|
|
7
|
-
LATEST_LTS_VERSION="14"
|
|
8
|
-
|
|
9
|
-
# We want this command to succeed whether or not the Node.js version is the
|
|
10
|
-
# latest (so that the build does not show as failed), but _only_ the latest
|
|
11
|
-
# should be used to publish the module.
|
|
12
|
-
if [ "$TRAVIS_NODE_VERSION" != "$LATEST_LTS_VERSION" ]; then
|
|
13
|
-
echo "Node.js v$TRAVIS_NODE_VERSION is not latest LTS version -- will not deploy with this version."
|
|
14
|
-
exit 0
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
# Ensure the tag matches the one in package.json, otherwise abort.
|
|
18
|
-
PACKAGE_TAG=v"$(jq -r .version package.json)"
|
|
19
|
-
if [ "$PACKAGE_TAG" != "$TRAVIS_TAG" ]; then
|
|
20
|
-
echo "Travis tag (\"$TRAVIS_TAG\") is not equal to package.json tag (\"$PACKAGE_TAG\"). Please push a correct tag and try again."
|
|
21
|
-
exit 1
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# Use regex pattern matching to check if "dev" exists in tag
|
|
25
|
-
NPM_TAG="latest"
|
|
26
|
-
if [[ $PACKAGE_TAG =~ dev ]]; then
|
|
27
|
-
NPM_TAG="dev"
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# Now that checks have been passed, publish the module
|
|
31
|
-
npm publish --tag $NPM_TAG
|