Skip to content

Commit

Permalink
fix vsr create token owner reocrd during grant, withdraw (#1789)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Aug 23, 2023
1 parent 81bafc9 commit 2424bc8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions VoteStakeRegistry/components/instructions/Grant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,14 @@ const Grant = ({
form.amount!,
form.governedTokenAccount.extensions.mint.account.decimals
)
//const currentTokenOwnerRecord = tokenRecords[form.destinationAccount]

const destinationTokenOwnerRecordPk = await getTokenOwnerRecordAddress(
realm.owner,
realm.pubkey,
realm.account.communityMint,
destinationAccount
)
const currentTokenOwnerRecord = queryClient.fetchQuery({
const currentTokenOwnerRecord = await queryClient.fetchQuery({
queryKey: tokenOwnerRecordQueryKeys.byPubkey(
connection.cluster,
destinationTokenOwnerRecordPk
Expand All @@ -180,7 +179,7 @@ const Grant = ({
),
})

if (!currentTokenOwnerRecord) {
if (!currentTokenOwnerRecord.found) {
await withCreateTokenOwnerRecord(
prerequisiteInstructions,
realm!.owner,
Expand Down
2 changes: 1 addition & 1 deletion VoteStakeRegistry/sdk/withCreateNewDeposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const withCreateNewDeposit = async ({
programVersion,
realmPk,
walletPk,
mintPk,
communityMintPk,
walletPk
)
}
Expand Down
2 changes: 1 addition & 1 deletion VoteStakeRegistry/sdk/withVoteRegistryWithdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const withVoteRegistryWithdraw = async ({
splProgramVersion,
realmPk,
walletPk,
mintPk,
communityMintPk,
walletPk
)
}
Expand Down

1 comment on commit 2424bc8

@vercel
Copy link

@vercel vercel bot commented on 2424bc8 Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

governance-ui – ./

governance-ui-git-main-solana-labs.vercel.app
governance-ui-solana-labs.vercel.app
app.realms.today

Please sign in to comment.