Open
Description
Currently the signTransaction()
method uses rest parameters to get an array of private keys to be used for signing transaction inputs.
The method expects a corresponding private key for every transaction input at the same array index. However, since the rest parameter collects unassigned parameters into an array, it is not possible to dynamically/programatically set the number of private keys passed to the method.
https://github.com/bigchaindb/js-bigchaindb-driver/blob/master/src/transaction.js#L239
static signTransaction(transaction, ...privateKeys) {
...
signedTx.inputs.forEach((input, index) => {
const privateKey = privateKeys[index]
...
}
}
Suggested improvement would be to support passing an array of private keys, as well as defaulting to using only the first private key, if only one is passed, to sign all inputs.
Metadata
Metadata
Assignees
Labels
No labels