mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 11:35:10 +00:00
fixed errors for chaincode-javascript
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
This commit is contained in:
parent
21cbf777a2
commit
b68d42cc2f
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue