caivega / ipfslib

Other
2 stars 1 forks source link

S4 - 当销毁代币时,如果销毁数量大于当前数量,给出的错误信息是"Can only send non-negative amounts.",这不确切 #165

Closed foreso-GitHub closed 3 years ago

foreso-GitHub commented 3 years ago

当销毁代币时,如果销毁数量大于当前可销毁的数量,给出的错误信息是"Can only send non-negative amounts.",这不确切,因为销毁代币就是发行负数的代币,容易引起误解。 以前的版本,这种情况返回的错误信息是“Fund insufficient.”,更准确一些。

版本:v0.5.3-dev-20210103-bcc6a93d716c6b4916bf52f55df8fb591ab54965

{
    "jsonrpc": "2.0",
    "id": 6,
    "method": "jt_sendTransaction",
    "params": [
        {
            "from": "jNjYBkAQX8QtkntTqsG3o7V3btJz9CYBaD",
            "secret": "ssReUCkDZo8DfFYk26XTtDEH5YQbC",
            "type": "IssueCoin",
            "name": "TestCoin1609667919",
            "symbol": "5ff1954f",
            "decimals": "8",
            "total_supply": "-2100000004",
            "local": false,
            "flags": 196608
        }
    ]
}

{
    "error": {
        "count": 1,
        "description": "The compound error.",
        "information": "1 errors"
    },
    "id": 6,
    "jsonrpc": "2.0",
    "result": [
        {
            "error": {
                "description": "Can only send non-negative amounts.",
                "information": "Can only send non-negative amounts."
            },
            "status": -298,
            "type": "temBAD_AMOUNT"
        }
    ],
    "status": 1000,
    "type": "tedCOMPOUND"
}
foreso-GitHub commented 3 years ago

TestCase: FCJT_sendTransaction_000420

caivega commented 3 years ago

添加一个错误信息

-228 TecINSUF_TOTAL_SUPPLY Insufficient total supply to burn. 
caivega commented 3 years ago

done, 下一个build验证

foreso-GitHub commented 3 years ago

在版本v0.5.3-dev-20210107-780c20d1a3245c4ed02491403b15d342c3ee8635中验证,已经修正。