aboutsummaryrefslogtreecommitdiff
path: root/src/wallet-test.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-05-15 23:23:49 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-05-15 23:23:49 +0530
commit6efc7e5600d3444e44697bc9c022d15990a98c50 (patch)
treeb42d0be1bb278fbbbe7a470c7b2a070f96d0c10b /src/wallet-test.ts
parent49f362ba6d3f3b99be1dba9ba1fe50fe49856d75 (diff)
fix issue with wire fee in coin selection that caused wrongly reported fees
Diffstat (limited to 'src/wallet-test.ts')
-rw-r--r--src/wallet-test.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wallet-test.ts b/src/wallet-test.ts
index 422523665..4b06accf2 100644
--- a/src/wallet-test.ts
+++ b/src/wallet-test.ts
@@ -43,7 +43,7 @@ test("coin selection 1", (t) => {
fakeAci("EUR:1.0", "EUR:0.0"),
];
- const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0.1"));
+ const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0"), a("EUR:0.1"));
if (!res) {
t.fail();
return;
@@ -59,7 +59,7 @@ test("coin selection 2", (t) => {
// Merchant covers the fee, this one shouldn't be used
fakeAci("EUR:1.0", "EUR:0.0"),
];
- const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0.5"));
+ const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0"), a("EUR:0.5"));
if (!res) {
t.fail();
return;
@@ -75,7 +75,7 @@ test("coin selection 3", (t) => {
// this coin should be selected instead of previous one with fee
fakeAci("EUR:1.0", "EUR:0.0"),
];
- const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0.5"));
+ const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0"), a("EUR:0.5"));
if (!res) {
t.fail();
return;
@@ -90,7 +90,7 @@ test("coin selection 4", (t) => {
fakeAci("EUR:1.0", "EUR:0.5"),
fakeAci("EUR:1.0", "EUR:0.5"),
];
- const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0.5"));
+ const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0"), a("EUR:0.5"));
if (!res) {
t.fail();
return;
@@ -105,7 +105,7 @@ test("coin selection 5", (t) => {
fakeAci("EUR:1.0", "EUR:0.5"),
fakeAci("EUR:1.0", "EUR:0.5"),
];
- const res = selectPayCoins(acis, a("EUR:4.0"), a("EUR:0.2"));
+ const res = selectPayCoins(acis, a("EUR:4.0"), a("EUR:0"), a("EUR:0.2"));
t.true(!res);
t.pass();
});
@@ -115,7 +115,7 @@ test("coin selection 6", (t) => {
fakeAci("EUR:1.0", "EUR:0.5"),
fakeAci("EUR:1.0", "EUR:0.5"),
];
- const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0.2"));
+ const res = selectPayCoins(acis, a("EUR:2.0"), a("EUR:0"), a("EUR:0.2"));
t.true(!res);
t.pass();
});