From 4101bc0f53df0c6ed32f6710d24a1b8b26777bb9 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 20 Dec 2015 21:38:41 +0100 Subject: [PATCH] Fix embarassingly wrong constant --- extension/background/emscriptif.js | 1 - extension/background/emscriptif.ts | 1 - extension/background/wallet.js | 7 ++----- extension/background/wallet.ts | 7 ++----- extension/lib/commonHelpers.js | 4 ++-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/extension/background/emscriptif.js b/extension/background/emscriptif.js index c12c41416..d1e92df4b 100644 --- a/extension/background/emscriptif.js +++ b/extension/background/emscriptif.js @@ -325,7 +325,6 @@ function mixinStatic(obj, method, name) { if (!name) { throw Error("Mixin needs a name."); } - console.log("mixing in", name, "into", obj.name); obj[method.name] = method; } class EddsaPublicKey extends PackedArenaObject { diff --git a/extension/background/emscriptif.ts b/extension/background/emscriptif.ts index 2648b5964..73b5d1acd 100644 --- a/extension/background/emscriptif.ts +++ b/extension/background/emscriptif.ts @@ -492,7 +492,6 @@ function mixinStatic(obj, method, name?: string) { if (!name) { throw Error("Mixin needs a name."); } - console.log("mixing in", name, "into", obj.name); obj[method.name] = method; } diff --git a/extension/background/wallet.js b/extension/background/wallet.js index 2c8c11f33..c4216c4de 100644 --- a/extension/background/wallet.js +++ b/extension/background/wallet.js @@ -433,6 +433,7 @@ function depleteReserve(db, reserve, mint) { workList.push(d); } if (!found) { + console.log("did not find coins for remaining ", remaining.toJson()); break; } } @@ -441,7 +442,6 @@ function depleteReserve(db, reserve, mint) { if (workList.length == 0) { return; } - console.log("doing work"); let d = workList.pop(); withdraw(db, d, reserve) .then(() => next()); @@ -578,25 +578,22 @@ function balances(db, detail, sendResponse) { if (cursor) { tx.objectStore('denoms').get(cursor.value.denomPub).onsuccess = (e2) => { let d = e2.target.result; - console.log("got denom", JSON.stringify(d)); let acc = byCurrency[d.value.currency]; if (!acc) { acc = new Amount(d.value); - console.log("initial:", JSON.stringify(acc.toJson())); byCurrency[d.value.currency] = acc.toJson(); } else { let am = new Amount(acc); am.add(new Amount(d.value)); byCurrency[d.value.currency] = am.toJson(); - console.log("then:", JSON.stringify(am.toJson())); } + console.log("counting", byCurrency[d.value.currency]); }; cursor.continue(); } else { sendResponse(byCurrency); - console.log("response", JSON.stringify(byCurrency)); } }; return true; diff --git a/extension/background/wallet.ts b/extension/background/wallet.ts index bda4da30d..e4c1d557c 100644 --- a/extension/background/wallet.ts +++ b/extension/background/wallet.ts @@ -575,6 +575,7 @@ function depleteReserve(db, reserve, mint) { workList.push(d); } if (!found) { + console.log("did not find coins for remaining ", remaining.toJson()); break; } } @@ -584,7 +585,6 @@ function depleteReserve(db, reserve, mint) { if (workList.length == 0) { return; } - console.log("doing work"); let d = workList.pop(); withdraw(db, d, reserve) .then(() => next()); @@ -731,23 +731,20 @@ function balances(db, detail, sendResponse) { if (cursor) { tx.objectStore('denoms').get(cursor.value.denomPub).onsuccess = (e2) => { let d = e2.target.result; - console.log("got denom", JSON.stringify(d)); let acc = byCurrency[d.value.currency]; if (!acc) { acc = new Amount(d.value); - console.log("initial:", JSON.stringify(acc.toJson())); byCurrency[d.value.currency] = acc.toJson(); } else { let am = new Amount(acc); am.add(new Amount(d.value)); byCurrency[d.value.currency] = am.toJson(); - console.log("then:", JSON.stringify(am.toJson())); } + console.log("counting", byCurrency[d.value.currency]); }; cursor.continue(); } else { sendResponse(byCurrency); - console.log("response", JSON.stringify(byCurrency)); } }; return true; diff --git a/extension/lib/commonHelpers.js b/extension/lib/commonHelpers.js index 95faf1112..0ba88e9c5 100644 --- a/extension/lib/commonHelpers.js +++ b/extension/lib/commonHelpers.js @@ -1,12 +1,12 @@ "use strict"; Handlebars.registerHelper('prettyAmount', function (amount) { - let v = amount.value + amount.fraction / 10e6; + let v = amount.value + amount.fraction / 1e6; return v.toFixed(2) + " " + amount.currency; }); Handlebars.registerHelper('prettyAmountNoCurrency', function (amount) { - let v = amount.value + amount.fraction / 10e6; + let v = amount.value + amount.fraction / 1e6; return v.toFixed(2); });