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) {
throw Error("Mixin needs a name.");
}
console.log("mixing in", name, "into", obj.name);
obj[method.name] = method;
}
class EddsaPublicKey extends PackedArenaObject {

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
});