caivega / ipfslib

Other
2 stars 1 forks source link

S2 - jt_sendTransaction(9545):发行代币时flags参数的格式问题 #150

Closed zyd82 closed 3 years ago

zyd82 commented 3 years ago

版本:v0.5.3-dev-20201216-be83b3f3cf9773881eb5fcf277e9b9afe8caaa8c 用例编号:jt_sendTransaction_000350

目前发行可增发代币时,flags既可以是数字65536,也可以是字符串"65536"。但是如果用"65536"发行代币,后续无法增发该代币,用65536就没有问题。因此建议让flags参数只支持数字格式,不支持字符串格式。

{
    "jsonrpc": "2.0",
    "method": "jt_sendTransaction",
    "params": [
        { 
            "type": "IssueCoin",
            "from": "jPdx7mG595P6CowtGYbxRkik9HdWUWtB2J",
            "secret": "shhquPeZm7uQ6Rvjrqn6L2cR6H33u",
            "name": "ZYDDD ads Token",
            "symbol": "PPT",
            "decimals": "8",
            "total_supply": "1000",
            "local": false,
            "flags": 65536
        }
    ],
    "id": 1
}

flags用"65536"发行代币时,如果增发该代币,会返回如下错误:

{
    "error": "1 errors",
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "error": "failed to submit transaction 70C50C8AEC4E0D895C67A8992F98E6F302F060039B17E757A4189542EDE973C8",
            "message": {
                "engine_result": "tefNO_PERMISSION_ISSUE",
                "engine_result_code": -175,
                "engine_result_message": "No permission issue.",
                "tx_blob": "1200012280000000240000001d68400000000000000a6cd5438d7ea4c68000000000000000000000000050505400000000000000000000000000000000000000000000000000007321034153eebb406b3593aa7f31a4908e56ed820031db87f4f2e868fb8e1686d5e1e374473045022100e8d86bdfab2f7b1e0e486acb5e7eff7e53d7788108f50e46c1740199e85cc58402202220d36a549d6d2c07def90d6bf8abb4438d67965c67589985be3b31fd16916a8114f8500d9a44fce19e8d873b0661a2be53557bb43c8214f8500d9a44fce19e8d873b0661a2be53557bb43c910f5a594444442061647320546f6b656e041008",
                "tx_json": {
                    "TransactionType": "IssueCoin",
                    "Flags": 2147483648,
                    "Account": "jPdx7mG595P6CowtGYbxRkik9HdWUWtB2J",
                    "Sequence": 29,
                    "Fee": "10",
                    "SigningPubKey": "034153EEBB406B3593AA7F31A4908E56ED820031DB87F4F2E868FB8E1686D5E1E3",
                    "TxnSignature": "3045022100E8D86BDFAB2F7B1E0E486ACB5E7EFF7E53D7788108F50E46C1740199E85CC58402202220D36A549D6D2C07DEF90D6BF8ABB4438D67965C67589985BE3B31FD16916A",
                    "hash": "70C50C8AEC4E0D895C67A8992F98E6F302F060039B17E757A4189542EDE973C8",
                    "Name": "ZYDDD ads Token",
                    "Decimals": 8,
                    "TotalSupply": {
                        "value": "1000",
                        "currency": "PPT",
                        "issuer": "jjjjjjjjjjjjjjjjjjjjjhoLvTp"
                    },
                    "Owner": "jPdx7mG595P6CowtGYbxRkik9HdWUWtB2J"
                }
            },
            "status": -278,
            "type": "temINVALID"
        }
    ],
    "status": -278,
    "type": "temINVALID"
}
caivega commented 3 years ago

已修复,下一个版本验证

zyd82 commented 3 years ago

v0.5.3-dev-20201229-549e506fdf4556bc9bfd675559fd201421bd3036版本验证通过。

{
    "error": {
        "count": 1,
        "description": "The compound error.",
        "information": "1 errors"
    },
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "error": {
                "description": "The transaction is ill-formed.",
                "information": "flags must be integer type",
                "message": {
                    "decimals": "12",
                    "flags": "65536",
                    "from": "jPdx7mG595P6CowtGYbxRkik9HdWUWtB2J",
                    "local": true,
                    "name": "slkjgs",
                    "symbol": "AAT30",
                    "total_supply": "9.0123456789/AAT30",
                    "type": "IssueCoin"
                }
            },
            "status": -278,
            "type": "temINVALID"
        }
    ],
    "status": 1000,
    "type": "tedCOMPOUND"
}