Merge pull request #5789 from vegaprotocol/fix/5677-gov-rewards-table
fix(governance): dont show all reward types in gov rewards table
This commit is contained in:
commit
9195bf8c91
@ -241,6 +241,16 @@ describe('generateEpochAssetRewardsList', () => {
|
|||||||
amount: '5',
|
amount: '5',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// This should not be included in the result
|
||||||
|
node: {
|
||||||
|
epoch: 2,
|
||||||
|
assetId: '3',
|
||||||
|
decimals: 18,
|
||||||
|
rewardType: AccountType.ACCOUNT_TYPE_REWARD_RETURN_VOLATILITY,
|
||||||
|
amount: '5',
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
epoch: {
|
epoch: {
|
||||||
|
@ -83,6 +83,12 @@ export const generateEpochTotalRewardsList = ({
|
|||||||
(Number(rewardItem?.amount) || 0) + Number(reward.amount)
|
(Number(rewardItem?.amount) || 0) + Number(reward.amount)
|
||||||
).toString();
|
).toString();
|
||||||
|
|
||||||
|
// only RowAccountTypes are relevant for this table, others should
|
||||||
|
// be discarded
|
||||||
|
if (!Object.keys(RowAccountTypes).includes(reward.rewardType)) {
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
rewards?.set(reward.rewardType, {
|
rewards?.set(reward.rewardType, {
|
||||||
rewardType: reward.rewardType,
|
rewardType: reward.rewardType,
|
||||||
amount,
|
amount,
|
||||||
|
Loading…
Reference in New Issue
Block a user