Skip to content

Commit

Permalink
[FABN-923] remove async for generateUnsignedTransaction
Browse files Browse the repository at this point in the history
generateUnsignedTransaction should be a sync method

Change-Id: Ia27811817440a2c37af242c111515cd33ef66540
Signed-off-by: zhaochy <[email protected]>
  • Loading branch information
zhaochy1990 committed Sep 18, 2018
1 parent e222a83 commit 945348f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions fabric-client/lib/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ const Channel = class {
this._endorsement_handler = null; //will be setup during initialization
this._commit_handler = null;



logger.debug('Constructed Channel instance: name - %s, network mode: %s', this._name, !this._devMode);
}

Expand Down Expand Up @@ -2888,9 +2886,6 @@ const Channel = class {
if (!Array.isArray(request.args)) {
errorMsg = 'Param "args" in Transaction proposal request should be a string array';
}
if (!request.channelId) {
errorMsg = 'Missing Required param "channelId" in Transaction proposal';
}

if (errorMsg) {
logger.error('%s error %s', method, errorMsg);
Expand Down Expand Up @@ -2921,7 +2916,7 @@ const Channel = class {

const channelHeader = client_utils.buildChannelHeader(
_commonProto.HeaderType.ENDORSER_TRANSACTION,
request.channelId,
this._name,
txId.getTransactionID(),
null,
request.chaincodeId,
Expand Down Expand Up @@ -2968,7 +2963,7 @@ const Channel = class {
*
* @param {TransactionRequest} request
*/
async generateUnsignedTransaction(request) {
generateUnsignedTransaction(request) {
logger.debug('generateUnsignedTransaction - start :: channel %s', this._name);

if (!request) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/signTransactionOffline.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ test('Test sign a contract with a private key offline', async (t) => {
proposal,
};

const commitProposal = await channel.generateUnsignedTransaction(commitReq);
const commitProposal = channel.generateUnsignedTransaction(commitReq);
t.pass('Successfully build commit transaction proposal');

// sign this commit proposal at local
Expand Down

0 comments on commit 945348f

Please sign in to comment.