fix: assert that Monero address pool sums to one

This commit is contained in:
Binarybaron 2025-06-25 19:42:55 +02:00
parent a48652328c
commit e73a418cd2
6 changed files with 26 additions and 7 deletions

View file

@ -55,7 +55,7 @@ export default function XmrRedeemInMempoolPage(
color: theme.palette.text.primary,
})}
>
{pool.label} ({pool.percentage}%)
{pool.label} ({pool.percentage * 100}%)
</Typography>
</Box>
<Typography

View file

@ -133,7 +133,7 @@ export default function HistoryRowExpanded({
color: theme.palette.text.primary,
})}
>
{pool.label} ({pool.percentage}%)
{pool.label} ({pool.percentage * 100}%)
</Typography>
<Typography
variant="caption"

View file

@ -186,12 +186,12 @@ export async function buyXmr(
address_pool.push(
{
address: monero_receive_address,
percentage: 100 - donation_percentage * 100,
percentage: 1 - donation_percentage,
label: "Your wallet",
},
{
address: donation_address,
percentage: donation_percentage * 100,
percentage: donation_percentage,
label: "Tip to the developers",
},
);