aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

Fix eth_newFilter #286

Closed zakerikk closed 2 years ago

zakerikk commented 2 years ago
[
    {
        "jsonrpc": "2.0",
        "method": "eth_newFilter",
        "params": [
            {
                "fromBlock": "earliest",
                "toBlock": "latest"
            }
        ],
        "id": 1
    }
]

Before:

id <Buffer 65 86 35 2b 0b f2 47 df 80 20 53 f0 9c 4f a2 e0>
{"level":50,"time":1652787150184,"pid":28381,"hostname":"MacBook-Pro","code":"ERR_UNKNOWN_ENCODING","stack":"TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: 16\n    at new NodeError (node:internal/errors:372:5)\n    at Buffer.toString (node:buffer:810:11)\n    at intToHex (file:///Users/zak/dev/aurora/aurora-relayer/node_modules/@aurora-is-near/engine/lib/utils.js:29:23)\n    at DatabaseServer.eth_newFilter (file:///Users/zak/dev/aurora/aurora-relayer/lib/servers/database.js:383:16)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","type":"Error","msg":"Unknown encoding: 16"}
[
  {
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
      "code": -32603,
      "message": "Internal Error - Unknown encoding: 16. Please report a bug at <https://github.com/aurora-is-near/aurora-relayer/issues>",
      "data": {
        "host": "localhost:8545",
        "request_body": [
          {
            "jsonrpc": "2.0",
            "method": "eth_newFilter",
            "params": [
              {
                "fromBlock": "earliest",
                "toBlock": "latest"
              }
            ],
            "id": 1
          }
        ]
      }
    }
  }
]

After:

[
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x54703aa1bf6a4b35ad616aae12362c01"
  }
]
[
  {
    "jsonrpc": "2.0",
    "method": "eth_newFilter",
    "params": [
      {
        "address": "0x0000000000000000000000000000000000000000"
      }
    ],
    "id": 1
  }
]
[
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x9b19bb63d53e47858ab05a93fd4764f1"
  }
]