Skip to content

Commit

Permalink
Fix benchmark drm
Browse files Browse the repository at this point in the history
Signed-off-by: jiangyaoguo <[email protected]>
  • Loading branch information
jiangyaoguo committed Jul 30, 2018
1 parent f0d2666 commit edd8649
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion benchmark/composer/composer-micro/query-asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ module.exports.run = function() {
});
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ module.exports.run = function() {
return bc.bcObj.submitTransaction(busNetConnections.get('admin'), transaction);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
2 changes: 1 addition & 1 deletion benchmark/composer/composer-samples/bond-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ module.exports.run = function() {
return bc.bcObj.submitTransaction(busNetConnection, transaction);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ module.exports.run = function() {
return bc.bcObj.submitTransaction(busNetConnection, transaction);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
2 changes: 1 addition & 1 deletion benchmark/composer/composer-samples/marbles-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ module.exports.run = function() {
return bc.bcObj.submitTransaction(busNetConnection, transaction);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
2 changes: 1 addition & 1 deletion benchmark/composer/composer-samples/perishable-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@ module.exports.run = function() {
return bc.bcObj.submitTransaction(busNetConnection, transaction);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ module.exports.run = function() {
return bc.bcObj.submitTransaction(busNetConnection, transaction);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve(true);
};
21 changes: 12 additions & 9 deletions benchmark/drm/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,27 @@ module.exports.run = function() {
'info' : '',
'item' : buf
};
return bc.invokeSmartContract(contx, 'drm', 'v0', {verb : 'publish', item: JSON.stringify(item)}, 120);
return bc.invokeSmartContract(contx, 'drm', 'v0', {verb : 'publish', item: JSON.stringify(item)}, 120)
.then((results)=>{
for (let i in results){
let stat = results[i];
if(stat.IsCommitted()) {
ids.push(stat.GetResult().toString());
}
}
return Promise.resolve(results);
});
};

module.exports.end = function(results) {
for (let i in results){
let stat = results[i];
if(stat.IsCommitted()) {
ids.push(stat.result.toString());
}
}
module.exports.end = function() {
return Promise.resolve();
};
/**********************
* save published items' identity
**********************/
/*var idfile = './tmp/ids.log'
var fs = require('fs');
module.exports.end = function(results) {
module.exports.end = function() {
for (let i in results){
let stat = results[i];
if(stat.status === 'success') {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/drm/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ module.exports.run = function() {
return bc.queryState(contx, 'drm', 'v0', id);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve();
};
2 changes: 1 addition & 1 deletion benchmark/marbles/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ module.exports.run = function() {
}, 30);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve();
};
2 changes: 1 addition & 1 deletion benchmark/marbles/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ module.exports.run = function() {
}, 120);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve();
};
2 changes: 1 addition & 1 deletion benchmark/simple/open.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports.run = function() {
return bc.invokeSmartContract(contx, 'simple', 'v0', {verb: 'open', account: newAcc, money: initMoney}, 30);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve();
};

Expand Down
2 changes: 1 addition & 1 deletion benchmark/simple/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports.run = function() {
return bc.queryState(contx, 'simple', 'v0', acc);
};

module.exports.end = function(results) {
module.exports.end = function() {
// do nothing
return Promise.resolve();
};
2 changes: 1 addition & 1 deletion benchmark/smallbank/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports.run = function() {
return bc.queryState(contx, 'smallbank', 'v0', acc_num);
};

module.exports.end = function(results) {
module.exports.end = function() {
// do nothing
return Promise.resolve();
};
2 changes: 1 addition & 1 deletion benchmark/smallbank/smallbankOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module.exports.run = function() {
return bc.invokeSmartContract(contx, 'smallbank', '1.0', args, 30);
};

module.exports.end = function(results) {
module.exports.end = function() {
return Promise.resolve();
};

Expand Down
2 changes: 1 addition & 1 deletion src/comm/client/local-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function doTest(msg) {
}
}).then(() => {
clearUpdateInter();
return cb.end(results);
return cb.end();
}).then(() => {
if (resultStats.length > 0) {
return Promise.resolve(resultStats[0]);
Expand Down

0 comments on commit edd8649

Please sign in to comment.