diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-01-29 22:58:47 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-01-29 22:58:47 +0100 |
commit | 97f6e68ce3a515938228b9a4d3e41b5f4b25a015 (patch) | |
tree | 371331acc56b7c56abec502126c2a40cdb23a95f /src/types-test.ts | |
parent | 9fe6dc596573f38b13f0b15c946b8bc16013fdd9 (diff) | |
download | wallet-core-97f6e68ce3a515938228b9a4d3e41b5f4b25a015.tar.xz |
change protocol to string amount network format
Diffstat (limited to 'src/types-test.ts')
-rw-r--r-- | src/types-test.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/types-test.ts b/src/types-test.ts index 097235a77..d65daeade 100644 --- a/src/types-test.ts +++ b/src/types-test.ts @@ -54,14 +54,23 @@ test("amount subtraction (saturation)", (t) => { }); +test("amount parsing", (t) => { + const a1 = Amounts.parseOrThrow("TESTKUDOS:10"); + t.is(a1.currency, "TESTKUDOS"); + t.is(a1.value, 10); + t.is(a1.fraction, 0); + t.pass(); +}); + + test("contract terms validation", (t) => { const c = { H_wire: "123", - amount: amt(1, 2, "EUR"), + amount: "EUR:1.5", auditors: [], exchanges: [{master_pub: "foo", url: "foo"}], fulfillment_url: "foo", - max_fee: amt(1, 2, "EUR"), + max_fee: "EUR:1.5", merchant_pub: "12345", order_id: "test_order", pay_deadline: "Date(12346)", |