caivega / ipfslib

Other
2 stars 1 forks source link

S3 - jt_signTransaction:fee参数为负数时的问题 #53

Closed zyd82 closed 3 years ago

zyd82 commented 4 years ago

发送如下jt_signTransaction请求,fee参数为负数

{
    "jsonrpc": "2.0",
    "method": "jt_signTransaction",
    "params": [
        {
            "from": "jEwE94Yhi2iLqVuFAL7K1XbHoaFES9N3pm",
            "secret": "ssCR6vTQeD4rBDaD7cGZCM9w6bVfH",
            "to": "js3MF5kQkTG6NBVj9HEiw9cFe4ckNvMYGg",
            "value": "1000",
            "fee": -55
        }
    ],
    "id": 1
}

7545上,返回如下

{
    "id": 0,
    "jsonrpc": "2.0",
    "result": "runtime error: invalid memory address or nil pointer dereference",
    "status": "error"
}

9545上,返回长串哈希,用jt_sendRawTransaction发起哈希交易,返回如下:

{
    "id": 1,
    "jsonrpc": "2.0",
    "message": "failed to submit transaction blob 120000228000000024000000186140000000000003e86800000000000000377321033664603e11ff4075be6df5206487726e7365fea48a169f0ed776e69bd162ba9c744630440220327d778a26e45aa25fa076727b1be251afbed28553d8f2e137009cc596fa423b02202f9c16e034a307660e914d37fe4a5b722daf54c81b95c8c16371e27b6cc1430081149b514fcd1b5c8aca4a08c1221fc349c38c4ae095831417548b963584f5337addf78dbf78f188682a6ffe: 
tecINSUFF_FEE Insufficient balance to pay fee.",
    "result": [
        ""
    ],
    "status": "error"
}

建议返回相应提示信息。

zyd82 commented 4 years ago

9545已验证,验证版本v0.5.1-dev

zyd82 commented 3 years ago

9545已验证,验证版本v0.5.3-dev

{
    "id": 1,
    "jsonrpc": "2.0",
    "message": {
        "reason": "1 errors",
        "result": [
            {
                "error": "strconv.ParseUint: parsing \"-10\": invalid syntax",
                "message": {
                    "fee": "-10",
                    "from": "jPdx7mG595P6CowtGYbxRkik9HdWUWtB2J",
                    "to": "jGQ14U9BeHn6kV9eofnVsshSCxAecBawPM",
                    "value": "99/ZYDTL/jPdx7mG595P6CowtGYbxRkik9HdWUWtB2J"
                },
                "status": -278
            }
        ]
    },
    "result": [
        ""
    ],
    "status": -278
}