alephium / alephium-frontend

A monorepo containing all things frontend on Alephium.
Other
14 stars 13 forks source link

[DW] Fix UTXO consolidation error handling. #119

Closed nop33 closed 11 months ago

nop33 commented 1 year ago

A user on Discord was looking for help because they received an error:

image

First of all, it is not acceptable to display errors like this, they provide 0 value. Thankfully, some of our Discord superhero helped the user to figure out their problem. The user needed to do a UTXO consolidation first.

Secondly, it seems that our error handling for UTXO consolidation does not work on v2.1.5.

nop33 commented 1 year ago

It appears that the consolidation modal is properly displayed.

I tested it using the following code. In summary:

  1. I built 5 transaction, each containing 135 UTXOs with 0.01 ALPH in each
  2. I sent all 5 transactions and waited until they got confirmed
  3. Now, with 675 available to my address, I used the normal transfer send flow to send some funds to another address and I correctly got the popup
for (let i = 0; i < 5; i++) {
  const unsignedTxData = await client.node.transactions.postTransactionsBuild({
    fromPublicKey: address.publicKey,
    destinations: Array.from({ length: 135 }, () => ({
      address: '18xPARoYPLBGF7CPKZCaT6yyvfZ2hwujT3eY6haRhomvq',
      attoAlphAmount: '1000000000000000'
    }))
  })

  const signature = await signAndSendTransaction(address, unsignedTxData.txId, unsignedTxData.unsignedTx)
  console.log('signature', signature)
}
nop33 commented 1 year ago

This is the commit that fixes the bug: 7851994e8

It will be included in the next release.

nop33 commented 11 months ago

It's merged in master, so closing.