-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
C:rpcComponent: JSON RPC, gRPCComponent: JSON RPC, gRPC
Description
We currently seem to be encoding integers inconsistently in responses from the RPC.
Tendermint version: 0.32.2-76f3db06
ABCI app (name for built-in, URL for self-written if it's publicly available): kvstore
Have you tried the latest version: yes
How to reproduce it (as minimally and precisely as possible):
> curl "http://localhost:26657/broadcast_tx_sync?tx=\"abcd=1234\""
{
"jsonrpc": "2.0",
"id": "",
"result": {
"code": 0,
"data": "",
"log": "",
"hash": "F0732FA1810E26F15D3DF480ACE8B3AD5E429C563B22AEBDED33FC06273FD42B"
}
}Note how result -> code is encoded as an integer. Then:
> curl "http://localhost:26657/tx?hash=0xF0732FA1810E26F15D3DF480ACE8B3AD5E429C563B22AEBDED33FC06273FD42B"
{
"jsonrpc": "2.0",
"id": "",
"result": {
"hash": "F0732FA1810E26F15D3DF480ACE8B3AD5E429C563B22AEBDED33FC06273FD42B",
"height": "3",
"index": 0,
"tx_result": {
"events": [
{
"type": "app",
"attributes": [
{
"key": "Y3JlYXRvcg==",
"value": "Q29zbW9zaGkgTmV0b3dva28="
},
{
"key": "a2V5",
"value": "YWJjZA=="
}
]
}
]
},
"tx": "YWJjZD0xMjM0"
}
}Here, result -> index is encoded as an integer, but result -> height is encoded as a string.
Should we not prefer encoding integers consistently? Is this related to Amino? It seems as though int64's get encoded as strings, but other integers get encoded as integers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C:rpcComponent: JSON RPC, gRPCComponent: JSON RPC, gRPC