diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-11-21 23:09:43 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-11-21 23:09:43 +0100 |
commit | c6233094306cd264f8faa2041388dff01ff8cf01 (patch) | |
tree | f3ee839a4254c528058887c6517a76bec8919b15 /src/crypto/cryptoApi-test.ts | |
parent | e8f362ccfea683fe16ce68b956f068ffa0b001b1 (diff) | |
download | wallet-core-c6233094306cd264f8faa2041388dff01ff8cf01.tar.xz |
WIP: simplification and error handling
Diffstat (limited to 'src/crypto/cryptoApi-test.ts')
-rw-r--r-- | src/crypto/cryptoApi-test.ts | 23 |
1 files changed, 12 insertions, 11 deletions
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); |