diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-11-30 00:36:20 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-11-30 00:36:20 +0100 |
commit | aaf7e1338d6cdb1b4e01ad318938b3eaea2f922b (patch) | |
tree | 594129ccdf20757aeb86d434dd62c0c1e8259ed5 /src/crypto/cryptoApi.ts | |
parent | 809fa186448dbd924f258f89920b9336f1979bb0 (diff) | |
download | wallet-core-aaf7e1338d6cdb1b4e01ad318938b3eaea2f922b.tar.xz |
wallet robustness WIP
Diffstat (limited to 'src/crypto/cryptoApi.ts')
-rw-r--r-- | src/crypto/cryptoApi.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/crypto/cryptoApi.ts b/src/crypto/cryptoApi.ts index 46fe2576e..b5eae9beb 100644 --- a/src/crypto/cryptoApi.ts +++ b/src/crypto/cryptoApi.ts @@ -27,7 +27,7 @@ import { AmountJson } from "../amounts"; import { CoinRecord, DenominationRecord, - PreCoinRecord, + PlanchetRecord, RefreshSessionRecord, ReserveRecord, TipPlanchet, @@ -38,7 +38,7 @@ import { CryptoWorker } from "./cryptoWorker"; import { ContractTerms, PaybackRequest } from "../talerTypes"; -import { BenchmarkResult, CoinWithDenom, PayCoinInfo } from "../walletTypes"; +import { BenchmarkResult, CoinWithDenom, PayCoinInfo, PlanchetCreationResult } from "../walletTypes"; import * as timer from "../timer"; @@ -173,6 +173,7 @@ export class CryptoApi { */ wake(ws: WorkerState, work: WorkItem): void { if (this.stopped) { + console.log("cryptoApi is stopped"); CryptoApi.enableTracing && console.log("not waking, as cryptoApi is stopped"); return; } @@ -299,7 +300,6 @@ export class CryptoApi { priority: number, ...args: any[] ): Promise<T> { - CryptoApi.enableTracing && console.log("cryptoApi: doRpc called"); const p: Promise<T> = new Promise<T>((resolve, reject) => { const rpcId = this.nextRpcId++; const workItem: WorkItem = { @@ -332,16 +332,14 @@ export class CryptoApi { throw Error("assertion failed"); }); - return p.then((r: T) => { - return r; - }); + return p; } - createPreCoin( + createPlanchet( denom: DenominationRecord, reserve: ReserveRecord, - ): Promise<PreCoinRecord> { - return this.doRpc<PreCoinRecord>("createPreCoin", 1, denom, reserve); + ): Promise<PlanchetCreationResult> { + return this.doRpc<PlanchetCreationResult>("createPlanchet", 1, denom, reserve); } createTipPlanchet(denom: DenominationRecord): Promise<TipPlanchet> { |