caivega / ipfslib

Other
2 stars 1 forks source link

S3 - 井通新链和井通现有版本的兼容性问题:部分出错信息不一致 #83

Open foreso-GitHub opened 4 years ago

foreso-GitHub commented 4 years ago

执行jt_getBlockByNumber 等方法,返回的部分错误信息,井通新链和井通现有版本不一致,具体见下表:

方法 参数 井通新链出错信息 井通现有版本出错信息
jt_getBlockByNumber blockNumber:99900000,查询的区块号超过当前最高区块号 can\'t find block 99900000 ledgerNotFound
jt_getBlockByNumber blockNumber:-1000,查询的区块号是负数 strconv.ParseUint: parsing "-1000": invalid syntax ledgerNotFound
jt_getBlockByNumber blockNumber:abcdefg,查询的区块号非数字 strconv.ParseUint: parsing "abcdefg": invalid syntax ledgerNotFound
jt_getBlockByHash blockHash:99900000, 查询的区块hash是数字 NewHash256: Wrong length 99900000 ledgerNotFound
jt_getBlockByHash blockHash:-1000,查询的区块hash是负数 encoding/hex: invalid byte: U+002D \'-\' invalid ledger_index
jt_getBlockByHash blockHash:abcdefg,查询的区块hash是字串 encoding/hex: invalid byte: U+0067 \'g\ invalid ledger_index
jt_getTransactionByHash hash:1231111,查询无效交易哈希:数字 interface conversion: interface {} is float64, not string invalid tx hash
jt_getTransactionByHash hash:'data.tx1.hash',查询无效交易哈希:字符串 encoding/hex: invalid byte: U+0074 \'t\' invalid tx hash
jt_getTransactionByHash hash:null,查询无效交易哈希:参数为空 interface conversion: interface {} is nil, not string invalid tx hash
jt_getTransactionByHash hash:无效交易哈希:不存在的hash can\'t find transaction B076....530A Transaction not found.
jt_getTransactionByHash hash:无效交易哈希:hash长度超过标准 runtime error: index out of range invalid tx hash
jt_getAccount address: 查询未激活的地址 no such account:j4tBKPidB9iEJMqdatq7rbh14nPhAbCyfg Account not found.
jt_getAccount address: 查询无效的地址: "inactiveAccounts[0].address" Bad account address: inactiveAccounts[0].address: Bad Base58 string: inactiveAccounts[0].address Account not found.
jt_getBalance address: 查询未激活的地址 no such account:j4tBKPidB9iEJMqdatq7rbh14nPhAbCyfg Account not found.
jt_getBalance address: 查询无效的地址: "inactiveAccounts[0].address" Bad account address: inactiveAccounts[0].address: Bad Base58 string: inactiveAccounts[0].address Account not found.
jt_sendTransaction 指定sequence为正整数之外的其他值:小数、负数、字符串等 Sequence number must be positive integer. invalid sequence

链的返回结果是否应该和现有版本的返回结果保持一致?我觉得新链应该向现有版本靠拢,保持一致。

zyd82 commented 4 years ago

如果井通现有版本的返回信息准确无误的话,建议新版还是跟现有版本保持一致,这样有一定的兼容性。

foreso-GitHub commented 4 years ago

旧链的错误名称和说明这里有,可以参考 https://swtcdoc.netlify.com/docs/swtclib/#errors