fabric-shim
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -1,1 +0,1 @@ | ||
{"processes":{"707668d0-71e0-4e5b-94f3-a5b266ac663c":{"parent":null,"children":[]},"b8d18684-71b9-46e2-963d-8791e9110b53":{"parent":null,"children":[]}},"files":{"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/logger.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/stub.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/startCommand.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/chaincode.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/utils/utils.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/handler.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/iterators.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/server.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/utils/statebased.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/bootstrap.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/chaincodefromcontract.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/datamarshall.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/serverCommand.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/metadata.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/metadata/lib/generate.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/metadata/generateCommand.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/systemcontract.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/index.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/cli.js":["707668d0-71e0-4e5b-94f3-a5b266ac663c","b8d18684-71b9-46e2-963d-8791e9110b53"]},"externalIds":{}} | ||
{"processes":{"88198f24-dabd-4503-95ab-89604d887634":{"parent":null,"children":[]},"f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305":{"parent":null,"children":[]}},"files":{"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/logger.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/stub.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/startCommand.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/chaincode.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/utils/utils.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/handler.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/iterators.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/server.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/utils/statebased.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/bootstrap.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/chaincodefromcontract.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/datamarshall.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/serverCommand.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/metadata.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/metadata/lib/generate.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/cmds/metadata/generateCommand.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/lib/contract-spi/systemcontract.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/index.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"],"/home/runner/work/fabric-chaincode-node/fabric-chaincode-node/libraries/fabric-shim/cli.js":["88198f24-dabd-4503-95ab-89604d887634","f8d6ee8a-d5a6-4bb7-b7e3-ed7b73906305"]},"externalIds":{}} |
@@ -19,11 +19,11 @@ { | ||
"libraries/fabric-shim/lib/contract-spi/systemcontract.js": "43fdcc31a79a5f505c1da39d8db03ab6a0de60b6", | ||
"libraries/fabric-shim/lib/handler.js": "3a7547f890346ec35652bdb724380e39dd133c93", | ||
"libraries/fabric-shim/lib/iterators.js": "fe304d20da4688794e289cafd4543f876582f743", | ||
"libraries/fabric-shim/lib/handler.js": "c17db38706b15aca503166f918d8b384bf9b8d7a", | ||
"libraries/fabric-shim/lib/iterators.js": "9016c8abb253dce02a2984ad2fded76bb3997ff8", | ||
"libraries/fabric-shim/lib/logger.js": "930242e6c90270cf91378a4b167a4d5b3ba28d7e", | ||
"libraries/fabric-shim/lib/server.js": "f075086a990bf4dde90aa1863ca73b82633b9128", | ||
"libraries/fabric-shim/lib/stub.js": "65275cb783f91f8c8ec76ace5ea770261c8aa9f2", | ||
"libraries/fabric-shim/lib/utils/statebased.js": "22da43fab41e056a375a8752755c1648da756559", | ||
"libraries/fabric-shim/lib/utils/statebased.js": "c294ad5b1c97dd67d2e1499516c48ed70212c6fe", | ||
"libraries/fabric-shim/lib/utils/utils.js": "64a2a327844f7a3309beb0010f8389f8d038cf73", | ||
"libraries/fabric-shim/package-lock.json": "4d6f6feeb5804cdbaba3bc60f8b2a4a3c2754d90", | ||
"libraries/fabric-shim/package.json": "037f8cc9328c1cec8ec29e5c5d7bcf26cce14c5f", | ||
"libraries/fabric-shim/package.json": "ec7366afa64ebc99c3cd6a0487e04d24848ad113", | ||
"libraries/fabric-shim/startup.sh": "b0f86946114cd70f0462ef99b8c2d14248c034cc", | ||
@@ -45,3 +45,3 @@ "libraries/fabric-shim/test/typescript/chaincode.ts": "7bcd8bd2cec46f62baeb039661b7a1e064cedadc", | ||
"libraries/fabric-shim/test/unit/handler.js": "fb8b2389ff1d463fc14811d4c6d77312cf461c0b", | ||
"libraries/fabric-shim/test/unit/iterators.js": "2be0c62ba7fb22a39335d2e3016e5f5d9ee4e7ef", | ||
"libraries/fabric-shim/test/unit/iterators.js": "324fe1fefe5bc35ee74216d84b13aa4ed4708a25", | ||
"libraries/fabric-shim/test/unit/logger.js": "b829e4015caac88a40f66408b393a7811e18c9b0", | ||
@@ -57,3 +57,3 @@ "libraries/fabric-shim/test/unit/module.js": "89407876b28d3012d85b1f20fc5af618954372d0", | ||
"libraries/fabric-shim/test/unit/test-key.pem": "f42cbdc23b84e23503a7e125a58ff8fb7bd2ef78", | ||
"libraries/fabric-shim/test/unit/utils/statebased.js": "71380745fe1f15241542ea1dbe3509c3a85936de", | ||
"libraries/fabric-shim/test/unit/utils/statebased.js": "3e15e908fb18ceeb376ab208ac1b5496f62e2997", | ||
"libraries/fabric-shim/test/unit/utils/utils.js": "dca365f20fac9afe63f749dd6dce2b2a203876da", | ||
@@ -60,0 +60,0 @@ "libraries/fabric-shim/types/index.d.ts": "2ebf37c70ce964775005c680a6a4b89af385a820", |
@@ -331,4 +331,4 @@ /* | ||
// send an error message telling the peer about this | ||
logger.error(util.format('Chaincode is in "ready" state, can only ' + | ||
'process messages of type "established", but received "%s"', msg.type)); | ||
logger.error(util.format('Chaincode is in "established" state, can only ' + | ||
'process messages of type "ready", but received "%s"', msg.type)); | ||
const errMsg = newErrorMsg(msg, state); | ||
@@ -335,0 +335,0 @@ stream.write(errMsg); |
@@ -11,3 +11,3 @@ /* | ||
const {ledger} = require('@hyperledger/fabric-protos'); | ||
const { ledger } = require('@hyperledger/fabric-protos'); | ||
@@ -24,3 +24,3 @@ /** | ||
/** | ||
* constructor | ||
* constructor | ||
* | ||
@@ -30,7 +30,7 @@ * Note that the decoded payload will be a protobuf of type | ||
* | ||
* @param {ChaincodeSupportClient} handler client handler | ||
* @param {string} channel_id channel id | ||
* @param {string} txID transaction id | ||
* @param {object} response decoded payload | ||
*/ | ||
* @param {ChaincodeSupportClient} handler client handler | ||
* @param {string} channel_id channel id | ||
* @param {string} txID transaction id | ||
* @param {object} response decoded payload | ||
*/ | ||
constructor(handler, channel_id, txID, response, type) { | ||
@@ -48,7 +48,7 @@ this.type = type; | ||
/** | ||
* close the iterator. | ||
* @async | ||
* @return {promise} A promise that is resolved with the close payload or rejected | ||
* if there is a problem | ||
*/ | ||
* close the iterator. | ||
* @async | ||
* @return {promise} A promise that is resolved with the close payload or rejected | ||
* if there is a problem | ||
*/ | ||
async close() { | ||
@@ -60,43 +60,42 @@ logger.debug('close called on %s iterator for txid: %s', this.type, this.txID); | ||
/* | ||
* decode the payload depending on the type of iterator. | ||
* @param {object} bytes | ||
*/ | ||
_getResultFromBytes(bytes) { | ||
* creates a return value | ||
*/ | ||
_createAndEmitResult() { | ||
const resultsList = this.response.getResultsList(); | ||
let queryResult; | ||
// established external API has a very specific structure here | ||
// so need to 'fluff' up this structure to match | ||
// Not all queryResults have the same methods | ||
if (this.type === 'QUERY') { | ||
return ledger.queryresult.KV.deserializeBinary(bytes.getResultbytes()); | ||
const queryResultPb = ledger.queryresult.KV.deserializeBinary((resultsList[this.currentLoc]).getResultbytes()); | ||
queryResult = { | ||
key: queryResultPb.getKey(), | ||
value: Buffer.from(queryResultPb.getValue()) | ||
}; | ||
} else if (this.type === 'HISTORY') { | ||
return ledger.queryresult.KeyModification.deserializeBinary(bytes.getResultbytes()); | ||
} | ||
throw new Error('Iterator constructed with unknown type: ' + this.type); | ||
} | ||
const queryResultPb = ledger.queryresult.KeyModification.deserializeBinary((resultsList[this.currentLoc]).getResultbytes()); | ||
queryResult = { | ||
txId: queryResultPb.getTxId(), | ||
value: Buffer.from(queryResultPb.getValue()), | ||
isDelete: queryResultPb.getIsDelete(), | ||
timestamp: queryResultPb.getTimestamp().toObject() | ||
/* | ||
* creates a return value | ||
*/ | ||
_createAndEmitResult() { | ||
const queryResult = {}; | ||
const resultsList = this.response.getResultsList(); | ||
const queryResultPb = this._getResultFromBytes(resultsList[this.currentLoc]); | ||
queryResult.value = {value:Buffer.from(queryResultPb.getValue())}; | ||
/* istanbul ignore else*/ | ||
if ('getKey' in queryResultPb) { | ||
queryResult.value.key = Buffer.from(queryResultPb.getKey()).toString(); | ||
}; | ||
} else { | ||
throw new Error('Iterator constructed with unknown type: ' + this.type); | ||
} | ||
this.currentLoc++; | ||
queryResult.done = false; | ||
return queryResult; | ||
return {value: queryResult, done: false}; | ||
} | ||
/** | ||
* Get the next value and return it through a promise. | ||
* @async | ||
* @return {promise} a promise that is fulfilled with an object { value: (next value) }, | ||
* is fulfilled with an object { done: true } if there is no more value, | ||
* or is rejected if any error occurs. | ||
*/ | ||
* Get the next value and return it through a promise. | ||
* @async | ||
* @return {promise} a promise that is fulfilled with an object { value: (next value) }, | ||
* is fulfilled with an object { done: true } if there is no more value, | ||
* or is rejected if any error occurs. | ||
*/ | ||
async next() { | ||
@@ -120,3 +119,3 @@ // check to see if there are some results left in the current result set | ||
} | ||
return {done: true}; | ||
return { done: true }; | ||
} | ||
@@ -123,0 +122,0 @@ |
@@ -135,3 +135,4 @@ /* | ||
const policy = new common.SignaturePolicy(); | ||
// Need to say that we want all of the mspIDs from the list. | ||
const nOutOf = new common.SignaturePolicy.NOutOf(); | ||
@@ -141,2 +142,5 @@ nOutOf.setN(mspIds.length); | ||
const policy = new common.SignaturePolicy(); | ||
policy.setNOutOf(nOutOf); | ||
spe.setIdentitiesList(principals); | ||
@@ -143,0 +147,0 @@ spe.setRule(policy); |
{ | ||
"name": "fabric-shim", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"tag": "latest", | ||
@@ -51,4 +51,4 @@ "description": "A node.js implementation of Hyperledger Fabric chaincode shim, to allow endorsing peers and user-provided chaincodes to communicate with each other", | ||
"ajv": "^6.12.2", | ||
"fabric-contract-api": "2.5.1", | ||
"fabric-shim-api": "2.5.1", | ||
"fabric-contract-api": "2.5.2", | ||
"fabric-shim-api": "2.5.2", | ||
"fs-extra": "^10.0.1", | ||
@@ -55,0 +55,0 @@ "reflect-metadata": "^0.1.13", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
4951
1676686
22
+ Addedfabric-contract-api@2.5.2(transitive)
+ Addedfabric-shim-api@2.5.2(transitive)
- Removedfabric-contract-api@2.5.1(transitive)
- Removedfabric-shim-api@2.5.1(transitive)
Updatedfabric-contract-api@2.5.2
Updatedfabric-shim-api@2.5.2