chore: replace toHuman() with toBoolArray() for availability votes (#12022)

This commit is contained in:
rajk93 2025-11-25 10:29:17 +05:30 committed by GitHub
parent 8b6886b785
commit 5c8ac7b0b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,12 +74,9 @@ function Parachain ({ bestNumber, className = '', id, lastBacked, lastInclusion,
useEffect((): void => {
if (sessionValidators) {
if (paraInfo.pendingAvail) {
const list = paraInfo.pendingAvail.availabilityVotes.toHuman()
.slice(2)
.replace(/_/g, '')
.split('')
.map((c, index) => c === '0' ? sessionValidators[index] : null)
.filter((v, index): v is AccountId => !!v && index < sessionValidators.length);
const list = paraInfo.pendingAvail.availabilityVotes.toBoolArray()
.map((voted, index) => !voted && index < sessionValidators.length ? sessionValidators[index] : null)
.filter((v): v is AccountId => !!v);
list.length !== sessionValidators.length && setNonBacked(list);
} else {