Socket
Socket
Sign inDemoInstall

fabric-shim

Package Overview
Dependencies
4
Maintainers
2
Versions
303
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0-snapshot.26 to 1.0.0-snapshot.27

32

lib/handler.js

@@ -105,3 +105,3 @@ /*

* message on the queue then send the message to the peer
*
*
* @param {QMsg} qMsg the message to queue

@@ -128,3 +128,3 @@ */

* queue and sends the next message on the queue if there is one.
*
*
* @param {any} response the received response

@@ -150,4 +150,4 @@ */

* this returns the message at the top of the queue for the particular transaction.
*
* @param {string} txId
*
* @param {string} txId
* @returns {QMsg} the message at the top of the queue

@@ -164,3 +164,3 @@ */

//This may be an error, but I don't know if this should abend the container or
//should just keep going.
//should just keep going.
//throw new Error(errMsg);

@@ -172,3 +172,3 @@ }

* delete the queue if there are no more messages.
*
*
* @param {any} txId the transaction id

@@ -190,3 +190,3 @@ */

* send the current message to the peer.
*
*
* @param {any} txId the transaction id

@@ -364,8 +364,11 @@ */

async handleGetState(key, txId) {
let payload = new _serviceProto.GetState();
payload.setKey(key);
let msg = {
type: _serviceProto.ChaincodeMessage.Type.GET_STATE,
payload: Buffer.from(key),
payload: payload.toBuffer(),
txid: txId
};
logger.debug('handleGetState - with key:',key);
return await this._askPeerAndListen(msg, 'GetState');

@@ -375,3 +378,3 @@ }

async handlePutState(key, value, txId) {
let payload = new _serviceProto.PutStateInfo();
let payload = new _serviceProto.PutState();
payload.setKey(key);

@@ -390,5 +393,8 @@ payload.setValue(value);

async handleDeleteState(key, txId) {
let payload = new _serviceProto.DelState();
payload.setKey(key);
let msg = {
type: _serviceProto.ChaincodeMessage.Type.DEL_STATE,
payload: Buffer.from(key),
payload: payload.toBuffer(),
txid: txId

@@ -492,3 +498,3 @@ };

* response.
*
*
* @param {string} msg the message to send to the peer

@@ -599,3 +605,3 @@ * @param {string} method the name of the method being called

* function to create a new Stub, this is done to facilitate unit testing
*
*
* @param {Handler} client an instance of the Handler class

@@ -602,0 +608,0 @@ * @param {string} txid transaction id

@@ -360,2 +360,3 @@ /*

async getState(key) {
logger.debug('getState called with key:%s',key);
return await this.handler.handleGetState(key, this.txId);

@@ -505,3 +506,3 @@ }

* Creates a composite key by combining the objectType string and the given `attributes` to form a composite
* key. The objectType and attributes are expected to have only valid utf8 strings and should not contain
* key. The objectType and attributes are expected to have only valid utf8 strings and should not contain
* U+0000 (nil byte) and U+10FFFF (biggest and unallocated code point). The resulting composite key can be

@@ -587,3 +588,1 @@ * used as the key in [putState()]{@link ChaincodeStub#putState}.<br><br>

module.exports.RESPONSE_CODE = RESPONSE_CODE;
{
"name": "fabric-shim",
"version": "1.0.0-snapshot.26",
"version": "1.0.0-snapshot.27",
"description": "A node.js implementation of Hyperledger Fabric chaincode shim, to allow endorsing peers and user-provided chaincodes to communicate with each other",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc