Skip to content

Commit

Permalink
Merge branch 'main' into fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cctdaniel authored Nov 16, 2023
2 parents ef25a26 + 69a6565 commit dd42dbe
Showing 1 changed file with 41 additions and 22 deletions.
63 changes: 41 additions & 22 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,23 +258,42 @@ export const useLegacyVoterWeight = () => {
? new VoteRegistryVoterWeight(
communityTOR.result,
councilTOR?.result,
(await getVsrGovpower(connection, realmPk, actingAsWalletPk))
.result ?? new BN(0)
new BN(1000000000000000) // FIX ME
)
: undefined
: plugin === 'HeliumVSR'
? new VoteRegistryVoterWeight(
communityTOR.result,
councilTOR?.result,
heliumVotingPower
)
: plugin === 'gateway'
? new SimpleGatedVoterWeight(
communityTOR.result,
councilTOR?.result,
gatewayVotingPower
)
: undefined),
: 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),

[
actingAsWalletPk,
Expand Down

0 comments on commit dd42dbe

Please sign in to comment.