mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-11-22 01:36:56 +01:00
test failing
This commit is contained in:
parent
3725afa4a0
commit
843d85bc03
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user