Skip to content

Conversation

@rajk93
Copy link
Contributor

@rajk93 rajk93 commented Dec 10, 2025

fixes #11445

Problem

The Bags-List page displayed incorrect min/max threshold values on chains where total issuance exceeds u64::MAX.

Solution

Implemented CurrencyToVote conversion to correctly display bag thresholds:

  1. Created useCurrencyToVote hook - Calculates the conversion factor based on total issuance:

    • If totalIssuance ≤ u64::MAX: factor = 1 (no conversion)
    • If totalIssuance > u64::MAX: factor = totalIssuance / u64::MAX
  2. Updated useBagsList - Applies conversion to bag thresholds before display:

    • Converts vote scores to currency amounts using toCurrency(voteScore)
    • Special handling for Westend Asset Hub which uses SaturatingCurrencyToVote (Ref PR #8307)

Preview

  1. Before Fix
Screenshot 2025-12-10 at 3 09 20 PM
  1. After fix
Screenshot 2025-12-10 at 2 03 21 PM

@rajk93 rajk93 marked this pull request as ready for review December 10, 2025 08:56
@rajk93 rajk93 self-assigned this Dec 10, 2025
@rajk93 rajk93 merged commit f667e65 into master Dec 11, 2025
5 checks passed
@rajk93 rajk93 deleted the rk/fix-min-max branch December 11, 2025 12:22
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Dec 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bags-List shows wrong values for min/max

5 participants