Skip to content

Commit ac172ca

Browse files
committed
fix a test
1 parent 52a0165 commit ac172ca

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/wallet/transaction-pool.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import {
2-
InvalidSignatureException,
3-
InvalidTransactionException,
4-
} from '../errors';
51
import Transaction from './transaction';
62

73
export default class TransactionPool {
@@ -36,11 +32,13 @@ export default class TransactionPool {
3632
}, 0);
3733

3834
if (transaction.input.amount !== outputTotal) {
39-
throw new InvalidTransactionException(transaction.input.address);
35+
console.log(`Invalid transaction from ${transaction.input.address}.`);
36+
return false;
4037
}
4138

4239
if (!Transaction.verifyTransaction(transaction)) {
43-
throw new InvalidSignatureException(transaction.input.address);
40+
console.log(`Invalid signature from ${transaction.input.address}.`);
41+
return false;
4442
}
4543

4644
return transaction;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"noUnusedParameters": true,
1717
"noImplicitAny": true,
1818
"noImplicitThis": false,
19-
"strictNullChecks": false
19+
"strictNullChecks": false,
20+
"esModuleInterop": true
2021
},
2122
"include": ["src/**/*", "__tests__/**/*"]
2223
}

wallaby.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = function(wallaby) {
22
return {
3-
files: ['tsconfig.json', 'src/**/*.ts?(x)', '!src/**/*.spec.ts?(x)'],
3+
files: ['tsconfig.json', 'src/**/*.ts?(x)', '!src/**/*.test.ts?(x)'],
44

55
tests: ['src/**/*.test.ts?(x)'],
66

0 commit comments

Comments
 (0)