bump DB
This commit is contained in:
parent
e3135213fc
commit
6169739525
@ -7,7 +7,7 @@ import { openDatabase, Database, Store, Index } from "./util/query";
|
|||||||
* with each major change. When incrementing the major version,
|
* with each major change. When incrementing the major version,
|
||||||
* the wallet should import data from the previous version.
|
* the wallet should import data from the previous version.
|
||||||
*/
|
*/
|
||||||
const TALER_DB_NAME = "taler-walletdb-v6";
|
const TALER_DB_NAME = "taler-walletdb-v7";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current database minor version, should be incremented
|
* Current database minor version, should be incremented
|
||||||
|
@ -78,11 +78,6 @@ export function getWithdrawDenomList(
|
|||||||
amountAvailable: AmountJson,
|
amountAvailable: AmountJson,
|
||||||
denoms: DenominationRecord[],
|
denoms: DenominationRecord[],
|
||||||
): DenominationSelectionInfo {
|
): DenominationSelectionInfo {
|
||||||
|
|
||||||
console.log("calling getWithdrawDenomList with");
|
|
||||||
console.log(JSON.stringify(amountAvailable, undefined, 2));
|
|
||||||
console.log(JSON.stringify(denoms, undefined, 2));
|
|
||||||
|
|
||||||
let remaining = Amounts.copy(amountAvailable);
|
let remaining = Amounts.copy(amountAvailable);
|
||||||
|
|
||||||
const selectedDenoms: {
|
const selectedDenoms: {
|
||||||
@ -99,7 +94,6 @@ export function getWithdrawDenomList(
|
|||||||
for (const d of denoms) {
|
for (const d of denoms) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
const cost = Amounts.add(d.value, d.feeWithdraw).amount;
|
const cost = Amounts.add(d.value, d.feeWithdraw).amount;
|
||||||
console.log("cost is", Amounts.stringify(cost));
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (Amounts.cmp(remaining, cost) < 0) {
|
if (Amounts.cmp(remaining, cost) < 0) {
|
||||||
break;
|
break;
|
||||||
@ -120,7 +114,6 @@ export function getWithdrawDenomList(
|
|||||||
count,
|
count,
|
||||||
denom: d,
|
denom: d,
|
||||||
});
|
});
|
||||||
console.log("total cost is", Amounts.stringify(totalWithdrawCost));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Amounts.isZero(remaining)) {
|
if (Amounts.isZero(remaining)) {
|
||||||
@ -154,7 +147,6 @@ export async function getBankWithdrawalInfo(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
const respJson = await resp.json();
|
const respJson = await resp.json();
|
||||||
console.log("resp:", respJson);
|
|
||||||
|
|
||||||
const status = codecForWithdrawOperationStatusResponse().decode(respJson);
|
const status = codecForWithdrawOperationStatusResponse().decode(respJson);
|
||||||
return {
|
return {
|
||||||
@ -281,7 +273,7 @@ async function processPlanchet(
|
|||||||
throw Error("invariant violated");
|
throw Error("invariant violated");
|
||||||
}
|
}
|
||||||
if (planchet.withdrawalDone) {
|
if (planchet.withdrawalDone) {
|
||||||
console.log("processPlanchet: planchet already withdrawn");
|
logger.warn("processPlanchet: planchet already withdrawn");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const exchange = await ws.db.get(
|
const exchange = await ws.db.get(
|
||||||
@ -289,7 +281,7 @@ async function processPlanchet(
|
|||||||
withdrawalGroup.exchangeBaseUrl,
|
withdrawalGroup.exchangeBaseUrl,
|
||||||
);
|
);
|
||||||
if (!exchange) {
|
if (!exchange) {
|
||||||
console.error("db inconsistent: exchange for planchet not found");
|
logger.error("db inconsistent: exchange for planchet not found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,12 +451,12 @@ export async function selectWithdrawalDenoms(
|
|||||||
): Promise<DenominationSelectionInfo> {
|
): Promise<DenominationSelectionInfo> {
|
||||||
const exchange = await ws.db.get(Stores.exchanges, exchangeBaseUrl);
|
const exchange = await ws.db.get(Stores.exchanges, exchangeBaseUrl);
|
||||||
if (!exchange) {
|
if (!exchange) {
|
||||||
console.log("exchange not found");
|
logger.error("exchange not found");
|
||||||
throw Error(`exchange ${exchangeBaseUrl} not found`);
|
throw Error(`exchange ${exchangeBaseUrl} not found`);
|
||||||
}
|
}
|
||||||
const exchangeDetails = exchange.details;
|
const exchangeDetails = exchange.details;
|
||||||
if (!exchangeDetails) {
|
if (!exchangeDetails) {
|
||||||
console.log("exchange details not available");
|
logger.error("exchange details not available");
|
||||||
throw Error(`exchange ${exchangeBaseUrl} details not available`);
|
throw Error(`exchange ${exchangeBaseUrl} details not available`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user