From 97f6e68ce3a515938228b9a4d3e41b5f4b25a015 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 29 Jan 2018 22:58:47 +0100 Subject: change protocol to string amount network format --- src/crypto/cryptoWorker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/crypto/cryptoWorker.ts') diff --git a/src/crypto/cryptoWorker.ts b/src/crypto/cryptoWorker.ts index 6b82f6bc2..88e30e55b 100644 --- a/src/crypto/cryptoWorker.ts +++ b/src/crypto/cryptoWorker.ts @@ -282,7 +282,7 @@ namespace RpcFunctions { const feeList: AmountJson[] = cds.map((x) => x.denom.feeDeposit); let fees = Amounts.add(Amounts.getZero(feeList[0].currency), ...feeList).amount; // okay if saturates - fees = Amounts.sub(fees, contractTerms.max_fee).amount; + fees = Amounts.sub(fees, Amounts.parseOrThrow(contractTerms.max_fee)).amount; const total = Amounts.add(fees, totalAmount).amount; const amountSpent = native.Amount.getZero(cds[0].coin.currentAmount.currency); @@ -335,7 +335,7 @@ namespace RpcFunctions { const s: CoinPaySig = { coin_pub: cd.coin.coinPub, coin_sig: coinSig, - contribution: coinSpend.toJson(), + contribution: Amounts.toString(coinSpend.toJson()), denom_pub: cd.coin.denomPub, exchange_url: cd.denom.exchangeBaseUrl, ub_sig: cd.coin.denomSig, -- cgit v1.2.3