Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto(view): deprecate start_epoch_index #4119

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
4 changes: 4 additions & 0 deletions crates/proto/src/gen/penumbra.view.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ pub mod transaction_planner_request {
super::super::super::core::keys::v1::IdentityKey,
>,
/// The epoch in which unbonding began, used to verify the penalty.
#[deprecated]
#[prost(uint64, tag = "2")]
pub start_epoch_index: u64,
/// The penalty applied to undelegation, in bps^2 (10e-8).
Expand All @@ -355,6 +356,9 @@ pub mod transaction_planner_request {
pub unbonding_amount: ::core::option::Option<
super::super::super::core::num::v1::Amount,
>,
/// The height at which unbonding began.
#[prost(uint64, tag = "5")]
pub unbonding_start_height: u64,
}
impl ::prost::Name for UndelegateClaim {
const NAME: &'static str = "UndelegateClaim";
Expand Down
21 changes: 21 additions & 0 deletions crates/proto/src/gen/penumbra.view.v1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7038,6 +7038,9 @@ impl serde::Serialize for transaction_planner_request::UndelegateClaim {
if self.unbonding_amount.is_some() {
len += 1;
}
if self.unbonding_start_height != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("penumbra.view.v1.TransactionPlannerRequest.UndelegateClaim", len)?;
if let Some(v) = self.validator_identity.as_ref() {
struct_ser.serialize_field("validatorIdentity", v)?;
Expand All @@ -7052,6 +7055,10 @@ impl serde::Serialize for transaction_planner_request::UndelegateClaim {
if let Some(v) = self.unbonding_amount.as_ref() {
struct_ser.serialize_field("unbondingAmount", v)?;
}
if self.unbonding_start_height != 0 {
#[allow(clippy::needless_borrow)]
struct_ser.serialize_field("unbondingStartHeight", ToString::to_string(&self.unbonding_start_height).as_str())?;
}
struct_ser.end()
}
}
Expand All @@ -7069,6 +7076,8 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::UndelegateCla
"penalty",
"unbonding_amount",
"unbondingAmount",
"unbonding_start_height",
"unbondingStartHeight",
];

#[allow(clippy::enum_variant_names)]
Expand All @@ -7077,6 +7086,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::UndelegateCla
StartEpochIndex,
Penalty,
UnbondingAmount,
UnbondingStartHeight,
__SkipField__,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
Expand All @@ -7103,6 +7113,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::UndelegateCla
"startEpochIndex" | "start_epoch_index" => Ok(GeneratedField::StartEpochIndex),
"penalty" => Ok(GeneratedField::Penalty),
"unbondingAmount" | "unbonding_amount" => Ok(GeneratedField::UnbondingAmount),
"unbondingStartHeight" | "unbonding_start_height" => Ok(GeneratedField::UnbondingStartHeight),
_ => Ok(GeneratedField::__SkipField__),
}
}
Expand All @@ -7126,6 +7137,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::UndelegateCla
let mut start_epoch_index__ = None;
let mut penalty__ = None;
let mut unbonding_amount__ = None;
let mut unbonding_start_height__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ValidatorIdentity => {
Expand Down Expand Up @@ -7154,6 +7166,14 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::UndelegateCla
}
unbonding_amount__ = map_.next_value()?;
}
GeneratedField::UnbondingStartHeight => {
if unbonding_start_height__.is_some() {
return Err(serde::de::Error::duplicate_field("unbondingStartHeight"));
}
unbonding_start_height__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::__SkipField__ => {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Expand All @@ -7164,6 +7184,7 @@ impl<'de> serde::Deserialize<'de> for transaction_planner_request::UndelegateCla
start_epoch_index: start_epoch_index__.unwrap_or_default(),
penalty: penalty__,
unbonding_amount: unbonding_amount__,
unbonding_start_height: unbonding_start_height__.unwrap_or_default(),
})
}
}
Expand Down
Binary file modified crates/proto/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
4 changes: 3 additions & 1 deletion proto/penumbra/penumbra/view/v1/view.proto
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,15 @@ message TransactionPlannerRequest {
// The identity key of the validator to finish undelegating from.
core.keys.v1.IdentityKey validator_identity = 1;
// The epoch in which unbonding began, used to verify the penalty.
uint64 start_epoch_index = 2;
uint64 start_epoch_index = 2 [deprecated = true];
// The penalty applied to undelegation, in bps^2 (10e-8).
// In the happy path (no slashing), this is 0.
core.component.stake.v1.Penalty penalty = 3;
// The amount of unbonding tokens to claim.
// This is a bare number because its denom is determined by the preceding data.
core.num.v1.Amount unbonding_amount = 4;
// The height at which unbonding began.
uint64 unbonding_start_height = 5;
}
message PositionOpen {
// Contains the data defining the position, sufficient to compute its `PositionId`.
Expand Down
Loading