From 24777e127b62b4e9c782e036fb5ee4105057b8f0 Mon Sep 17 00:00:00 2001 From: Bret Harrison Date: Fri, 14 Jul 2017 17:23:14 -0400 Subject: [PATCH] [FAB-5321] NodeSDK - trans status missing The queryBlock() api is missing the transaction filter status values. Allowed for multiple types during the decode based on the incoming block since the decode function is shared. Change-Id: Ibde42a298ba66b30c42f16760cf2b48511b042f9 Signed-off-by: Bret Harrison --- fabric-client/lib/BlockDecoder.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fabric-client/lib/BlockDecoder.js b/fabric-client/lib/BlockDecoder.js index f96a669290..66a824f9a4 100644 --- a/fabric-client/lib/BlockDecoder.js +++ b/fabric-client/lib/BlockDecoder.js @@ -589,8 +589,18 @@ function decodeBlockMetaData(proto_block_metadata) { function decodeTransactionFilter(metadata_bytes) { var transaction_filter = []; + if(!metadata_bytes) { + logger.debug('decodeTransactionFilter - no metadata'); + return null; + } + if(!(metadata_bytes instanceof Buffer)) { + metadata_bytes = metadata_bytes.toBuffer(); + } + logger.debug('decodeTransactionFilter - metadata length:%s',metadata_bytes.length); + for (let i = 0; i < metadata_bytes.length; i++) { let value = parseInt(metadata_bytes[i]); + logger.debug('decodeTransactionFilter - looking at index:%s with value:%s',i,value); transaction_filter.push(value); } return transaction_filter;