wallet db version belongs with wallet, not webex
This commit is contained in:
parent
2904591332
commit
d283331285
@ -329,8 +329,22 @@ export interface ConfigRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wallet protocol version spoken with the exchange
|
||||||
|
* and merchant.
|
||||||
|
*
|
||||||
|
* Uses libtool's current:revision:age versioning.
|
||||||
|
*/
|
||||||
export const WALLET_PROTOCOL_VERSION = "0:0:0";
|
export const WALLET_PROTOCOL_VERSION = "0:0:0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current database version, should be incremented
|
||||||
|
* each time we do incompatible schema changes on the database.
|
||||||
|
* In the future we might consider adding migration functions for
|
||||||
|
* each version increment.
|
||||||
|
*/
|
||||||
|
export const WALLET_DB_VERSION = 18;
|
||||||
|
|
||||||
const builtinCurrencies: CurrencyRecord[] = [
|
const builtinCurrencies: CurrencyRecord[] = [
|
||||||
{
|
{
|
||||||
auditors: [
|
auditors: [
|
||||||
|
@ -39,6 +39,7 @@ import {
|
|||||||
ConfirmReserveRequest,
|
ConfirmReserveRequest,
|
||||||
CreateReserveRequest,
|
CreateReserveRequest,
|
||||||
Stores,
|
Stores,
|
||||||
|
WALLET_DB_VERSION,
|
||||||
Wallet,
|
Wallet,
|
||||||
} from "../wallet";
|
} from "../wallet";
|
||||||
|
|
||||||
@ -53,14 +54,6 @@ import MessageSender = chrome.runtime.MessageSender;
|
|||||||
|
|
||||||
const DB_NAME = "taler";
|
const DB_NAME = "taler";
|
||||||
|
|
||||||
/**
|
|
||||||
* Current database version, should be incremented
|
|
||||||
* each time we do incompatible schema changes on the database.
|
|
||||||
* In the future we might consider adding migration functions for
|
|
||||||
* each version increment.
|
|
||||||
*/
|
|
||||||
const DB_VERSION = 18;
|
|
||||||
|
|
||||||
const NeedsWallet = Symbol("NeedsWallet");
|
const NeedsWallet = Symbol("NeedsWallet");
|
||||||
|
|
||||||
function handleMessage(sender: MessageSender,
|
function handleMessage(sender: MessageSender,
|
||||||
@ -291,7 +284,7 @@ function handleMessage(sender: MessageSender,
|
|||||||
}
|
}
|
||||||
const resp: wxApi.UpgradeResponse = {
|
const resp: wxApi.UpgradeResponse = {
|
||||||
dbResetRequired,
|
dbResetRequired,
|
||||||
currentDbVersion: DB_VERSION.toString(),
|
currentDbVersion: WALLET_DB_VERSION.toString(),
|
||||||
oldDbVersion: (oldDbVersion || "unknown").toString(),
|
oldDbVersion: (oldDbVersion || "unknown").toString(),
|
||||||
}
|
}
|
||||||
return resp;
|
return resp;
|
||||||
@ -641,7 +634,7 @@ export async function wxMain() {
|
|||||||
*/
|
*/
|
||||||
function openTalerDb(): Promise<IDBDatabase> {
|
function openTalerDb(): Promise<IDBDatabase> {
|
||||||
return new Promise<IDBDatabase>((resolve, reject) => {
|
return new Promise<IDBDatabase>((resolve, reject) => {
|
||||||
const req = indexedDB.open(DB_NAME, DB_VERSION);
|
const req = indexedDB.open(DB_NAME, WALLET_DB_VERSION);
|
||||||
req.onerror = (e) => {
|
req.onerror = (e) => {
|
||||||
console.log("taler database error", e);
|
console.log("taler database error", e);
|
||||||
reject(e);
|
reject(e);
|
||||||
@ -674,7 +667,7 @@ function openTalerDb(): Promise<IDBDatabase> {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (e.oldVersion !== DB_VERSION) {
|
if (e.oldVersion !== WALLET_DB_VERSION) {
|
||||||
oldDbVersion = e.oldVersion;
|
oldDbVersion = e.oldVersion;
|
||||||
chrome.tabs.create({
|
chrome.tabs.create({
|
||||||
url: chrome.extension.getURL("/src/webex/pages/reset-required.html"),
|
url: chrome.extension.getURL("/src/webex/pages/reset-required.html"),
|
||||||
|
Loading…
Reference in New Issue
Block a user