Zondax / ledger-oasis

Oasis app for Ledger Nano S and X
Apache License 2.0
3 stars 6 forks source link

Adjust confirmation flow for Registry Register Entity transactions #133

Closed tjanez closed 3 years ago

tjanez commented 3 years ago

To more closely match Oasis Node CLI's confirmation output and avoid showing unimportant fields, adjust the confirmation flow to:

  1. Type
  2. ID (use Base64 encoding to match what Oasis Core and what block explorers show).
  3. Nodes (if there are any) (use Base64 encoding to match what Oasis Core and what block explorers show).
  4. Fee
  5. Gas limit
  6. Genesis hash
  7. Approve

This will also make it follow the same pattern as other tx confirmation flows (#95, #107, #108, #125) and more logically follow the Oasis Node's CLI confirmation output (to be futher simplified and prettified), e.g.:

You are about to sign the following transaction:
  Method: registry.RegisterEntity
  Body:
    {
      "untrusted_raw_value": {
        "v": 2,
        "id": "l+cuboPsOeuY1+kYlROrpmKgiiELmXSw9xl0WEg8cWE="
      },
      "signature": {
        "public_key": "l+cuboPsOeuY1+kYlROrpmKgiiELmXSw9xl0WEg8cWE=",
        "signature": "ijDIwV72NpgiaSyR4rMfexdmtCfRh4VTBqkMeE8D7vSA/AtLMr9mgcr3k9PRlU96zreva0W7BqKsN1jM0aoKCA=="
      }
    }
  Nonce:  42
  Fee:
    Amount: 0.000002 ROSE
    Gas limit: 1000
    (gas price: 0.000000002 ROSE per gas unit)
Other info:
  Genesis document's hash: 53852332637bacb61b91b6411ab4095168ba02a50be4c3f82448438826f23898

You may need to review the transaction on your device if you use a hardware-based signer plugin...
emmanuelm41 commented 3 years ago

Closed on #134