fix error in index iteration
This commit is contained in:
parent
aa36fce8a0
commit
70912b0725
@ -1,2 +1,3 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
require('source-map-support').install();
|
||||||
require('../dist/node/headless/taler-wallet-cli.js')
|
require('../dist/node/headless/taler-wallet-cli.js')
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "idb-bridge",
|
"name": "idb-bridge",
|
||||||
"version": "0.0.9",
|
"version": "0.0.10",
|
||||||
"description": "IndexedDB implementation that uses SQLite3 as storage",
|
"description": "IndexedDB implementation that uses SQLite3 as storage",
|
||||||
"main": "./build/index.js",
|
"main": "./build/index.js",
|
||||||
"types": "./build/index.d.ts",
|
"types": "./build/index.d.ts",
|
||||||
|
@ -1156,6 +1156,7 @@ export class MemoryBackend implements Backend {
|
|||||||
indexPos = res[1].indexKey;
|
indexPos = res[1].indexKey;
|
||||||
indexEntry = res[1];
|
indexEntry = res[1];
|
||||||
primkeySubPos = forward ? 0 : indexEntry.primaryKeys.length - 1;
|
primkeySubPos = forward ? 0 : indexEntry.primaryKeys.length - 1;
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -171,6 +171,16 @@ export function installAndroidWalletListener() {
|
|||||||
httpLib.handleTunnelResponse(msg.args);
|
httpLib.handleTunnelResponse(msg.args);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "getWithdrawalInfo": {
|
||||||
|
const wallet = await wp.promise;
|
||||||
|
result = await wallet.getWithdrawalInfo(msg.args.talerWithdrawUri);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "acceptWithdrawal": {
|
||||||
|
const wallet = await wp.promise;
|
||||||
|
result = await wallet.acceptWithdrawal(msg.args.talerWithdrawUri, msg.args.selectedExchange);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "reset": {
|
case "reset": {
|
||||||
const wallet = await wp.promise;
|
const wallet = await wp.promise;
|
||||||
wallet.stop();
|
wallet.stop();
|
||||||
|
@ -133,8 +133,9 @@ export async function getDefaultNodeWallet(
|
|||||||
|
|
||||||
const myBadge = new ConsoleBadge();
|
const myBadge = new ConsoleBadge();
|
||||||
|
|
||||||
|
BridgeIDBFactory.enableTracing = true;
|
||||||
const myBackend = new MemoryBackend();
|
const myBackend = new MemoryBackend();
|
||||||
myBackend.enableTracing = false;
|
myBackend.enableTracing = true;
|
||||||
|
|
||||||
const storagePath = args.persistentStoragePath;
|
const storagePath = args.persistentStoragePath;
|
||||||
if (storagePath) {
|
if (storagePath) {
|
||||||
|
@ -135,7 +135,7 @@ program
|
|||||||
persistentStoragePath: walletDbPath,
|
persistentStoragePath: walletDbPath,
|
||||||
});
|
});
|
||||||
|
|
||||||
const withdrawInfo = await wallet.downloadWithdrawInfo(withdrawUrl);
|
const withdrawInfo = await wallet.getWithdrawalInfo(withdrawUrl);
|
||||||
|
|
||||||
console.log("withdraw info", withdrawInfo);
|
console.log("withdraw info", withdrawInfo);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { openPromise } from "./promiseUtils";
|
import { openPromise } from "./promiseUtils";
|
||||||
|
import { join } from "path";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Result of an inner join.
|
* Result of an inner join.
|
||||||
@ -463,11 +464,14 @@ class QueryStreamIndexJoin<T, S> extends QueryStreamBase<JoinResult<T, S>> {
|
|||||||
f(true, undefined, tx);
|
f(true, undefined, tx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const joinKey = this.key(value);
|
||||||
|
console.log("***** JOINING ON", joinKey);
|
||||||
const s = tx.objectStore(this.storeName).index(this.indexName);
|
const s = tx.objectStore(this.storeName).index(this.indexName);
|
||||||
const req = s.openCursor(IDBKeyRange.only(this.key(value)));
|
const req = s.openCursor(IDBKeyRange.only(joinKey));
|
||||||
req.onsuccess = () => {
|
req.onsuccess = () => {
|
||||||
const cursor = req.result;
|
const cursor = req.result;
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
|
console.log(`join result for ${joinKey}`, { left: value, right: cursor.value });
|
||||||
f(false, { left: value, right: cursor.value }, tx);
|
f(false, { left: value, right: cursor.value }, tx);
|
||||||
cursor.continue();
|
cursor.continue();
|
||||||
}
|
}
|
||||||
|
@ -1822,7 +1822,7 @@ export class Wallet {
|
|||||||
talerWithdrawUri: string,
|
talerWithdrawUri: string,
|
||||||
maybeSelectedExchange?: string,
|
maybeSelectedExchange?: string,
|
||||||
): Promise<WithdrawDetails> {
|
): Promise<WithdrawDetails> {
|
||||||
const info = await this.downloadWithdrawInfo(talerWithdrawUri);
|
const info = await this.getWithdrawalInfo(talerWithdrawUri);
|
||||||
let rci: ReserveCreationInfo | undefined = undefined;
|
let rci: ReserveCreationInfo | undefined = undefined;
|
||||||
if (maybeSelectedExchange) {
|
if (maybeSelectedExchange) {
|
||||||
rci = await this.getWithdrawDetailsForAmount(
|
rci = await this.getWithdrawDetailsForAmount(
|
||||||
@ -3551,7 +3551,7 @@ export class Wallet {
|
|||||||
// strategy to test it.
|
// strategy to test it.
|
||||||
}
|
}
|
||||||
|
|
||||||
async downloadWithdrawInfo(
|
async getWithdrawalInfo(
|
||||||
talerWithdrawUri: string,
|
talerWithdrawUri: string,
|
||||||
): Promise<DownloadedWithdrawInfo> {
|
): Promise<DownloadedWithdrawInfo> {
|
||||||
const uriResult = parseWithdrawUri(talerWithdrawUri);
|
const uriResult = parseWithdrawUri(talerWithdrawUri);
|
||||||
@ -3577,7 +3577,7 @@ export class Wallet {
|
|||||||
talerWithdrawUri: string,
|
talerWithdrawUri: string,
|
||||||
selectedExchange: string,
|
selectedExchange: string,
|
||||||
): Promise<AcceptWithdrawalResponse> {
|
): Promise<AcceptWithdrawalResponse> {
|
||||||
const withdrawInfo = await this.downloadWithdrawInfo(talerWithdrawUri);
|
const withdrawInfo = await this.getWithdrawalInfo(talerWithdrawUri);
|
||||||
const exchangeWire = await this.getExchangePaytoUri(
|
const exchangeWire = await this.getExchangePaytoUri(
|
||||||
selectedExchange,
|
selectedExchange,
|
||||||
withdrawInfo.wireTypes,
|
withdrawInfo.wireTypes,
|
||||||
|
Loading…
Reference in New Issue
Block a user