caivega / ipfslib

Other
2 stars 1 forks source link

S3 - 井通新链和井通现有版本的兼容性问题:getAccount返回信息不一致 #81

Open foreso-GitHub opened 4 years ago

foreso-GitHub commented 4 years ago
  1. 执行getAccount请求(新链是jt_getAccount,现有版本是requestAccountInfo)

  2. 新链返回结果:

    { id: 1,
    jsonrpc: '2.0',
    result:
    { Account: 'jP6qtKENk7dFqkk9R5gbzoR3doPbeThujj',
     Balance: '10000100003',
     Hash:
      '0000000000000000000000000000000000000000000000000000000000000000',
     LedgerEntryType: 'AccountRoot',
     Sequence: 1 },
    status: 'success' }
  3. 现有版本返回结果:

    { account_data:
    { Account: 'jP6qtKENk7dFqkk9R5gbzoR3doPbeThujj',
     Balance: '131000000',
     Flags: 0,
     LedgerEntryType: 'AccountRoot',
     OwnerCount: 0,
     PreviousTxnID:
      'B82333EAB2048809F6D492E436637483947D93873D9A31443982D449772142BA',
     PreviousTxnLgrSeq: 15270107,
     Sequence: 1,
     index:
      '379A4D0D481432EDF7EAE5C2A30E0F4185A1336ED9834313EDA1DC42004BF2C7' },
    ledger_hash:
    'C81750CAA8AE3B0B9C36B04988E22A497A4837A70F31A1FCB2DE17D745978E28',
    ledger_index: 15276633,
    validated: true }

    现有版本比新链返回更多的信息。 需要讨论,新链的返回结果是否应该和现有版本的返回结果保持一致?我个人觉得应该保持一致。

foreso-GitHub commented 4 years ago

经过讨论,sendTx返回信息格式如下:

{"id":1,"jsonrpc":"2.0","status":"success","result":{"engine_result":"tesSUCCESS","engine_result_code":0,"engine_result_message":"The transaction was applied. Only final in a validated ledger.","hash": "76B85E6C19C9738E55B4F0ED71D0686DC6BAC33321B53569B5337927CE8048B7"}}}

就是sendTx返回信息包括5个内容:

tx_blob和tx_json可以通过诸如jt_sign和jt_getTransactionByHash等方式获取,为节约带宽,不在这里返回。

foreso-GitHub commented 4 years ago

相关issue:https://github.com/caivega/ipfslib/issues/82