caivega / ipfslib

Other
2 stars 1 forks source link

S4 - jt_getTransactionByIndex,当sequence为负数时,给出的错误类型解释不确切 #185

Closed foreso-GitHub closed 3 years ago

foreso-GitHub commented 3 years ago

jt_getTransactionByIndex,当sequence为负数时,给出的错误类型描述不确切。 现在给出的错误类型是-284,desc是"desc": "Malformed: Sequence is not in the past."。这个版本前,该错误给出的类型是-269,desc是“Malformed: bad parameter.”,相对而言更正确一些。 版本: v0.5.4-dev-20210209-f080e8c2b57b52cabd3cef2718439ab6305d3f46 TestCase:FCJT_getTransactionByIndex_000020

{
    "jsonrpc": "2.0",
    "method": "jt_getTransactionByIndex",
    "params": [
        {
            "address": "jsDqD1zh95SfQRjXguLWN472KXyWbx6jug",
            "sequence": -1,
            "full": true
        }
    ],
    "id": 1
}

{
    "error": {
        "count": 1,
        "desc": "The compound error.",
        "info": "1 errors"
    },
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "error": {
                "desc": "Malformed: Sequence is not in the past.",
                "info": "invalid parameter -1 for sequence"
            },
            "status": -284,
            "type": "temBAD_SEQUENCE"
        }
    ],
    "status": 1000,
    "type": "tedCOMPOUND"
}
caivega commented 3 years ago

已经修复,下一个版本验证

caivega commented 3 years ago

同样,这个地方也使用最新的bad sequence描述:

-284 TemBAD_SEQUENCE Malformed: Bad sequence.
foreso-GitHub commented 3 years ago

同样,这个地方也使用最新的bad sequence描述:

-284 TemBAD_SEQUENCE Malformed: Bad sequence.

对,这样好。

foreso-GitHub commented 3 years ago

还是有问题。

-284 TemBAD_SEQUENCE Malformed: Bad sequence. 但实际错误中的"desc": "Malformed: Bad sequence",漏了'.'。估计是漏了和wiki的同步。

{
    "error": {
        "count": 1,
        "desc": "The compound error.",
        "info": "1 errors"
    },
    "id": 263,
    "jsonrpc": "2.0",
    "result": [
        {
            "error": {
                "desc": "Malformed: Bad sequence",
                "info": "invalid parameter -1 for sequence"
            },
            "status": -284,
            "type": "temBAD_SEQUENCE"
        }
    ],
    "status": 1000,
    "type": "tedCOMPOUND"
}
caivega commented 3 years ago

已经修复,下一个build验证

foreso-GitHub commented 3 years ago

在版本v0.6.4-dev-20210219-ae3070493c2d87812731c2583fe3820089246ee7中验证,已经修复。