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 error in getLogs method #805

Commits on Apr 28, 2020

  1. Fix error in getLogs method

    When listening on an event filter with a null parameter followed by
    a non-null parameter, it would keep throwing the error:
    
      { code: -32600, message: "data types must start with 0x" }`
    
    Turns out params.topics were being encoded as e.g.:
    
      "topics": [
        ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"],
        [null],
        [
          "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
          "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"
        ]
      ]
    
    instead of:
    
      "topics": [
        "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
        null,
        [
          "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
          "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"
        ]
      ]
    
    Fix this by flattening the array if there is only one topic in a
    position.
    danielattilasimon committed Apr 28, 2020
    Configuration menu
    Copy the full SHA
    9cd2a0c View commit details
    Browse the repository at this point in the history