From 16371276588b34769a09d940e608426b06ec3163 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 3 Mar 2017 15:37:04 +0100 Subject: have from contract, remove extended contract query --- src/wallet.ts | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'src/wallet.ts') diff --git a/src/wallet.ts b/src/wallet.ts index 01d26c297..50febf946 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -669,27 +669,13 @@ export class Wallet { /** - * Retrieve all necessary information for looking up the contract - * with the given hash. + * Retrieve information required to pay for a contract, where the + * contract is identified via the fulfillment url. */ - async queryPayment(query: any): Promise { - let t: TransactionRecord | undefined; - - console.log("query for payment", query); - - switch (query.type) { - case "fulfillment_url": - t = await this.q().getIndexed(Stores.transactions.fulfillmentUrlIndex, query.value); - break; - case "order_id": - t = await this.q().getIndexed(Stores.transactions.orderIdIndex, query.value); - break; - case "hash": - t = await this.q().get(Stores.transactions, query.value); - break; - default: - throw Error("invalid type"); - } + async queryPayment(url: string): Promise { + console.log("query for payment", url); + + const t = await this.q().getIndexed(Stores.transactions.fulfillmentUrlIndex, url); if (!t) { console.log("query for payment failed"); -- cgit v1.2.3