1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-12-29 08:07:51 +01:00

changed forEach method

This commit is contained in:
amed83 2018-06-05 15:14:15 +02:00
parent 9163284b4a
commit 5993c4cd6b

View File

@ -228,11 +228,12 @@ export default class Transaction {
*/
static signTransaction(transaction, ...privateKeys) {
const signedTx = clone(transaction)
const serializedTransaction =
Transaction.serializeTransactionIntoCanonicalString(transaction)
signedTx.inputs.forEach((input, index) => {
const privateKey = privateKeys[index]
const privateKeyBuffer = Buffer.from(base58.decode(privateKey))
const serializedTransaction =
Transaction.serializeTransactionIntoCanonicalString(transaction)
const transactionUniqueFulfillment = input.fulfills ? serializedTransaction
.concat(input.fulfills.transaction_id)
@ -245,9 +246,9 @@ export default class Transaction {
input.fulfillment = fulfillmentUri
})
const serializedTransaction =
const serializedSecondTransaction =
Transaction.serializeTransactionIntoCanonicalString(signedTx)
signedTx.id = sha256Hash(serializedTransaction)
signedTx.id = sha256Hash(serializedSecondTransaction)
return signedTx
}
}