Class: BlockDecoder

BlockDecoder

Utility class to convert a protobuf encoded byte array of a Hyperledger Fabric block message into a pure Javascript object

new BlockDecoder()

Methods


<static> decode(block_bytes)

Constructs a JSON object containing all decoded values from the protobuf encoded `Block` bytes.
Parameters:
Name Type Description
block_bytes Array.<byte> The encoded bytes of a Block protobuf message
Returns:
An object of the Block
Type
Block

<static> decodeBlock(block_data)

Constructs an object containing all decoded values from the protobuf encoded `Block` object
Parameters:
Name Type Description
block_data Object an object that represents the protobuf common.Block
Returns:
An object of the fully decoded protobuf common.Block
Type
Block

<static> decodeTransaction(processed_transaction_bytes)

Constructs an object containing all decoded values from the protobuf encoded "ProcessedTransaction" bytes
Parameters:
Name Type Description
processed_transaction_bytes Array.<byte> The encode bytes of a protobuf message "ProcessedTransaction"
Returns:
A fully decoded ProcessedTransaction object
Type
ProcessedTransaction