caivega / ipfslib

Other
2 stars 1 forks source link

S2 - jt_signTransaction(9545):IssueCoin时symbol参数里有特殊字符 #66

Closed zyd82 closed 3 years ago

zyd82 commented 4 years ago

发送如下请求,其中symbol参数里有字符“/”。

{
    "jsonrpc": "2.0",
    "method": "jt_signTransaction",
    "params": [
        {
            "type": "IssueCoin",
            "from": "jEwE94Yhi2iLqVuFAL7K1XbHoaFES9N3pm",
            "secret": "ssCR6vTQeD4rBDaD7cGZCM9w6bVfH",
            "name": "CCC Token",
            "symbol": "12/34", =>特殊字符
            "decimals": 8,
            "total_supply": "100000000"
        }
    ],
    "id": 1
}

9545上发币成功。建议发币时symbol参数不能包含特殊字符,最好只允许输入字母、数字、下划线这些常用字符。

caivega commented 4 years ago

symbol, [a-zA-Z0-9_],现在只允许字母(大小写), 数字及下划线及中文除标点外的字符

zyd82 commented 4 years ago

好像加了下划线不行,不加下划线可以。 发送如下请求:

{
    "jsonrpc": "2.0",
    "method": "jt_sendTransaction",
    "params": [
        {
            "type": "IssueCoin",
            "from": "jEwE94Yhi2iLqVuFAL7K1XbHoaFES9N3pm",
            "secret": "ssCR6vTQeD4rBDaD7cGZCM9w6bVfH",
            "name": "CCC Token",
            "symbol": "das_sdfdsr", => 带下划线
            "decimals": 8,
            "total_supply": "100000000"
        }
    ],
    "id": 1
}

返回:

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "runtime error: invalid memory address or nil pointer dereference",
    "status": "error"
}
zyd82 commented 4 years ago

版本v0.2.1-testing,发行symbol长度为12的代币失败,返回如下:

{
    "jsonrpc": "2.0",
    "method": "jt_signTransaction",
    "params": [
        {
            "type": "IssueCoin",
            "from": "jKnUV9RPe1apMP43ZED68ujYk513w9QfY7",
            "secret": "shCQEm9jrWGpYvjCg5brXknDd2j6A",
            "name": "kdhgfueosh Token",
            "symbol": "IFJGTENIJSGT",
            "decimals": "8",
            "total_supply": "100000000"
        }
    ],
    "id": 1
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "runtime error: invalid memory address or nil pointer dereference",
    "status": "error"
}
zyd82 commented 3 years ago

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

{
    "id": 1,
    "jsonrpc": "2.0",
    "message": {
        "reason": "1 errors",
        "result": [
            {
                "error": "symbol must be the characters with alphas[a-zA-Z], numbers[0-9], chinese characters[一-龥] and underscores[_]",
                "message": {
                    "decimals": "8",
                    "flags": 65536,
                    "from": "jGQ14U9BeHn6kV9eofnVsshSCxAecBawPM",
                    "name": "weasd Token",
                    "symbol": "a..23",
                    "total_supply": "100000000",
                    "type": "IssueCoin"
                },
                "status": -278
            }
        ]
    },
    "result": [
        ""
    ],
    "status": -278
}