Fix embarassingly wrong constant

This commit is contained in:
Florian Dold 2015-12-20 21:38:41 +01:00
parent 604cb2f804
commit 4101bc0f53
5 changed files with 6 additions and 14 deletions

View File

@ -325,7 +325,6 @@ function mixinStatic(obj, method, name) {
if (!name) { if (!name) {
throw Error("Mixin needs a name."); throw Error("Mixin needs a name.");
} }
console.log("mixing in", name, "into", obj.name);
obj[method.name] = method; obj[method.name] = method;
} }
class EddsaPublicKey extends PackedArenaObject { class EddsaPublicKey extends PackedArenaObject {

View File

@ -492,7 +492,6 @@ function mixinStatic(obj, method, name?: string) {
if (!name) { if (!name) {
throw Error("Mixin needs a name."); throw Error("Mixin needs a name.");
} }
console.log("mixing in", name, "into", obj.name);
obj[method.name] = method; obj[method.name] = method;
} }

View File

@ -433,6 +433,7 @@ function depleteReserve(db, reserve, mint) {
workList.push(d); workList.push(d);
} }
if (!found) { if (!found) {
console.log("did not find coins for remaining ", remaining.toJson());
break; break;
} }
} }
@ -441,7 +442,6 @@ function depleteReserve(db, reserve, mint) {
if (workList.length == 0) { if (workList.length == 0) {
return; return;
} }
console.log("doing work");
let d = workList.pop(); let d = workList.pop();
withdraw(db, d, reserve) withdraw(db, d, reserve)
.then(() => next()); .then(() => next());
@ -578,25 +578,22 @@ function balances(db, detail, sendResponse) {
if (cursor) { if (cursor) {
tx.objectStore('denoms').get(cursor.value.denomPub).onsuccess = (e2) => { tx.objectStore('denoms').get(cursor.value.denomPub).onsuccess = (e2) => {
let d = e2.target.result; let d = e2.target.result;
console.log("got denom", JSON.stringify(d));
let acc = byCurrency[d.value.currency]; let acc = byCurrency[d.value.currency];
if (!acc) { if (!acc) {
acc = new Amount(d.value); acc = new Amount(d.value);
console.log("initial:", JSON.stringify(acc.toJson()));
byCurrency[d.value.currency] = acc.toJson(); byCurrency[d.value.currency] = acc.toJson();
} }
else { else {
let am = new Amount(acc); let am = new Amount(acc);
am.add(new Amount(d.value)); am.add(new Amount(d.value));
byCurrency[d.value.currency] = am.toJson(); byCurrency[d.value.currency] = am.toJson();
console.log("then:", JSON.stringify(am.toJson()));
} }
console.log("counting", byCurrency[d.value.currency]);
}; };
cursor.continue(); cursor.continue();
} }
else { else {
sendResponse(byCurrency); sendResponse(byCurrency);
console.log("response", JSON.stringify(byCurrency));
} }
}; };
return true; return true;

View File

@ -575,6 +575,7 @@ function depleteReserve(db, reserve, mint) {
workList.push(d); workList.push(d);
} }
if (!found) { if (!found) {
console.log("did not find coins for remaining ", remaining.toJson());
break; break;
} }
} }
@ -584,7 +585,6 @@ function depleteReserve(db, reserve, mint) {
if (workList.length == 0) { if (workList.length == 0) {
return; return;
} }
console.log("doing work");
let d = workList.pop(); let d = workList.pop();
withdraw(db, d, reserve) withdraw(db, d, reserve)
.then(() => next()); .then(() => next());
@ -731,23 +731,20 @@ function balances(db, detail, sendResponse) {
if (cursor) { if (cursor) {
tx.objectStore('denoms').get(cursor.value.denomPub).onsuccess = (e2) => { tx.objectStore('denoms').get(cursor.value.denomPub).onsuccess = (e2) => {
let d = e2.target.result; let d = e2.target.result;
console.log("got denom", JSON.stringify(d));
let acc = byCurrency[d.value.currency]; let acc = byCurrency[d.value.currency];
if (!acc) { if (!acc) {
acc = new Amount(d.value); acc = new Amount(d.value);
console.log("initial:", JSON.stringify(acc.toJson()));
byCurrency[d.value.currency] = acc.toJson(); byCurrency[d.value.currency] = acc.toJson();
} else { } else {
let am = new Amount(acc); let am = new Amount(acc);
am.add(new Amount(d.value)); am.add(new Amount(d.value));
byCurrency[d.value.currency] = am.toJson(); byCurrency[d.value.currency] = am.toJson();
console.log("then:", JSON.stringify(am.toJson()));
} }
console.log("counting", byCurrency[d.value.currency]);
}; };
cursor.continue(); cursor.continue();
} else { } else {
sendResponse(byCurrency); sendResponse(byCurrency);
console.log("response", JSON.stringify(byCurrency));
} }
}; };
return true; return true;

View File

@ -1,12 +1,12 @@
"use strict"; "use strict";
Handlebars.registerHelper('prettyAmount', function (amount) { 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; return v.toFixed(2) + " " + amount.currency;
}); });
Handlebars.registerHelper('prettyAmountNoCurrency', function (amount) { Handlebars.registerHelper('prettyAmountNoCurrency', function (amount) {
let v = amount.value + amount.fraction / 10e6; let v = amount.value + amount.fraction / 1e6;
return v.toFixed(2); return v.toFixed(2);
}); });