f-o-a-m / kepler

A Haskell framework that facilitates writing ABCI applications
https://kepler.dev
Apache License 2.0
34 stars 10 forks source link

Inconsistent types in tendermint RPC #92

Open IvantheTricourne opened 4 years ago

IvantheTricourne commented 4 years ago

Related to #75.

Missing Fields

Type definitions with fields that are missing when uninitialized

Null Fields

Type definitions with fields that are set to null when uninitialized

String Fields

Type definitions with fields typed "string" (i.e., wrappers over number types)

Client.hs

Response.hs

Request.hs

FieldTypes.hs

Types.hs

martyall commented 4 years ago

related to #109

alexfmpe commented 4 years ago

Edit: Ok, this was resolved by bumping kepler, so I think it can be ignored.

I'm running into

*** Exception: ParsingException "parsing Word64 failed, expected Number, but encountered String"

when trying to use RPC.abciInfo even though manually curling works

{
  "jsonrpc": "2.0",
  "id": "",
  "result": {
    "response": {
      "data": "1",
      "version": "123",
      "app_version": "1",
      "last_block_height": "123"
    }
  }
}

I see this was erroring as of https://github.com/f-o-a-m/kepler/pull/84/commits/92b3b4c3af88a80cbafc5927947464dc03b32c3f.

I'm currently depending on an older version than that, and was wondering if bumping Kepler would fix this.

It seems to work in current Travis? https://travis-ci.com/github/f-o-a-m/kepler/jobs/310896828

RPC Request
{
    "jsonrpc": "2.0",
    "params": [],
    "method": "abci_info",
    "id": 2149148217020253723
}
RPC Response
{
    "result": {
        "response": {
            "data": "{\"size\":0}",
            "app_version": "1",
            "version": "0.16.1"
        }
    },
    "jsonrpc": "2.0",
    "id": 2149148217020253696
}
    Can query /abci_info and parse the result
martyall commented 4 years ago

Yeah this kind of stuff was always a pain to get right, we only lazily discover these kinds of errors. Let me know if you're problem wasn't actually fixed by the bump