Skip to content

Commit

Permalink
nit; naming
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Feb 9, 2025
1 parent 741375f commit 873f840
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/proto/src/gen/penumbra.view.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ pub mod transaction_planner_request {
pub staked_note: ::core::option::Option<super::SpendableNoteRecord>,
/// The epoch index of the tournament.
#[prost(uint64, tag = "4")]
pub epoch_position: u64,
pub epoch_index: u64,
}
impl ::prost::Name for ActionLiquidityTournamentVote {
const NAME: &'static str = "ActionLiquidityTournamentVote";
Expand Down
26 changes: 13 additions & 13 deletions crates/proto/src/gen/penumbra.view.v1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7856,7 +7856,7 @@ impl serde::Serialize for transaction_planner_request::ActionLiquidityTournament
if self.staked_note.is_some() {
len += 1;
}
if self.epoch_position != 0 {
if self.epoch_index != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("penumbra.view.v1.TransactionPlannerRequest.ActionLiquidityTournamentVote", len)?;
Expand All @@ -7869,10 +7869,10 @@ impl serde::Serialize for transaction_planner_request::ActionLiquidityTournament
if let Some(v) = self.staked_note.as_ref() {
struct_ser.serialize_field("stakedNote", v)?;
}
if self.epoch_position != 0 {
if self.epoch_index != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("epochPosition", ToString::to_string(&self.epoch_position).as_str())?;
struct_ser.serialize_field("epochIndex", ToString::to_string(&self.epoch_index).as_str())?;
}
struct_ser.end()
}
Expand All @@ -7889,16 +7889,16 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
"rewardsRecipient",
"staked_note",
"stakedNote",
"epoch_position",
"epochPosition",
"epoch_index",
"epochIndex",
];

#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Incentivized,
RewardsRecipient,
StakedNote,
EpochPosition,
EpochIndex,
__SkipField__,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
Expand All @@ -7924,7 +7924,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
"incentivized" => Ok(GeneratedField::Incentivized),
"rewardsRecipient" | "rewards_recipient" => Ok(GeneratedField::RewardsRecipient),
"stakedNote" | "staked_note" => Ok(GeneratedField::StakedNote),
"epochPosition" | "epoch_position" => Ok(GeneratedField::EpochPosition),
"epochIndex" | "epoch_index" => Ok(GeneratedField::EpochIndex),
_ => Ok(GeneratedField::__SkipField__),
}
}
Expand All @@ -7947,7 +7947,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
let mut incentivized__ = None;
let mut rewards_recipient__ = None;
let mut staked_note__ = None;
let mut epoch_position__ = None;
let mut epoch_index__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Incentivized => {
Expand All @@ -7968,11 +7968,11 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
}
staked_note__ = map_.next_value()?;
}
GeneratedField::EpochPosition => {
if epoch_position__.is_some() {
return Err(serde::de::Error::duplicate_field("epochPosition"));
GeneratedField::EpochIndex => {
if epoch_index__.is_some() {
return Err(serde::de::Error::duplicate_field("epochIndex"));
}
epoch_position__ =
epoch_index__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
Expand All @@ -7985,7 +7985,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::ActionLiquidi
incentivized: incentivized__.unwrap_or_default(),
rewards_recipient: rewards_recipient__,
staked_note: staked_note__,
epoch_position: epoch_position__.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.
2 changes: 1 addition & 1 deletion proto/penumbra/penumbra/view/v1/view.proto
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ message TransactionPlannerRequest {
// The note containing the staked note used for voting.
SpendableNoteRecord staked_note = 3;
// The epoch index of the tournament.
uint64 epoch_position = 4;
uint64 epoch_index = 4;
}
}

Expand Down

0 comments on commit 873f840

Please sign in to comment.