polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.75k stars 1.55k forks source link

extrinsics: wrong hex-encoded call interpretation from Decode tab #10038

Open ukint-vs opened 12 months ago

ukint-vs commented 12 months ago

There is a bug occured when I decoded tx with Nay vote and switched to Submission tab and the vote became Aye.

Example tx for Polkadot: Nay vote: 0x140000000000000000000000000000000000000000

image

You can see that encoding details is changed to Aye value.

image

And in js api this snippet returns the same txs:

const tx = api.tx.convictionVoting.vote(1, {
        Standard: {
          vote: {
            aye: false,
            conviction: '',
          },
          balance: 0,
        },
      });

    console.log(tx.method.args[1].toHuman())
    console.log(api.tx(tx.toHex()).method.args[1].toHuman())
{
  Standard: { vote: { conviction: 'None', vote: 'Nay' }, balance: '0' }
}
{
  Standard: { vote: { conviction: 'None', vote: 'Nay' }, balance: '0' }
}

It should be Nay in the Submission tab. For now it defaults to Aye value.

This bug may result in the wrong tx being accidentally sent.

EugenWay commented 11 months ago

@jacogr can you check please this behaivor 😭