Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Filter in options to filter contract events is no longer a valid parameter #2532

Closed
gnorbsl opened this issue Mar 19, 2019 · 2 comments · Fixed by #2535
Closed

Filter in options to filter contract events is no longer a valid parameter #2532

gnorbsl opened this issue Mar 19, 2019 · 2 comments · Fixed by #2535
Labels
Bug Addressing a bug

Comments

@gnorbsl
Copy link

gnorbsl commented Mar 19, 2019

Description

I used the parameter "filter" in the option that I pass to contract events like explained here:
https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#contract-events
It seems like this functionality broke between 33 and 49.

What is the proper replacement to filter events based on an array of addresses?

Steps to reproduce the behavior

1. update `web3`
2.Add options:
const options = {
    filter: {
         to:  addressArray
     },
          fromBlock: 'latest'
};
3. subscribe to events with
contract.events.Transfer(options, (error, event) => {
    stuff
}

Error Logs

Error: Provider error: Error: Node error: {"code":-32602,"message":"Invalid params: Invalid Pub-Sub parameters: unknown field `filter`, expected one of `fromBlock`, `toBlock`, `blockHash`, `address`, `topics`, `limit`."}
at /home/user/project/node_modules/web3-providers/dist/web3-providers.cjs.js:320:15
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
  • web3.js: 49
@nivida nivida added the Bug Addressing a bug label Mar 20, 2019
@nivida
Copy link
Contributor

nivida commented Mar 20, 2019

Thanks for opening this issue! I'll test and fix it asap.

@nivida
Copy link
Contributor

nivida commented Mar 20, 2019

@gnorbsl FYI: It will get released today or tomorrow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants