Skip to content

Commit 6b492b3

Browse files
author
Micah Riggan
committed
Fixing test
1 parent 18ffda1 commit 6b492b3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/bitcore-node/src/models/coin.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export enum SpentHeightIndicators {
3838
/**
3939
* The coin was minted by a transaction which can no longer confirm.
4040
*/
41-
conflicting = -3,
41+
conflicting = -3
4242
}
4343

4444
@LoggifyClass
@@ -76,7 +76,10 @@ class Coin extends BaseModel<ICoin> {
7676

7777
getBalance(params: { query: any }) {
7878
let { query } = params;
79-
query = Object.assign(query, { spentHeight: { $lt: SpentHeightIndicators.minimum }, mintHeight: { $gt: SpentHeightIndicators.conflicting } });
79+
query = Object.assign(query, {
80+
spentHeight: { $lt: SpentHeightIndicators.minimum },
81+
mintHeight: { $gt: SpentHeightIndicators.conflicting }
82+
});
8083
return this.collection
8184
.aggregate<{ balance: number }>([
8285
{ $match: query },

packages/bitcore-node/test/unit/models/coin.unit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe('Coin Model', function() {
6868
spentHeight: SpentHeightIndicators.unspent,
6969
address: 'n1ojJtS98D2VRLcTkaHH4YXLG4ytCyS7AL',
7070
coinbase: true,
71+
confirmations: undefined,
7172
script: coin.script,
7273
value: 5000000000.0
7374
});

0 commit comments

Comments
 (0)