Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cjinghong committed May 24, 2024
1 parent 1e128b0 commit d8a4628
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions governance/src/hooks/airdrop/useAirdrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,30 @@ const getProof = (account: string) => {
const proofClaims = Object.keys(proof.claims).reduce((prev, address) => {
return {
...prev,
[address.toLowerCase()]: proof.claims[address]
}
}, proof.claims)
proof.claims = proofClaims
[address.toLowerCase()]: proof.claims[address],
};
}, proof.claims);
proof.claims = proofClaims;

const missedProof = isProduction()
? (ProofData2 as AirdropProof)
: (ProofTestnetData as AirdropProof);

// lowercased all claims
const missedProofClaims = Object.keys(missedProof.claims).reduce((prev, address) => {
return {
...prev,
[address.toLowerCase()]: missedProof.claims[address]
}
}, missedProof.claims)
missedProof.claims = missedProofClaims

const isMissedAccount = !Boolean(proof.claims[account.toLowerCase()]) && Boolean(missedProof.claims[account.toLowerCase()]);
const missedProofClaims = Object.keys(missedProof.claims).reduce(
(prev, address) => {
return {
...prev,
[address.toLowerCase()]: missedProof.claims[address],
};
},
missedProof.claims
);
missedProof.claims = missedProofClaims;

const isMissedAccount =
!Boolean(proof.claims[account.toLowerCase()]) &&
Boolean(missedProof.claims[account.toLowerCase()]);

return {
merkleProof: isMissedAccount ? missedProof : proof,
Expand Down

0 comments on commit d8a4628

Please sign in to comment.