Skip to content

Commit

Permalink
final fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaether committed Aug 20, 2018
1 parent 63247bf commit 70ee5cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/TimeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class TimeNode {

for (const account of accounts) {
const stats = this.config.statsDb.getStats().find((stat: any) => stat.account === account);
unsuccessfulClaims[account] = stats.failedClaims;
unsuccessfulClaims[account] = stats.failedClaims ? stats.failedClaims : [];
}

return unsuccessfulClaims;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/UnitTestTimeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('TimeNode Unit Tests', () => {
describe('getClaimedNotExecutedTransactions()', () => {
it('returns 0 when no transactions', () => {
const txs = timenode.getClaimedNotExecutedTransactions()[myAccount];
assert.equal(txs[0].length, 0);
assert.equal(txs.length, 0);
});

it('returns a transaction', () => {
Expand All @@ -79,7 +79,7 @@ describe('TimeNode Unit Tests', () => {
config.cache.set('tx', tx);

const txs = timenode.getClaimedNotExecutedTransactions()[myAccount];
assert.equal(txs[0].length, 1);
assert.equal(txs.length, 1);
});
});

Expand Down

0 comments on commit 70ee5cc

Please sign in to comment.