diff --git a/src/transaction.js b/src/transaction.js index e34a871..311b057 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -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) } diff --git a/test/transaction/test_transaction.js b/test/transaction/test_transaction.js index 7df6e16..ba819c4 100644 --- a/test/transaction/test_transaction.js +++ b/test/transaction/test_transaction.js @@ -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() })