Skip to content

Commit

Permalink
lqt: planner support
Browse files Browse the repository at this point in the history
  • Loading branch information
cronokirby committed Feb 8, 2025
1 parent a2953aa commit f7a3741
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion crates/view/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ use std::{
};

use anyhow::{Context, Result};
use penumbra_sdk_funding::liquidity_tournament::ActionLiquidityTournamentVotePlan;
use penumbra_sdk_sct::epoch::Epoch;
use rand::{CryptoRng, RngCore};
use rand_core::OsRng;
use tracing::instrument;

use crate::{SpendableNoteRecord, ViewClient};
use anyhow::anyhow;
use penumbra_sdk_asset::{asset, Value};
use penumbra_sdk_asset::{
asset::{self, Denom},
Value,
};
use penumbra_sdk_auction::auction::dutch::DutchAuctionDescription;
use penumbra_sdk_auction::auction::dutch::{actions::ActionDutchAuctionWithdrawPlan, DutchAuction};
use penumbra_sdk_auction::auction::{
Expand Down Expand Up @@ -477,6 +481,29 @@ impl<R: RngCore + CryptoRng> Planner<R> {
self
}

#[instrument(skip(self))]
pub fn lqt_vote(
&mut self,
epoch_index: u16,
incentivized: Denom,
rewards_recipient: Address,
notes: &[SpendableNoteRecord],
) -> &mut Self {
let start_position = tct::Position::from((epoch_index, 0, 0));
for note in notes {
self.action_list
.push(ActionLiquidityTournamentVotePlan::new(
&mut self.rng,
incentivized.clone(),
rewards_recipient.clone(),
note.note.clone(),
note.position,
start_position,
));
}
self
}

/// Prioritize notes to spend to release value of a specific transaction.
///
/// Various logic is possible for note selection. Currently, this method
Expand Down

0 comments on commit f7a3741

Please sign in to comment.