Skip to content

Commit

Permalink
v1.3.24 (#523)
Browse files Browse the repository at this point in the history
* Version 1.3.24
  • Loading branch information
kipliklotrika authored Sep 3, 2018
1 parent d88b398 commit 6c650d2
Show file tree
Hide file tree
Showing 55 changed files with 2,132 additions and 1,400 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ SEND_LOGS=1
LOGS_LEVEL_DEBUG=1

# Network identification
NETWORK_ID=TestnetV1.0.1b
NETWORK_ID=TestnetV1.0.2b
4 changes: 2 additions & 2 deletions importers/xml_examples/Retail/03_Pink_to_Orange_shipment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down Expand Up @@ -136,4 +136,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
4 changes: 2 additions & 2 deletions importers/xml_examples/Retail/04_Pink_to_Orange_receipt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down Expand Up @@ -135,4 +135,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
6 changes: 3 additions & 3 deletions importers/xml_examples/Retail/05_Pink_to_Red_shipment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<Vocabulary type="urn:ot:object:actor">
<VocabularyElementList>
<VocabularyElement id="urn:ot:object:actor:id:Company_Red">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Red</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down Expand Up @@ -136,4 +136,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
2 changes: 1 addition & 1 deletion importers/xml_examples/Retail/06_Pink_to_Red_receipt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<VocabularyElement id="urn:ot:object:actor:id:Company_Red">
<attribute id="urn:ot:object:actor:name">Red</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<Vocabulary type="urn:ot:object:actor">
<VocabularyElementList>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Orange</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down Expand Up @@ -136,4 +136,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<Vocabulary type="urn:ot:object:actor">
<VocabularyElementList>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Orange</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<Vocabulary type="urn:ot:object:actor">
<VocabularyElementList>
<VocabularyElement id="urn:ot:object:actor:id:Company_Red">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Red</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down Expand Up @@ -136,4 +136,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<Vocabulary type="urn:ot:object:actor">
<VocabularyElementList>
<VocabularyElement id="urn:ot:object:actor:id:Company_Red">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Red</attribute>
<attribute id="urn:ot:object:actor:category">Company Retail</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcAB7BD40602B78C0649032D2532dEFa23A4C0</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Pink</attribute>
Expand Down Expand Up @@ -135,4 +135,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@
<attribute id="urn:ot:object:actor:wallet">0xAaBbAd7BD40602B78C0649032D2532dEFa23A4C0</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Pink</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>

Expand All @@ -59,27 +54,6 @@
<id>urn:epc:id:sgln:Building_Green_V2</id>
</children>
</VocabularyElement>

<VocabularyElement id="urn:epc:id:sgln:Building_Pink">
<attribute id="urn:ot:object:location:category">Building</attribute>
<attribute id="urn:ot:object:location:description">Distributor</attribute>
<attribute id="urn:ot:object:location:actorId">urn:ot:object:actor:id:Company_Pink</attribute>
<children>
<id>urn:epc:id:sgln:Building_Pink_V3</id>
<id>urn:epc:id:sgln:Building_Pink_V4</id>
</children>
</VocabularyElement>

<VocabularyElement id="urn:epc:id:sgln:Building_Orange">
<attribute id="urn:ot:object:location:category">Building</attribute>
<attribute id="urn:ot:object:location:description">Retail store</attribute>
<attribute id="urn:ot:object:location:actorId">urn:ot:object:actor:id:Company_Orange</attribute>
<children>
<id>urn:epc:id:sgln:Building_Orange_V5</id>
<id>urn:epc:id:sgln:Building_Orange_V6</id>
</children>
</VocabularyElement>

</VocabularyElementList>
</Vocabulary>

Expand Down Expand Up @@ -173,4 +147,4 @@
</AggregationEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@
<attribute id="urn:ot:object:actor:wallet">0xAaBbAd7BD40602B78C0649032D2532dEFa23A4C0</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Pink</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@
<attribute id="urn:ot:object:actor:wallet">0xAaBbAd7BD40602B78C0649032D2532dEFa23A4C0</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Pink">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Pink</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>

Expand Down Expand Up @@ -164,4 +159,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Orange</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>
Expand Down Expand Up @@ -164,4 +164,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Orange</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>
Expand Down Expand Up @@ -164,4 +164,4 @@
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Orange</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>
Expand Down Expand Up @@ -151,4 +151,4 @@
</AggregationEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
<attribute id="urn:ot:object:actor:wallet">0xBbAaAd7BD40602B78C0649032D2532dEFa24323</attribute>
</VocabularyElement>
<VocabularyElement id="urn:ot:object:actor:id:Company_Orange">
<attribute id="urn:ot:object:actor:name">Green</attribute>
<attribute id="urn:ot:object:actor:name">Orange</attribute>
<attribute id="urn:ot:object:actor:category">Company producer</attribute>
<attribute id="urn:ot:object:actor:wallet">0xCcCcAd7BD40602B78C0649032D2532dEFa212345</attribute>
<attribute id="urn:ot:object:actor:wallet">0x90398eF02389Ef85F262737b4B3aDB8eE588B43A</attribute>
</VocabularyElement>
</VocabularyElementList>
</Vocabulary>
Expand Down Expand Up @@ -149,4 +149,4 @@
</AggregationEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
</epcis:EPCISDocument>
8 changes: 8 additions & 0 deletions migrations/20180407120531-create-data-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ module.exports = {
allowNull: false,
type: Sequelize.STRING,
},
import_hash: {
allowNull: false,
type: Sequelize.STRING,
},
import_timestamp: {
allowNull: false,
type: Sequelize.DATE,
Expand All @@ -31,6 +35,10 @@ module.exports = {
allowNull: false,
type: Sequelize.INTEGER,
},
transaction_hash: {
allowNull: true,
type: Sequelize.STRING,
},
}),
down: (queryInterface, Sequelize) => queryInterface.dropTable('data_infos'),
};
2 changes: 2 additions & 0 deletions models/data_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ module.exports = (sequelize, DataTypes) => {
data_provider_wallet: DataTypes.STRING(42),
total_documents: DataTypes.INTEGER,
root_hash: DataTypes.STRING(40),
import_hash: DataTypes.STRING(40),
import_timestamp: DataTypes.DATE,
data_size: DataTypes.INTEGER,
transaction_hash: DataTypes.STRING(128),
}, {
tableName: 'data_info',
});
Expand Down
5 changes: 3 additions & 2 deletions modules/Blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ class Blockchain {
* Writes data import root hash on blockchain
* @param importId
* @param rootHash
* @param importHash
* @returns {Promise}
*/
writeRootHash(importId, rootHash) {
return this.blockchain.writeRootHash(importId, rootHash);
writeRootHash(importId, rootHash, importHash) {
return this.blockchain.writeRootHash(importId, rootHash, importHash);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion modules/Blockchain/Ethereum/Transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ class Transactions {
break;
}
} catch (error) {
this.log.trace(`Nonce too low / underpriced detected. Retrying. ${error.toString()}`);
if (!error.toString().includes('nonce too low') && !error.toString().includes('underpriced')) {
throw new Error(error);
}

this.log.trace(`Nonce too low / underpriced detected. Retrying. ${error.toString()}`);
// eslint-disable-next-line no-await-in-loop
await sleep.sleep(2000);
}
Expand Down
Loading

0 comments on commit 6c650d2

Please sign in to comment.