Skip to content

Commit

Permalink
fix: set default color for Output and calcInput to 0 (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
troggy authored and johannbarbie committed Sep 6, 2019
1 parent 396f344 commit f6842ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class Output {
if (typeof valueOrObject === 'object' && !isBigInt(valueOrObject)) {
Util.ensureSafeValue(valueOrObject.value);
this.value = BigInt(valueOrObject.value);
this.color = valueOrObject.color;
this.color = valueOrObject.color || 0;
this.address = valueOrObject.address;

if (this.isNST()) {
Expand All @@ -38,7 +38,7 @@ export default class Output {
Util.ensureSafeValue(valueOrObject);
this.value = BigInt(valueOrObject);
this.address = address;
this.color = color;
this.color = color || 0;

if (this.isNST()) {
this.data = data;
Expand Down
2 changes: 1 addition & 1 deletion lib/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ export default class Transaction {
}
}

static calcInputs(unspent, from, amount, color) {
static calcInputs(unspent, from, amount, color = 0) {
const myUnspent = unspent.filter(
({ output }) =>
output.color === color &&
Expand Down

0 comments on commit f6842ad

Please sign in to comment.