contract/lib/ResponseModel.js
/**
     * Used to translate the response from Fabric Ledger that was encapsulated before.
     * The response from Fabric Ledger as JSON model looks like 
     *   {"type":"Buffer","data":[byte array]}
     * @param {JSON} txResponseObject The response from Fabric Ledger as JSON
     */
Used to translate the response from Fabric Ledger that was encapsulated before.
Used to translate the response from Fabric Ledger that was encapsulated before .
static translateLedgerResponse(txResponseObject){
        let objTxRetrieve = JSON.parse(txResponseObject);
        let byteArray = objTxRetrieve.data;
        let bufferWithJson = Buffer.from(byteArray);
        let asString = bufferWithJson.toString();
        logWrite(`[translateLedgerResponse] ${asString}`);
        let prototypeResponse = JSON.parse(asString);
        var responseObject = ResponseModel.createResponseModel(prototypeResponse);
        return responseObject;
    }
static translateLedgerResponse ( txResponseObject ) { let objTxRetrieve = JSON . parse ( txResponseObject ) ; let byteArray = objTxRetrieve . data ; let bufferWithJson = Buffer . from ( byteArray ) ; let asString = bufferWithJson . toString ( ) ; logWrite ( ` ${ asString } ` ) ; let prototypeResponse = JSON . parse ( asString ) ; var responseObject = ResponseModel . createResponseModel ( prototypeResponse ) ; return responseObject ; }
Used to translate the response from Fabric Ledger that was encapsulated before.
Used to translate the response from Fabric Ledger that was encapsulated before .
// logWrite(`[translateLedgerResponse] ${txResponseObject}`); // logWrite(`[translateLedgerResponse] ${byteArray}`);