diff options
author | Florian Dold <florian@dold.me> | 2022-02-21 12:40:51 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-02-21 12:40:57 +0100 |
commit | 5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9 (patch) | |
tree | cd7e7500376f0b0ee560348e792ac4cbbb576925 /packages/taler-wallet-core/src/util/coinSelection.test.ts | |
parent | 606be7577be2bd249f19204d0c80b3b48e3065ca (diff) | |
download | wallet-core-5c93f15157b4fc9d0fefb6bb2a9956592ebb1ec9.tar.xz |
towards implementing breaking exchange protocol changes
Diffstat (limited to 'packages/taler-wallet-core/src/util/coinSelection.test.ts')
-rw-r--r-- | packages/taler-wallet-core/src/util/coinSelection.test.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/taler-wallet-core/src/util/coinSelection.test.ts b/packages/taler-wallet-core/src/util/coinSelection.test.ts index 49f8d1635..1675a9a35 100644 --- a/packages/taler-wallet-core/src/util/coinSelection.test.ts +++ b/packages/taler-wallet-core/src/util/coinSelection.test.ts @@ -18,7 +18,7 @@ * Imports. */ import test from "ava"; -import { AmountJson, Amounts } from "@gnu-taler/taler-util"; +import { AmountJson, Amounts, DenomKeyType } from "@gnu-taler/taler-util"; import { AvailableCoinInfo, selectPayCoins } from "./coinSelection.js"; function a(x: string): AmountJson { @@ -34,7 +34,7 @@ function fakeAci(current: string, feeDeposit: string): AvailableCoinInfo { availableAmount: a(current), coinPub: "foobar", denomPub: { - cipher: 1, + cipher: DenomKeyType.Rsa, rsa_public_key: "foobar", }, feeDeposit: a(feeDeposit), @@ -47,7 +47,7 @@ test("it should be able to pay if merchant takes the fees", (t) => { fakeAci("EUR:1.0", "EUR:0.1"), fakeAci("EUR:1.0", "EUR:0.0"), ]; - acis.forEach((x, i) => x.coinPub = String(i)); + acis.forEach((x, i) => (x.coinPub = String(i))); const res = selectPayCoins({ candidates: { @@ -75,7 +75,7 @@ test("it should take the last two coins if it pays less fees", (t) => { // Merchant covers the fee, this one shouldn't be used fakeAci("EUR:1.0", "EUR:0.0"), ]; - acis.forEach((x, i) => x.coinPub = String(i)); + acis.forEach((x, i) => (x.coinPub = String(i))); const res = selectPayCoins({ candidates: { @@ -102,8 +102,8 @@ test("it should take the last coins if the merchant doest not take all the fee", fakeAci("EUR:1.0", "EUR:0.5"), // this coin should be selected instead of previous one with fee fakeAci("EUR:1.0", "EUR:0.0"), - ] - acis.forEach((x, i) => x.coinPub = String(i)); + ]; + acis.forEach((x, i) => (x.coinPub = String(i))); const res = selectPayCoins({ candidates: { @@ -221,7 +221,7 @@ test("it should use the coins that spent less relative fee", (t) => { fakeAci("EUR:0.05", "EUR:0.05"), fakeAci("EUR:0.05", "EUR:0.05"), ]; - acis.forEach((x, i) => x.coinPub = String(i)); + acis.forEach((x, i) => (x.coinPub = String(i))); const res = selectPayCoins({ candidates: { |