Skip to content

Commit

Permalink
lqt: make transaction planner request take only a single denom (#5091)
Browse files Browse the repository at this point in the history
## Describe your changes

Looking at the ongoing integration work in:
penumbra-zone/web#2041, the transaction planner
request for lqt votes can only make use of a single incentivized denom
anyways, which is what we want to support in the final ux, so having a
repeated field here that subsequently gets truncated to the first
provided value is superfluous. This change makes the field plain
instead.

This can be tested inside of that PR.

## Issue ticket number and link

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [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:

  > Affects clients only.
  • Loading branch information
cronokirby authored Feb 14, 2025
1 parent 08458e0 commit 466394b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/proto/src/gen/penumbra.view.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,8 @@ pub mod transaction_planner_request {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionLiquidityTournamentVote {
/// The asset the user wants to vote for.
#[prost(message, repeated, tag = "1")]
pub incentivized: ::prost::alloc::vec::Vec<
#[prost(message, optional, tag = "1")]
pub incentivized: ::core::option::Option<
super::super::super::core::asset::v1::Denom,
>,
/// The address the user wants potential rewards to go to.
Expand Down
10 changes: 5 additions & 5 deletions crates/proto/src/gen/penumbra.view.v1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7847,7 +7847,7 @@ impl serde::Serialize for transaction_planner_request::ActionLiquidityTournament
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.incentivized.is_empty() {
if self.incentivized.is_some() {
len += 1;
}
if self.rewards_recipient.is_some() {
Expand All @@ -7860,8 +7860,8 @@ impl serde::Serialize for transaction_planner_request::ActionLiquidityTournament
len += 1;
}
let mut struct_ser = serializer.serialize_struct("penumbra.view.v1.TransactionPlannerRequest.ActionLiquidityTournamentVote", len)?;
if !self.incentivized.is_empty() {
struct_ser.serialize_field("incentivized", &self.incentivized)?;
if let Some(v) = self.incentivized.as_ref() {
struct_ser.serialize_field("incentivized", v)?;
}
if let Some(v) = self.rewards_recipient.as_ref() {
struct_ser.serialize_field("rewardsRecipient", v)?;
Expand Down Expand Up @@ -7954,7 +7954,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
if incentivized__.is_some() {
return Err(serde::de::Error::duplicate_field("incentivized"));
}
incentivized__ = Some(map_.next_value()?);
incentivized__ = map_.next_value()?;
}
GeneratedField::RewardsRecipient => {
if rewards_recipient__.is_some() {
Expand Down Expand Up @@ -7982,7 +7982,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
}
}
Ok(transaction_planner_request::ActionLiquidityTournamentVote {
incentivized: incentivized__.unwrap_or_default(),
incentivized: incentivized__,
rewards_recipient: rewards_recipient__,
staked_notes: staked_notes__.unwrap_or_default(),
epoch_index: epoch_index__.unwrap_or_default(),
Expand Down
Binary file modified crates/proto/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
4 changes: 2 additions & 2 deletions proto/penumbra/penumbra/view/v1/view.proto
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ message TransactionPlannerRequest {

message ActionLiquidityTournamentVote {
// The asset the user wants to vote for.
repeated core.asset.v1.Denom incentivized = 1;
core.asset.v1.Denom incentivized = 1;
// The address the user wants potential rewards to go to.
core.keys.v1.Address rewards_recipient = 2;
// The note containing the staked note used for voting.
Expand Down Expand Up @@ -875,4 +875,4 @@ message LatestSwapsResponse {
uint64 block_height = 4;
// The hash of the transaction that was broadcast.
core.txhash.v1.TransactionId id = 5;
}
}

0 comments on commit 466394b

Please sign in to comment.