From 75602359fe6cd52426d113c033f03c48320d1bae Mon Sep 17 00:00:00 2001 From: solanoe Date: Wed, 3 Apr 2024 08:55:24 -0300 Subject: [PATCH] randomize funder and treasury selection a bit --- frontend/claim_sdk/treasury.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/frontend/claim_sdk/treasury.ts b/frontend/claim_sdk/treasury.ts index 46c0509e..cda464e1 100644 --- a/frontend/claim_sdk/treasury.ts +++ b/frontend/claim_sdk/treasury.ts @@ -21,12 +21,7 @@ export const funders = [ ] export function getClaimPayers(claimInfo: ClaimInfo): [PublicKey, PublicKey] { - const buffer = claimInfo.toBuffer() - const toHex = buffer.toString('hex') - const toNumber = parseInt(toHex, 16) - const funderIndex = toNumber % funders.length + const selectedIndex = Math.floor(Math.random() * funders.length) - const treasuryIndex = toNumber % treasuries.length - - return [funders[funderIndex], treasuries[treasuryIndex]] + return [funders[selectedIndex], treasuries[selectedIndex]] }