Cocos-BCX / cocos-bcx-node-bin

GNU General Public License v3.0
2.38k stars 286 forks source link

钱包rpc转账金额不能使用小数 #4

Closed hepengdai closed 5 years ago

hepengdai commented 5 years ago

转账json {"jsonrpc":"2.0", "method":"transfer", "params": ["dhptest","dhptest3",3.412,"COCOS","hehe",true], "id":"2"} 错误: {"id":2,"jsonrpc":"2.0","error":{"code":2,"message":"Assert Exception: rhs.size() <= max_rhs_size: "}}

解决办法:转账如果带小数,需要使用字符串,否则会报错 软件版本Version: v_0_7_18

gkany commented 5 years ago

curl通过cli_wallet转账时,转账的from, to, amout, symbol, meno都需要使用双引号。示例: curl http://127.0.0.1:8049 -d '{"jsonrpc": "2.0", "method": "transfer", "params": ["test1", "test2", "1.0021", "COCOS", "test transfer", true], "id": 1}'

hepengdai commented 5 years ago

在实际的使用中,如果是整数,不带双引号也可以转账成功,但是带小数必须带双引号