fixed errors for chaincode-javascript

Signed-off-by: fraVlaca <ocsenarf@outlook.com>
This commit is contained in:
fraVlaca 2021-09-03 10:35:38 +01:00
parent 21cbf777a2
commit b68d42cc2f

View file

@ -8,8 +8,8 @@
//Deterministic JSON.stringify() //Deterministic JSON.stringify()
const stringify = require('json-stringify-deterministic') const stringify = require('json-stringify-deterministic');
const sortKeysRecursive = require('sort-keys-recursive') const sortKeysRecursive = require('sort-keys-recursive');
const { Contract } = require('fabric-contract-api'); const { Contract } = require('fabric-contract-api');
class AssetTransfer extends Contract { class AssetTransfer extends Contract {
@ -61,7 +61,7 @@ class AssetTransfer extends Contract {
]; ];
for (const asset of assets) { for (const asset of assets) {
//example of how to write to world state deterministically //example of how to write to world state deterministically
//use convetion of alphabetic order //use convetion of alphabetic order
//we insert data in alphabetic order using 'json-stringify-deterministic' and 'sort-keys-recursive' //we insert data in alphabetic order using 'json-stringify-deterministic' and 'sort-keys-recursive'
//when retrieving data, in any lang, the order of data will be the same and consequently also the corresonding hash //when retrieving data, in any lang, the order of data will be the same and consequently also the corresonding hash