kaya icon indicating copy to clipboard operation
kaya copied to clipboard

"GetTransaction" return incorrect error code when transaction is not found

Open bogdan opened this issue 6 years ago • 0 comments

Zilliqa blockchain returns Txn hash not Present when GetTransaction is called with unknown hash:

curl -d '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "GetTransaction",
    "params": ["655107c300e86ee6e819af1cbfce097db1510e8cd971d99f32ce2772dcad42f2"]
}' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/"
{"error":{"code":-20,"data":null,"message":"Txn Hash not Present"},"id":"1","jsonrpc":"2.0"}%

While kaya returns Error: INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised: Size not appropriate

This type of response is returned by zilliqa node only when hash size is incorrect:

curl -d '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "GetTransaction",
    "params": ["aadfa"]
}' -H "Content-Type: application/json" -X POST "https://api.zilliqa.com/"
{"error":{"code":-32602,"data":null,"message":"INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised: Size not appropriate"},"id":"1","jsonrpc":"2.0"}%

bogdan avatar Jan 03 '20 16:01 bogdan