Closed zyd82 closed 3 years ago
这个属于bug, 可以发行成功,但是后续转帐及其他处理都会出错的,这个还是需要检查下的
已修复,下一个build验证
在v0.5.3-dev-20201231-72973ab08899c404ac4998f2e79c8b5fac0e199e版本上,想通过增发来使余额突破9000000000000000000的上限已经不能成功了,但是提示信息还不准确,建议修改一下。
1、钱包已经发行了9000000000000000000个代币,此时再增发一个,提示信息是:Can only send non-negative amounts
{
"error": {
"count": 1,
"description": "The compound error.",
"information": "1 errors"
},
"id": 1,
"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"
}
2、钱包已经发行了9000000000000000000个代币,此时再增发9000000000000000000个,提示信息是:Fund insufficient
{
"error": {
"count": 1,
"description": "The compound error.",
"information": "1 errors"
},
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"error": {
"description": "Fund insufficient.",
"information": "Fund insufficient."
},
"status": -386,
"type": "telINSUF_FUND"
}
],
"status": 1000,
"type": "tedCOMPOUND"
}
建议这种增发失败的提示信息统一改为:Cannot exceed the maximum total supply number.
增加新的错误类型
-385 TelEXCEED_MAXIMUM Cannot exceed the maximum total supply number.
done, 下一个build验证
v0.5.3-dev-20210103-bcc6a93d716c6b4916bf52f55df8fb591ab54965版本上验证通过,目前超发的话会返回如下信息:
{
"error": {
"count": 1,
"description": "The compound error.",
"information": "1 errors"
},
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"error": {
"description": "Cannot exceed the maximum total supply number.",
"information": "Cannot exceed the maximum total supply number."
},
"status": -385,
"type": "telEXCEED_MAXIMUM"
}
],
"status": 1000,
"type": "tedCOMPOUND"
}
测试版本:v0.5.3-dev-20201222-4d79cede520d8eb6752703f588cd4a9b83370d91 测试用例:jt_sendTransaction_000370
1、发行9300000000000000000(93后面带17个0)个代币,发行失败,应该是超过上限了,但是返回的错误信息是"total_supply must be integer type"(这里是否考虑改下提示信息)
2、发行9200000000000000000(92后面带17个0)个可增发可销毁的代币,发行成功,用jt_getBalance可以查到正确的余额
3、增发9200000000000000000(92后面带17个0)个代币,增发成功,jt_getBalance可以看到余额变成了18400000000000000000(184后面带17个0)
4、继续增发9200000000000000000(92后面带17个0)个代币,余额变成27600000000000000000(276后面带17个0)
这里可以看到发币的上限届于9200000000000000000(92后面带17个0)和9300000000000000000(93后面带17个0)之间,但是通过不断增发,可以突破发币的上限值,这种情况是否允许呢?