Skip to content

Commit

Permalink
[FAB-5321] NodeSDK - trans status missing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
harrisob committed Jul 14, 2017
1 parent 509b86a commit 24777e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fabric-client/lib/BlockDecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 24777e1

Please sign in to comment.