Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Apr 24, 2024
1 parent a3bdc7f commit a3c444b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions crates/bin/pcli/src/command/query/auction.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
use crate::App;
use anyhow::Context;
use clap::Subcommand;
use penumbra_asset::{asset, Value};
use penumbra_auction::auction::AuctionId;
use penumbra_keys::keys::AddressIndex;
use penumbra_num::Amount;
use penumbra_proto::view::v1::GasPricesRequest;
use penumbra_view::ViewClient;
use penumbra_wallet::plan::Planner;
use rand_core::OsRng;

#[derive(Debug, Subcommand)]
pub enum AuctionCmd {
/// Commands related to Dutch auctions
#[clap(display_order = 100, subcommand)]
Dutch(DutchCmd),
}

/// Commands related to querying Dutch auctions.
#[derive(Debug, Subcommand)]
pub enum DutchCmd {
/// Withdraws the reserves of the Dutch auction.
#[clap(display_order = 100, name = "id")]
DutchAuctionQueryId {
/// The auction to withdraw funds from.
#[clap(long, display_order = 100)]
auction_id: String,
},
}

impl DutchCmd {
/// Process the command by performing the appropriate action.
pub async fn exec(&self, app: &mut App) -> anyhow::Result<()> {
match self {
DutchCmd::DutchAuctionQueryId { auction_id } => {
let auction_id = auction_id.parse::<AuctionId>()?;

// Query stateful auction information from view server
let client = app.view().auctions_by_id(auction_id).await?;

let dutch_auction = &client[0];

println!(
"Dutch auction description and state: {:?} and {:?}",
dutch_auction.description, dutch_auction.state
);
}
}
Ok(())
}
}

0 comments on commit a3c444b

Please sign in to comment.