Skip to content

Commit

Permalink
Merge pull request #3057 from dusk-network/feature-3056
Browse files Browse the repository at this point in the history
web-wallet: Fix incorrect fee deduction (Allocate flow)
  • Loading branch information
nortonandreev authored Nov 26, 2024
2 parents f2ae2ef + a9d4d9f commit 0b4d723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix inconsistent terminology usage for "Mnemonic Phrase" [#3035]
- Fix auto-sync not working after restoring a wallet [#3042]
- Fix application crash on empty amount (Stake Flow) [#3036]
- Fix incorrect fee deduction and negative UI display (Allocate flow) [#3056]

## [0.8.0] - 2024-11-19

Expand Down Expand Up @@ -375,6 +376,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#3035]: https://github.com/dusk-network/rusk/issues/3035
[#3036]: https://github.com/dusk-network/rusk/issues/3036
[#3042]: https://github.com/dusk-network/rusk/issues/3042
[#3056]: https://github.com/dusk-network/rusk/issues/3056

<!-- VERSIONS -->

Expand Down
11 changes: 4 additions & 7 deletions web-wallet/src/lib/components/Allocate/Allocate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
if (difference !== 0n) {
const transactionInfo = isShielding
? await walletStore.shield(difference - fee, gas)
: await walletStore.unshield(-difference - fee, gas);
? await walletStore.shield(difference, gas)
: await walletStore.unshield(-difference, gas);
return transactionInfo.hash;
}
Expand Down Expand Up @@ -276,9 +276,7 @@
</dt>
<dd class="review-transaction__value operation__review-amount">
<span>
{isShielding
? `${formatter(luxToDusk(unshieldedBalance - unshielded - fee))} DUSK`
: `${formatter(luxToDusk(shieldedBalance - shielded - fee))} DUSK`}
{`${formatter(luxToDusk(isShielding ? difference : -difference))} DUSK`}
</span>
<Icon
className="dusk-amount__icon"
Expand Down Expand Up @@ -319,8 +317,7 @@
<p>
The fee will be deducted from your <b
>{isUnshielding ? "shielded" : "public"}</b
> balance, with the maximum estimated fee reserved before allocation.
This guarantees sufficient coverage for the transaction.
> balance.
</p>
</Banner>
</div>
Expand Down

0 comments on commit 0b4d723

Please sign in to comment.