Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web3): Topic includes null #1024

Merged
merged 1 commit into from
Mar 22, 2023
Merged

fix(web3): Topic includes null #1024

merged 1 commit into from
Mar 22, 2023

Conversation

classicalliu
Copy link
Contributor

@classicalliu classicalliu commented Mar 17, 2023

Related issue:

{
    "id": 2,
    "jsonrpc": "2.0",
    "method": "eth_newFilter",
    "params": [
       {
            "topics": [
                [
                    "0x0000000000000000000000000000000000000000000000000000000000000004",
                    "0x0000000000000000000000000000000000000000000000000000000000000001"
                ],
                [
                    null,
                    null,
                    "0x0000000000000000000000000000000000000000000000000000000000000003"
                ]
            ]
       }
    ]
}

topics[1] is an array includes null value, in hardhat node, the topics[1] can match anything, equals to null, and infura will reject this request with error

{
    "jsonrpc": "2.0",
    "id": 2,
    "error": {
        "code": -32602,
        "message": "could not unmarshal parameter 0"
    }
}

Should we reject array includes null in eth_newFilter request such as infura or allow it such as hardhat node ? @Flouse

@classicalliu classicalliu marked this pull request as draft March 17, 2023 13:20
@Flouse Flouse requested a review from magicalne March 20, 2023 06:04
@classicalliu classicalliu marked this pull request as ready for review March 20, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants