From c6233094306cd264f8faa2041388dff01ff8cf01 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 21 Nov 2019 23:09:43 +0100 Subject: WIP: simplification and error handling --- src/crypto/cryptoApi-test.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/crypto/cryptoApi-test.ts') diff --git a/src/crypto/cryptoApi-test.ts b/src/crypto/cryptoApi-test.ts index 39f46c5c3..d9d42081c 100644 --- a/src/crypto/cryptoApi-test.ts +++ b/src/crypto/cryptoApi-test.ts @@ -22,6 +22,7 @@ import { DenominationRecord, DenominationStatus, ReserveRecord, + ReserveRecordStatus, } from "../dbTypes"; import { CryptoApi } from "./cryptoApi"; @@ -86,18 +87,18 @@ test("precoin creation", async t => { const crypto = new CryptoApi(new NodeCryptoWorkerFactory()); const { priv, pub } = await crypto.createEddsaKeypair(); const r: ReserveRecord = { - created: 0, - current_amount: null, - exchange_base_url: "https://example.com/exchange", + created: { t_ms: 0 }, + currentAmount: null, + exchangeBaseUrl: "https://example.com/exchange", hasPayback: false, - precoin_amount: { currency: "PUDOS", value: 0, fraction: 0 }, - requested_amount: { currency: "PUDOS", value: 0, fraction: 0 }, - reserve_priv: priv, - reserve_pub: pub, - timestamp_confirmed: 0, - timestamp_depleted: 0, - timestamp_reserve_info_posted: 0, - exchangeWire: "payto://foo" + precoinAmount: { currency: "PUDOS", value: 0, fraction: 0 }, + requestedAmount: { currency: "PUDOS", value: 0, fraction: 0 }, + reservePriv: priv, + reservePub: pub, + timestampConfirmed: undefined, + timestampReserveInfoPosted: undefined, + exchangeWire: "payto://foo", + reserveStatus: ReserveRecordStatus.UNCONFIRMED, }; const precoin = await crypto.createPreCoin(denomValid1, r); -- cgit v1.2.3