Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel committed Nov 16, 2023
1 parent dd42dbe commit 8fb4204
Showing 1 changed file with 22 additions and 41 deletions.
63 changes: 22 additions & 41 deletions hooks/queries/governancePower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ export const useGovernancePowerAsync = (
plugin === undefined
? undefined
: realmPk &&
TOR &&
(plugin === 'vanilla'
? getVanillaGovpower(connection, TOR)
: plugin === 'NFT'
TOR &&
(plugin === 'vanilla'
? getVanillaGovpower(connection, TOR)
: plugin === 'NFT'
? getNftGovpower(connection, realmPk, TOR)
: plugin === 'VSR'
? actingAsWalletPk
? (await getVsrGovpower(connection, realmPk, actingAsWalletPk))
? actingAsWalletPk
? (await getVsrGovpower(connection, realmPk, actingAsWalletPk))
.result ?? new BN(0)
: undefined
: plugin === 'HeliumVSR'
Expand Down Expand Up @@ -258,42 +258,23 @@ export const useLegacyVoterWeight = () => {
? new VoteRegistryVoterWeight(
communityTOR.result,
councilTOR?.result,
new BN(1000000000000000) // FIX ME
(await getVsrGovpower(connection, realmPk, actingAsWalletPk))
.result ?? new BN(0)
)
: plugin === 'NFT'
? communityTOR.result?.pubkey
? new VoteNftWeight(
communityTOR.result,
councilTOR?.result,
await getNftGovpower(
connection,
realmPk,
communityTOR.result.pubkey
)
)
: undefined
: plugin === 'VSR'
? actingAsWalletPk
? new VoteRegistryVoterWeight(
communityTOR.result,
councilTOR?.result,
(await getVsrGovpower(connection, realmPk, actingAsWalletPk))
.result ?? new BN(0)
)
: undefined
: plugin === 'HeliumVSR'
? new VoteRegistryVoterWeight(
communityTOR.result,
councilTOR?.result,
heliumVotingPower
)
: plugin === 'gateway'
? new SimpleGatedVoterWeight(
communityTOR.result,
councilTOR?.result,
gatewayVotingPower
)
: undefined),
: undefined
: plugin === 'HeliumVSR'
? new VoteRegistryVoterWeight(
communityTOR.result,
councilTOR?.result,
heliumVotingPower
)
: plugin === 'gateway'
? new SimpleGatedVoterWeight(
communityTOR.result,
councilTOR?.result,
gatewayVotingPower
)
: undefined),

[
actingAsWalletPk,
Expand Down

0 comments on commit 8fb4204

Please sign in to comment.