Skip to content

Commit a21edd4

Browse files
committed
Updating persistence sdk version and refactoring application prototype.
2 parents 86490ee + 082b8d0 commit a21edd4

File tree

74 files changed

+781
-695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+781
-695
lines changed

.mocha/README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
## Pre-requisites
22

33
Install npm and nodeJS
4+
45
```
56
cd ~
67
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
78
sudo bash nodesource_setup.sh
89
sudo apt install nodejs
910
```
11+
1012
To check which version of Node.js you have installed after these initial steps, type:
13+
1114
```
1215
node -v
1316
```
17+
1418
For more information, visit https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04.
1519

1620

@@ -22,30 +26,33 @@ For more information, visit https://www.digitalocean.com/community/tutorials/how
2226
cd assetMantle/.mocha
2327
npm install
2428
```
29+
2530
## Testing
2631

27-
To test, go to the assetMantle/.mocha folder and type :
32+
To test, go to the assetMantle/.mocha folder and type :
2833

2934
```
3035
./.script/resetChainAndRunMocha.sh
3136
```
32-
or
37+
38+
or
39+
3340
```
3441
npm run test:awesome
3542
```
43+
3644
This will reset the chain and run mocha tests
3745

38-
NOTE: If any error comes which says: Error: Cannot find module 'xxx'
39-
then run "npm install xxx --save"
46+
NOTE: If any error comes which says: Error: Cannot find module 'xxx' then run "npm install xxx --save"
4047

4148
***
4249

4350
## Documentation
4451

4552
For more information, visit https://autom8able.com.
46-
53+
4754
***
48-
55+
4956
## Report
5057

5158
[mochawesome] Report JSON saved to assetMantle/.mocha/mochawesome-report/mochawesome.json

.mocha/package-lock.json

+43-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mocha/test/helpers/assets.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ async function queryAsset(id) {
1111
let options = {
1212
'method': 'GET',
1313
'url': config.ip + config.port + config.qAsset,
14-
'headers': {
15-
}
14+
'headers': {}
1615
};
17-
return new Promise(function(resolve, reject) {
16+
return new Promise(function (resolve, reject) {
1817
request(options, async function (error, res) {
1918
if (error) throw new Error(error);
2019
let result = JSON.parse(res.body)

.mocha/test/helpers/classifications.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ function queryClassification(id) {
1111
let options = {
1212
'method': 'GET',
1313
'url': config.ip + config.port + config.qClassification,
14-
'headers': {
15-
}
14+
'headers': {}
1615
};
17-
return new Promise(function(resolve, reject) {
16+
return new Promise(function (resolve, reject) {
1817
request(options, async function (error, res) {
1918
if (error) throw new Error(error);
2019
let result = JSON.parse(res.body)

.mocha/test/helpers/helpers.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ function FindInResponse(type, list, id) {
2323

2424
let ordersData = {
2525
'classificationID': '',
26-
'makerOwnableID':'',
27-
'takerOwnableID':'',
28-
'makerID':'',
26+
'makerOwnableID': '',
27+
'takerOwnableID': '',
28+
'makerID': '',
2929
'hashID': ''
3030
}
3131

32-
return new Promise(function(resolve, reject) {
32+
return new Promise(function (resolve, reject) {
3333
switch (type) {
3434
case 'assets':
3535
list.forEach(function (value) {

.mocha/test/helpers/identities.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ function queryIdentity(id) {
1111
let options = {
1212
'method': 'GET',
1313
'url': config.ip + config.port + config.qIdentity,
14-
'headers': {
15-
}
14+
'headers': {}
1615
};
17-
return new Promise(function(resolve, reject) {
16+
return new Promise(function (resolve, reject) {
1817
request(options, async function (error, res) {
1918
if (error) throw new Error(error);
2019
let result = JSON.parse(res.body)

.mocha/test/helpers/keys.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function createStore(mnemonic, password, filename = "key") {
7070
}
7171

7272
function decryptStore(file, password) {
73-
const data = fs.readFileSync(file, { encoding: "utf8", flag: "r" });
73+
const data = fs.readFileSync(file, {encoding: "utf8", flag: "r"});
7474
if (
7575
JSON.parse(data).hashpwd === crypto.createHash(passwordHashAlgorithm).update(password).digest("hex")
7676
) {

.mocha/test/helpers/orders.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ async function queryOrder(id) {
1111
let options = {
1212
'method': 'GET',
1313
'url': config.ip + config.port + config.qOrder,
14-
'headers': {
15-
}
14+
'headers': {}
1615
};
17-
return new Promise(function(resolve, reject) {
16+
return new Promise(function (resolve, reject) {
1817
request(options, async function (error, res) {
1918
if (error) throw new Error(error);
2019
let result = JSON.parse(res.body)

.mocha/test/transactions/assets.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ describe('Assets', async () => {
834834
"fromID": identityID,
835835
"toID": identityID1,
836836
"ownableID": assetID,
837-
"split":"0.000000000000000001"
837+
"split": "0.000000000000000001"
838838
}
839839
}
840840

.mocha/test/transactions/orders.js

+18-18
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ describe('Orders', async () => {
139139
"fromID": identityID,
140140
"classificationID": clsID,
141141
"makerOwnableID": assetID,
142-
"takerOwnableID":"stake",
143-
"expiresIn":"100000",
144-
"makerOwnableSplit":"0.000000000000000001",
142+
"takerOwnableID": "stake",
143+
"expiresIn": "100000",
144+
"makerOwnableSplit": "0.000000000000000001",
145145
"immutableMetaProperties": "Name:S|Board,Gifts:S|Exchange,OrderID:S|12345",
146146
"immutableProperties": "Which Gifts:S|Christmas Gift,What Gifts:S|kitty",
147147
"mutableMetaProperties": "exchangeRate:D|1,makerSplit:D|0.000000000000000001",
@@ -226,9 +226,9 @@ describe('Orders', async () => {
226226
"fromID": identityID,
227227
"classificationID": clsID,
228228
"makerOwnableID": assetID,
229-
"takerOwnableID":"stake",
230-
"expiresIn":"100000",
231-
"makerOwnableSplit":"0.000000000000000001",
229+
"takerOwnableID": "stake",
230+
"expiresIn": "100000",
231+
"makerOwnableSplit": "0.000000000000000001",
232232
"immutableMetaProperties": "Name:S|Board,Gifts:S|Exchange,OrderID:S|12345",
233233
"immutableProperties": "Which Gifts:S|Christmas Gift,What Gifts:S|kitty",
234234
"mutableMetaProperties": "exchangeRate:D|1,makerSplit:D|0.000000000000000001",
@@ -459,9 +459,9 @@ describe('Orders', async () => {
459459
"fromID": identityID,
460460
"classificationID": clsID,
461461
"makerOwnableID": "stake",
462-
"takerOwnableID":"stake",
463-
"expiresIn":"100000",
464-
"makerOwnableSplit":"0.000000000000000001",
462+
"takerOwnableID": "stake",
463+
"expiresIn": "100000",
464+
"makerOwnableSplit": "0.000000000000000001",
465465
"immutableMetaProperties": "Name1:S|Board,Gifts1:S|Exchange,OrderID1:S|12345",
466466
"immutableProperties": "Which Gifts1:S|Christmas Gift,What Gifts1:S|kitty",
467467
"mutableMetaProperties": "exchangeRate:D|1,makerSplit:D|0.000000000000000001",
@@ -545,9 +545,9 @@ describe('Orders', async () => {
545545
"fromID": identityID,
546546
"classificationID": clsID,
547547
"makerOwnableID": "stake",
548-
"takerOwnableID":"stake",
549-
"expiresIn":"100000",
550-
"makerOwnableSplit":"0.000000000000000001",
548+
"takerOwnableID": "stake",
549+
"expiresIn": "100000",
550+
"makerOwnableSplit": "0.000000000000000001",
551551
"immutableMetaProperties": "Name1:S|Board,Gifts1:S|Exchange,OrderID1:S|12345",
552552
"immutableProperties": "Which Gifts1:S|Christmas Gift,What Gifts1:S|kitty",
553553
"mutableMetaProperties": "exchangeRate:D|1,makerSplit:D|0.000000000000000001",
@@ -722,9 +722,9 @@ describe('Orders', async () => {
722722
"fromID": identityID,
723723
"classificationID": clsID,
724724
"makerOwnableID": assetID,
725-
"takerOwnableID":identityID1,
726-
"expiresIn":"100000",
727-
"makerOwnableSplit":"0.000000000000000001",
725+
"takerOwnableID": identityID1,
726+
"expiresIn": "100000",
727+
"makerOwnableSplit": "0.000000000000000001",
728728
"immutableMetaProperties": "Name2:S|Board,Gifts2:S|Exchange,OrderID2:S|12345",
729729
"immutableProperties": "Which Gifts2:S|Christmas Gift,What Gifts2:S|kitty",
730730
"mutableMetaProperties": "exchangeRate:D|1,makerSplit:D|0.000000000000000001",
@@ -927,9 +927,9 @@ describe('Orders', async () => {
927927
"fromID": identityID,
928928
"classificationID": clsID,
929929
"makerOwnableID": "stake",
930-
"takerOwnableID":"stake",
931-
"expiresIn":"100000",
932-
"makerOwnableSplit":"100",
930+
"takerOwnableID": "stake",
931+
"expiresIn": "100000",
932+
"makerOwnableSplit": "100",
933933
"immutableMetaProperties": "Name3:S|Board,Gifts3:S|Exchange,OrderID3:S|12345",
934934
"immutableProperties": "Which Gifts3:S|Christmas Gift,What Gifts3:S|kitty",
935935
"mutableMetaProperties": "exchangeRate:D|1,makerSplit:D|0.000000000000000001",

.rest/assetsMutate.http

+1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ client.test("Response Code Check", function() {
3434
client.assert(!JSON.parse(JSON.stringify(response.body)).hasOwnProperty("code") , "Response Code is not 0");
3535
});
3636
%}
37+
3738
###

.rest/http-client.private.env.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"test": {
3-
"ACCOUNT_1_MNEMONIC":"taxi barely trade submit twist unable deposit merit flip ticket soccer budget course like bulb fiber leopard hawk fiction hello muscle trumpet ensure kiss"
3+
"ACCOUNT_1_MNEMONIC": "taxi barely trade submit twist unable deposit merit flip ticket soccer budget course like bulb fiber leopard hawk fiction hello muscle trumpet ensure kiss"
44
}
55
}

.rest/identitiesQuery.http

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Accept: application/json
66
client.assert(response.status === 200, "Response status is not 200");
77
});
88
%}
9+
910
###

.rest/keysAdd.http

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Content-Type: application/json
1111
client.global.set("ACCOUNT_1_ADDRESS", JSON.parse(JSON.stringify(response.body)).result.KeyOutput.address);
1212
});
1313
%}
14+
1415
###

.rest/keysRecover.http

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ Content-Type: application/json
1212
client.global.set("ACCOUNT_1_ADDRESS", JSON.parse(JSON.stringify(response.body)).result.KeyOutput.address);
1313
});
1414
%}
15+
1516
###

.rest/metasReveal.http

+1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ client.test("Response Code Check", function() {
3131
client.assert(!JSON.parse(JSON.stringify(response.body)).hasOwnProperty("code") , "Response Code is not 0");
3232
});
3333
%}
34+
3435
###

.rest/ordersCancel.http

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ client.test("Response Code Check", function() {
3232
client.assert(!JSON.parse(JSON.stringify(response.body)).hasOwnProperty("code") , "Response Code is not 0");
3333
});
3434
%}
35+
3536
###

.rest/ordersMake.http

+1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ client.test("Response Code Check", function() {
4141
client.assert(!JSON.parse(JSON.stringify(response.body)).hasOwnProperty("code") , "Response Code is not 0");
4242
});
4343
%}
44+
4445
###

0 commit comments

Comments
 (0)