Skip to content

Commit

Permalink
Added queryFilter to Contracts (#463).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed May 24, 2019
1 parent cf39adb commit eea53bb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/contracts/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,25 +719,22 @@ export class Contract {
}

queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise<Array<Event>> {
/*
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 {
Expand Down

0 comments on commit eea53bb

Please sign in to comment.