mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2025-02-14 21:10:32 +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.inputs = inputs
|
||||||
tx.outputs = outputs
|
tx.outputs = outputs
|
||||||
|
|
||||||
// Hashing must be done after, as the hash is of the Transaction (up to now)
|
|
||||||
tx.id = Transaction.hashTransaction(tx)
|
tx.id = Transaction.hashTransaction(tx)
|
||||||
return tx
|
return tx
|
||||||
}
|
}
|
||||||
@ -227,7 +226,6 @@ export default class Transaction {
|
|||||||
'id': unspentOutputs[0].tx.operation === 'CREATE' ? unspentOutputs[0].tx.id
|
'id': unspentOutputs[0].tx.operation === 'CREATE' ? unspentOutputs[0].tx.id
|
||||||
: unspentOutputs[0].tx.asset.id
|
: unspentOutputs[0].tx.asset.id
|
||||||
}
|
}
|
||||||
|
|
||||||
return Transaction.makeTransaction('TRANSFER', assetLink, metadata, outputs, inputs)
|
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 => {
|
test('Create TRANSFER transaction based on CREATE transaction', t => {
|
||||||
sinon.spy(Transaction.makeTransaction, 'default')
|
sinon.spy(Transaction.makeTransaction)
|
||||||
|
|
||||||
Transaction.makeTransferTransaction(
|
Transaction.makeTransferTransaction(
|
||||||
[{ tx: createTx, output_index: 0 }],
|
[{ tx: createTx, output_index: 0 }],
|
||||||
[aliceOutput],
|
[aliceOutput],
|
||||||
@ -85,11 +84,10 @@ test('Create TRANSFER transaction based on CREATE transaction', t => {
|
|||||||
{ output_index: 0, transaction_id: createTx.id }
|
{ output_index: 0, transaction_id: createTx.id }
|
||||||
)]
|
)]
|
||||||
]
|
]
|
||||||
|
|
||||||
// NOTE: `src/transaction/makeTransaction` is `export default`, hence we
|
// NOTE: `src/transaction/makeTransaction` is `export default`, hence we
|
||||||
// can only mock `makeTransaction.default` with a hack:
|
// can only mock `makeTransaction.default` with a hack:
|
||||||
// See: https://stackoverflow.com/a/33676328/1263876
|
// See: https://stackoverflow.com/a/33676328/1263876
|
||||||
t.truthy(Transaction.makeTransaction.default.calledWith(...expected))
|
t.truthy(Transaction.makeTransaction.calledWith(...expected))
|
||||||
Transaction.makeTransaction.default.restore()
|
Transaction.makeTransaction.default.restore()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user