aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2015-12-20 21:38:41 +0100
committerFlorian Dold <florian.dold@gmail.com>2015-12-20 21:38:41 +0100
commit4101bc0f53df0c6ed32f6710d24a1b8b26777bb9 (patch)
tree254204fd74f31015c7554b1c1d7d127e35ce5ada
parent604cb2f80473c23f76afd37670a1a7249ae170a3 (diff)
downloadwallet-core-4101bc0f53df0c6ed32f6710d24a1b8b26777bb9.tar.xz
Fix embarassingly wrong constant
-rw-r--r--extension/background/emscriptif.js1
-rw-r--r--extension/background/emscriptif.ts1
-rw-r--r--extension/background/wallet.js7
-rw-r--r--extension/background/wallet.ts7
-rw-r--r--extension/lib/commonHelpers.js4
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);
});