From ef0acf06bfb7820a21c4719dba0d659f600be3c7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 2 Apr 2020 20:33:01 +0530 Subject: model reserve history in the exchange, improve reserve handling logic --- src/types/types-test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/types/types-test.ts') diff --git a/src/types/types-test.ts b/src/types/types-test.ts index 885371a1a..ce3092497 100644 --- a/src/types/types-test.ts +++ b/src/types/types-test.ts @@ -15,14 +15,14 @@ */ import test from "ava"; -import * as Amounts from "../util/amounts"; -import { ContractTerms, codecForContractTerms } from "./talerTypes"; +import { Amounts, AmountJson } from "../util/amounts"; +import { codecForContractTerms } from "./talerTypes"; const amt = ( value: number, fraction: number, currency: string, -): Amounts.AmountJson => ({ value, fraction, currency }); +): AmountJson => ({ value, fraction, currency }); test("amount addition (simple)", (t) => { const a1 = amt(1, 0, "EUR"); @@ -118,13 +118,13 @@ test("amount parsing", (t) => { }); test("amount stringification", (t) => { - t.is(Amounts.toString(amt(0, 0, "TESTKUDOS")), "TESTKUDOS:0"); - t.is(Amounts.toString(amt(4, 94000000, "TESTKUDOS")), "TESTKUDOS:4.94"); - t.is(Amounts.toString(amt(0, 10000000, "TESTKUDOS")), "TESTKUDOS:0.1"); - t.is(Amounts.toString(amt(0, 1, "TESTKUDOS")), "TESTKUDOS:0.00000001"); - t.is(Amounts.toString(amt(5, 0, "TESTKUDOS")), "TESTKUDOS:5"); + t.is(Amounts.stringify(amt(0, 0, "TESTKUDOS")), "TESTKUDOS:0"); + t.is(Amounts.stringify(amt(4, 94000000, "TESTKUDOS")), "TESTKUDOS:4.94"); + t.is(Amounts.stringify(amt(0, 10000000, "TESTKUDOS")), "TESTKUDOS:0.1"); + t.is(Amounts.stringify(amt(0, 1, "TESTKUDOS")), "TESTKUDOS:0.00000001"); + t.is(Amounts.stringify(amt(5, 0, "TESTKUDOS")), "TESTKUDOS:5"); // denormalized - t.is(Amounts.toString(amt(1, 100000000, "TESTKUDOS")), "TESTKUDOS:2"); + t.is(Amounts.stringify(amt(1, 100000000, "TESTKUDOS")), "TESTKUDOS:2"); t.pass(); }); -- cgit v1.2.3