1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-12-27 23:27:50 +01:00

test failing

This commit is contained in:
manolodewiner 2018-01-15 18:11:16 +01:00
parent 3725afa4a0
commit 843d85bc03
2 changed files with 2 additions and 6 deletions

View File

@ -59,7 +59,6 @@ export default class Transaction {
tx.inputs = inputs
tx.outputs = outputs
// Hashing must be done after, as the hash is of the Transaction (up to now)
tx.id = Transaction.hashTransaction(tx)
return tx
}
@ -227,7 +226,6 @@ export default class Transaction {
'id': unspentOutputs[0].tx.operation === 'CREATE' ? unspentOutputs[0].tx.id
: unspentOutputs[0].tx.asset.id
}
return Transaction.makeTransaction('TRANSFER', assetLink, metadata, outputs, inputs)
}

View File

@ -68,8 +68,7 @@ test('makeOutput throws TypeError with incorrect amount type', t => {
test('Create TRANSFER transaction based on CREATE transaction', t => {
sinon.spy(Transaction.makeTransaction, 'default')
sinon.spy(Transaction.makeTransaction)
Transaction.makeTransferTransaction(
[{ tx: createTx, output_index: 0 }],
[aliceOutput],
@ -85,11 +84,10 @@ test('Create TRANSFER transaction based on CREATE transaction', t => {
{ output_index: 0, transaction_id: createTx.id }
)]
]
// NOTE: `src/transaction/makeTransaction` is `export default`, hence we
// can only mock `makeTransaction.default` with a hack:
// See: https://stackoverflow.com/a/33676328/1263876
t.truthy(Transaction.makeTransaction.default.calledWith(...expected))
t.truthy(Transaction.makeTransaction.calledWith(...expected))
Transaction.makeTransaction.default.restore()
})