Skip to content

Commit

Permalink
Create council proposal for new wallet if inactive VWR
Browse files Browse the repository at this point in the history
  • Loading branch information
0xShuk authored Oct 24, 2024
1 parent 21cd1bd commit e132567
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions hub/components/NewWallet/useNewWalletTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,24 @@ const useNewWalletCallback = (
if (!wallet?.publicKey) throw new Error('not signed in');
if (tokenOwnerRecord === undefined)
throw new Error('insufficient voting power');
if (!voterWeightPk)
throw new Error('voterWeightPk not found for current wallet');

const config = await rules2governanceConfig(
connection.current,
realm.pubkey,
rules,
);

const instructions: TransactionInstruction[] = [];
const createNftTicketsIxs: TransactionInstruction[] = [];

const { pre: preIx, post: postIx } = await updateVoterWeightRecords(
wallet.publicKey,
convertTypeToVoterWeightAction('createGovernance'),
);
instructions.push(...preIx);
createNftTicketsIxs.push(...postIx);

if (voterWeightPk) {
const instructions: TransactionInstruction[] = [];
const createNftTicketsIxs: TransactionInstruction[] = [];

const { pre: preIx, post: postIx } = await updateVoterWeightRecords(
wallet.publicKey,
convertTypeToVoterWeightAction('createGovernance'),
);
instructions.push(...preIx);
createNftTicketsIxs.push(...postIx);
}
const governanceAddress = await withCreateGovernance(
instructions,
realm.owner,
Expand Down

0 comments on commit e132567

Please sign in to comment.