Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let privateKeys = commandOption.privateKeys;
let creatorAccountId = commandOption.creatorAccountId;
let quorum = commandOption.quorum;
let txClient = commandOption.commandService;
let timeoutLimit = commandOption.timeoutLimit;
let txToSends = [];
for (let i = 0; i < commands.length; i++) {
let commandArg = commands[i];
let tx = txHelper.addCommand(txHelper.emptyTransaction(), commandArg.fn, commandArg.args);
let txToSend = txHelper.addMeta(tx,{
creatorAccountId: creatorAccountId,
quorum: quorum
});
txToSend = irohaUtil.signWithArrayOfKeys(txToSend, privateKeys);
txToSends.push(txToSend);
}
let hashes = await sendTransactions(txToSends,txClient,timeoutLimit);// batch mode
let results = await getTxStatus(hashes,txClient,timeoutLimit);
return Promise.resolve(results);
}
catch(err) {
logger.error(err);
return Promise.reject('Failed to submit Iroha transaction');
}
}