Sort ranked collectives (#8411)

This commit is contained in:
Jaco 2022-11-24 18:00:57 +02:00 committed by GitHub
parent 68ddb37135
commit c4e717ab2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ const OPT_MEM = {
const members = infos
.map((info, i) => [info.unwrapOr(null), ids[i]])
.filter((r): r is [PalletRankedCollectiveMemberRecord, AccountId32] => !!r[0])
.sort(([a], [b]) => b.rank.cmp(a.rank))
.map(([info, accountId]): Member => ({
accountId: accountId.toString(),
info