Skip to content

Commit

Permalink
view: add auction actions to TransactionPlannerRequest (#4269)
Browse files Browse the repository at this point in the history
## Describe your changes

This adds DA schedule/end/withdraw to the planner interface.

## Issue ticket number and link

## Checklist before requesting a review

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > Interface
  • Loading branch information
erwanor authored Apr 25, 2024
1 parent 1253187 commit ee6d9bc
Show file tree
Hide file tree
Showing 4 changed files with 502 additions and 2 deletions.
79 changes: 79 additions & 0 deletions crates/proto/src/gen/penumbra.view.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@ pub struct TransactionPlannerRequest {
pub position_withdraws: ::prost::alloc::vec::Vec<
transaction_planner_request::PositionWithdraw,
>,
#[prost(message, repeated, tag = "73")]
pub dutch_auction_schedule_actions: ::prost::alloc::vec::Vec<
transaction_planner_request::ActionDutchAuctionSchedule,
>,
#[prost(message, repeated, tag = "74")]
pub dutch_auction_end_actions: ::prost::alloc::vec::Vec<
transaction_planner_request::ActionDutchAuctionEnd,
>,
#[prost(message, repeated, tag = "75")]
pub dutch_auction_withdraw_actions: ::prost::alloc::vec::Vec<
transaction_planner_request::ActionDutchAuctionWithdraw,
>,
/// The epoch index of the transaction being planned.
#[deprecated]
#[prost(uint64, tag = "200")]
Expand Down Expand Up @@ -489,6 +501,73 @@ pub mod transaction_planner_request {
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionDutchAuctionSchedule {
/// The description of the auction to schedule.
#[prost(message, optional, tag = "1")]
pub description: ::core::option::Option<
super::super::super::core::component::auction::v1alpha1::DutchAuctionDescription,
>,
}
impl ::prost::Name for ActionDutchAuctionSchedule {
const NAME: &'static str = "ActionDutchAuctionSchedule";
const PACKAGE: &'static str = "penumbra.view.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.view.v1.TransactionPlannerRequest.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionDutchAuctionEnd {
/// The unique id of the auction to close.
#[prost(message, optional, tag = "1")]
pub auction_id: ::core::option::Option<
super::super::super::core::component::auction::v1alpha1::AuctionId,
>,
}
impl ::prost::Name for ActionDutchAuctionEnd {
const NAME: &'static str = "ActionDutchAuctionEnd";
const PACKAGE: &'static str = "penumbra.view.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.view.v1.TransactionPlannerRequest.{}", Self::NAME
)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionDutchAuctionWithdraw {
/// The auction to withdraw funds from.
#[prost(message, optional, tag = "1")]
pub auction_id: ::core::option::Option<
super::super::super::core::component::auction::v1alpha1::AuctionId,
>,
/// The sequence number of the withdrawal.
#[prost(uint64, tag = "2")]
pub seq: u64,
/// The auction's reserves of input asset
#[prost(message, optional, tag = "3")]
pub input_reserves: ::core::option::Option<
super::super::super::core::num::v1::Amount,
>,
/// The auction's reserves of output asset.
#[prost(message, optional, tag = "4")]
pub output_reserves: ::core::option::Option<
super::super::super::core::num::v1::Amount,
>,
}
impl ::prost::Name for ActionDutchAuctionWithdraw {
const NAME: &'static str = "ActionDutchAuctionWithdraw";
const PACKAGE: &'static str = "penumbra.view.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.view.v1.TransactionPlannerRequest.{}", Self::NAME
)
}
}
/// Specifies either that the planner should compute fees automatically or that it should use a fixed fee amount.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
Expand Down
Loading

0 comments on commit ee6d9bc

Please sign in to comment.