archethic-foundation / archethic-wallet

Archethic Wallet
GNU Affero General Public License v3.0
57 stars 25 forks source link

signTransaction does not handle Tx v3 format #1165

Open Chralu opened 5 days ago

Chralu commented 5 days ago

Describe the problem you discovered

Signing transactions through RPC does not handle TX v3 format.

Because of this, signing v3 transactions from libjs returns an 'Invalid format' error.

v2 format

{
  type: String,
  version: int,
  data: {
    // ...
    recipients: List<String>
  }
}

v3 format

{
  type: String,
  version: int,
  data: {
    // ...
    recipients: List<{
        action: String?,
        address: String?,
        args: List<{}>?
    }>
  }
}

Describe the solution you'd like

There are multiple solutions.

  1. accept v3 transactions only (acceptable because v2 isn't used anymore)
  2. add an automatic v2 to v3 conversion when parsing RPC command

Epic

No response

redDwarf03 commented 2 days ago

And why we have SignTransactionConfirmationFormState naming in send_transaction rpc_command_receiver ?

Chralu commented 18 hours ago

And why we have SignTransactionConfirmationFormState naming in send_transaction rpc_command_receiver ?

This looks like a mistake 😓