diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-02 20:33:01 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-02 20:33:01 +0530 |
commit | ef0acf06bfb7820a21c4719dba0d659f600be3c7 (patch) | |
tree | 216d34722240f682e5ee58632947fa75e9b4fcee /src/crypto/workers/cryptoImplementation.ts | |
parent | 1728e5011e16f226c6e3675aa196872af39f6c4e (diff) | |
download | wallet-core-ef0acf06bfb7820a21c4719dba0d659f600be3c7.tar.gz wallet-core-ef0acf06bfb7820a21c4719dba0d659f600be3c7.tar.bz2 wallet-core-ef0acf06bfb7820a21c4719dba0d659f600be3c7.zip |
model reserve history in the exchange, improve reserve handling logic
Diffstat (limited to 'src/crypto/workers/cryptoImplementation.ts')
-rw-r--r-- | src/crypto/workers/cryptoImplementation.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/crypto/workers/cryptoImplementation.ts b/src/crypto/workers/cryptoImplementation.ts index 156c72ba0..eef8f5955 100644 --- a/src/crypto/workers/cryptoImplementation.ts +++ b/src/crypto/workers/cryptoImplementation.ts @@ -49,8 +49,7 @@ import { PlanchetCreationRequest, DepositInfo, } from "../../types/walletTypes"; -import { AmountJson } from "../../util/amounts"; -import * as Amounts from "../../util/amounts"; +import { AmountJson, Amounts } from "../../util/amounts"; import * as timer from "../../util/timer"; import { encodeCrock, @@ -199,6 +198,7 @@ export class CryptoImplementation { denomPubHash: encodeCrock(denomPubHash), reservePub: encodeCrock(reservePub), withdrawSig: encodeCrock(sig), + coinEvHash: encodeCrock(evHash), }; return planchet; } @@ -367,7 +367,7 @@ export class CryptoImplementation { const s: CoinDepositPermission = { coin_pub: depositInfo.coinPub, coin_sig: encodeCrock(coinSig), - contribution: Amounts.toString(depositInfo.spendAmount), + contribution: Amounts.stringify(depositInfo.spendAmount), denom_pub: depositInfo.denomPub, exchange_url: depositInfo.exchangeBaseUrl, ub_sig: depositInfo.denomSig, @@ -491,10 +491,10 @@ export class CryptoImplementation { } /** - * Hash a denomination public key. + * Hash a crockford encoded value. */ - hashDenomPub(denomPub: string): string { - return encodeCrock(hash(decodeCrock(denomPub))); + hashEncoded(encodedBytes: string): string { + return encodeCrock(hash(decodeCrock(encodedBytes))); } signCoinLink( |