From eea53bb1be29ad2bd1b229a13c85b12be264b019 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Fri, 24 May 2019 15:59:04 -0400 Subject: [PATCH] Added queryFilter to Contracts (#463). --- packages/contracts/src.ts/index.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/contracts/src.ts/index.ts b/packages/contracts/src.ts/index.ts index 73c3b2b764..667a9e317b 100644 --- a/packages/contracts/src.ts/index.ts +++ b/packages/contracts/src.ts/index.ts @@ -719,25 +719,22 @@ export class Contract { } queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise> { - /* let runningEvent = this._getRunningEvent(event); let filter = shallowCopy(runningEvent.filter); if (typeof(fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) { - filter.blockhash = fromBlockOrBlockhash; if (toBlock != null) { errors.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock); } + filter.blockhash = fromBlockOrBlockhash; } else { filter.fromBlock = ((fromBlockOrBlockhash != null) ? fromBlockOrBlockhash: 0); filter.toBlock = ((toBlock != null) ? toBlock: "latest"); } return this.provider.getLogs(filter).then((logs) => { - return logs.map((log) => this._wrapEvent(eventFilter, log, null)); + return logs.map((log) => this._wrapEvent(runningEvent, log, null)); }); - */ - return null; } on(event: EventFilter | string, listener: Listener): this {