Skip to content

Commit

Permalink
Add locked voter new escrow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Nov 20, 2024
1 parent e4e7f03 commit 2e63feb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ default CompletableFuture<List<AccountInfo<Proposal>>> fetchProposals(final Sola
final var accounts = jupiterAccounts();
final var governorKey = accounts.deriveGovernor().publicKey();
return rpcClient.getProgramAccounts(
jupiterAccounts().voteProgram(),
List.of(
Proposal.createGovernorFilter(governorKey)
),
jupiterAccounts().govProgram(),
List.of(Proposal.createGovernorFilter(governorKey)),
Proposal.FACTORY
);
}

Instruction newEscrow(final PublicKey escrowOwnerKey, final PublicKey payer);

default Instruction newEscrow(final PublicKey escrowOwnerKey) {
return newEscrow(escrowOwnerKey, escrowOwnerKey);
}

Instruction newVote(final PublicKey proposal,
final PublicKey payer,
final PublicKey voter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ public JupiterAccounts jupiterAccounts() {
return accounts;
}

@Override
public Instruction newEscrow(final PublicKey escrowOwnerKey, final PublicKey payer) {
final var lockerKey = accounts.deriveJupLocker().publicKey();
final var escrowKey = accounts.deriveEscrow(lockerKey, escrowOwnerKey).publicKey();
return LockedVoterProgram.newEscrow(
accounts.invokedGovProgram(),
lockerKey,
escrowKey,
escrowOwnerKey,
payer,
solanaAccounts.systemProgram()
);
}

@Override
public Instruction newVote(final PublicKey proposal,
final PublicKey payer,
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencyResolutionManagement {
}
versionCatalogs {
libs {
from("software.sava:solana-version-catalog:0.2.88")
from("software.sava:solana-version-catalog:0.2.90")
}
}
}

0 comments on commit 2e63feb

Please sign in to comment.