Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Merge #2167
Browse files Browse the repository at this point in the history
2167: Log over and underfunded amounts r=mergify[bot] a=thomaseizinger

Found this while debugging a test failure.

We now log the amounts to help debugging.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
  • Loading branch information
bors[bot] and thomaseizinger authored Mar 5, 2020
2 parents c1ce7e4 + b5c0d6b commit e00f696
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions api_tests/lib/actors/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,18 @@ export class Actor {
}
);
const amount = response.data.payload.amount;
response.data.payload.amount = amount * 1.01;
const overfundAmount = amount * 1.01;

response.data.payload.amount = overfundAmount;

const txid = await this.swap.doLedgerAction(response.data);
this.logger.debug("Overfunded swap %s in %s", this.swap.self, txid);
this.logger.debug(
"Overfunded swap %s in %s with %d instead of %d",
this.swap.self,
txid,
overfundAmount,
amount
);
}

public async underfund() {
Expand All @@ -369,10 +377,18 @@ export class Actor {
}
);
const amount = response.data.payload.amount;
response.data.payload.amount = amount * 0.01;
const underfundAmount = amount * 0.01;

response.data.payload.amount = underfundAmount;

const txid = await this.swap.doLedgerAction(response.data);
this.logger.debug("Underfunded swap %s in %s", this.swap.self, txid);
this.logger.debug(
"Underfunded swap %s in %s with %d instead of %d",
this.swap.self,
txid,
underfundAmount,
amount
);
}

public async refund() {
Expand Down

0 comments on commit e00f696

Please sign in to comment.