Skip to content

Commit

Permalink
proto: 🪟 DelegatorVoteView has opaque/visible variants
Browse files Browse the repository at this point in the history
Included DelegatorVoteView as an ActionView with Opaque and Visible
variants in proto documentation. This PR only changes the order of a
Protobuf Message definition for the purposes of documentation.
  • Loading branch information
ejmg authored and cratelyn committed May 9, 2024
1 parent 099e9ea commit 7e4e6b0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Binary file modified crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
6 changes: 3 additions & 3 deletions crates/proto/src/gen/penumbra.core.transaction.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl ::prost::Name for TransactionBodyView {
pub struct ActionView {
#[prost(
oneof = "action_view::ActionView",
tags = "1, 2, 3, 4, 16, 17, 18, 19, 20, 21, 22, 30, 31, 32, 34, 41, 42, 50, 51, 52, 53, 54, 55, 43, 200"
tags = "1, 2, 3, 4, 21, 16, 17, 18, 19, 20, 22, 30, 31, 32, 34, 41, 42, 50, 51, 52, 53, 54, 55, 43, 200"
)]
pub action_view: ::core::option::Option<action_view::ActionView>,
}
Expand All @@ -418,6 +418,8 @@ pub mod action_view {
Swap(super::super::super::component::dex::v1::SwapView),
#[prost(message, tag = "4")]
SwapClaim(super::super::super::component::dex::v1::SwapClaimView),
#[prost(message, tag = "21")]
DelegatorVote(super::super::super::component::governance::v1::DelegatorVoteView),
/// Action types without visible/opaque variants
#[prost(message, tag = "16")]
ValidatorDefinition(
Expand All @@ -434,8 +436,6 @@ pub mod action_view {
),
#[prost(message, tag = "20")]
ValidatorVote(super::super::super::component::governance::v1::ValidatorVote),
#[prost(message, tag = "21")]
DelegatorVote(super::super::super::component::governance::v1::DelegatorVoteView),
#[prost(message, tag = "22")]
ProposalDepositClaim(
super::super::super::component::governance::v1::ProposalDepositClaim,
Expand Down
28 changes: 14 additions & 14 deletions crates/proto/src/gen/penumbra.core.transaction.v1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,9 @@ impl serde::Serialize for ActionView {
action_view::ActionView::SwapClaim(v) => {
struct_ser.serialize_field("swapClaim", v)?;
}
action_view::ActionView::DelegatorVote(v) => {
struct_ser.serialize_field("delegatorVote", v)?;
}
action_view::ActionView::ValidatorDefinition(v) => {
struct_ser.serialize_field("validatorDefinition", v)?;
}
Expand All @@ -903,9 +906,6 @@ impl serde::Serialize for ActionView {
action_view::ActionView::ValidatorVote(v) => {
struct_ser.serialize_field("validatorVote", v)?;
}
action_view::ActionView::DelegatorVote(v) => {
struct_ser.serialize_field("delegatorVote", v)?;
}
action_view::ActionView::ProposalDepositClaim(v) => {
struct_ser.serialize_field("proposalDepositClaim", v)?;
}
Expand Down Expand Up @@ -968,6 +968,8 @@ impl<'de> serde::Deserialize<'de> for ActionView {
"swap",
"swap_claim",
"swapClaim",
"delegator_vote",
"delegatorVote",
"validator_definition",
"validatorDefinition",
"ibc_relay_action",
Expand All @@ -978,8 +980,6 @@ impl<'de> serde::Deserialize<'de> for ActionView {
"proposalWithdraw",
"validator_vote",
"validatorVote",
"delegator_vote",
"delegatorVote",
"proposal_deposit_claim",
"proposalDepositClaim",
"position_open",
Expand Down Expand Up @@ -1016,12 +1016,12 @@ impl<'de> serde::Deserialize<'de> for ActionView {
Output,
Swap,
SwapClaim,
DelegatorVote,
ValidatorDefinition,
IbcRelayAction,
ProposalSubmit,
ProposalWithdraw,
ValidatorVote,
DelegatorVote,
ProposalDepositClaim,
PositionOpen,
PositionClose,
Expand Down Expand Up @@ -1063,12 +1063,12 @@ impl<'de> serde::Deserialize<'de> for ActionView {
"output" => Ok(GeneratedField::Output),
"swap" => Ok(GeneratedField::Swap),
"swapClaim" | "swap_claim" => Ok(GeneratedField::SwapClaim),
"delegatorVote" | "delegator_vote" => Ok(GeneratedField::DelegatorVote),
"validatorDefinition" | "validator_definition" => Ok(GeneratedField::ValidatorDefinition),
"ibcRelayAction" | "ibc_relay_action" => Ok(GeneratedField::IbcRelayAction),
"proposalSubmit" | "proposal_submit" => Ok(GeneratedField::ProposalSubmit),
"proposalWithdraw" | "proposal_withdraw" => Ok(GeneratedField::ProposalWithdraw),
"validatorVote" | "validator_vote" => Ok(GeneratedField::ValidatorVote),
"delegatorVote" | "delegator_vote" => Ok(GeneratedField::DelegatorVote),
"proposalDepositClaim" | "proposal_deposit_claim" => Ok(GeneratedField::ProposalDepositClaim),
"positionOpen" | "position_open" => Ok(GeneratedField::PositionOpen),
"positionClose" | "position_close" => Ok(GeneratedField::PositionClose),
Expand Down Expand Up @@ -1132,6 +1132,13 @@ impl<'de> serde::Deserialize<'de> for ActionView {
return Err(serde::de::Error::duplicate_field("swapClaim"));
}
action_view__ = map_.next_value::<::std::option::Option<_>>()?.map(action_view::ActionView::SwapClaim)
;
}
GeneratedField::DelegatorVote => {
if action_view__.is_some() {
return Err(serde::de::Error::duplicate_field("delegatorVote"));
}
action_view__ = map_.next_value::<::std::option::Option<_>>()?.map(action_view::ActionView::DelegatorVote)
;
}
GeneratedField::ValidatorDefinition => {
Expand Down Expand Up @@ -1167,13 +1174,6 @@ impl<'de> serde::Deserialize<'de> for ActionView {
return Err(serde::de::Error::duplicate_field("validatorVote"));
}
action_view__ = map_.next_value::<::std::option::Option<_>>()?.map(action_view::ActionView::ValidatorVote)
;
}
GeneratedField::DelegatorVote => {
if action_view__.is_some() {
return Err(serde::de::Error::duplicate_field("delegatorVote"));
}
action_view__ = map_.next_value::<::std::option::Option<_>>()?.map(action_view::ActionView::DelegatorVote)
;
}
GeneratedField::ProposalDepositClaim => {
Expand Down
Binary file modified crates/proto/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ message ActionView {
component.shielded_pool.v1.OutputView output = 2;
component.dex.v1.SwapView swap = 3;
component.dex.v1.SwapClaimView swap_claim = 4;
component.governance.v1.DelegatorVoteView delegator_vote = 21;

// Action types without visible/opaque variants
component.stake.v1.ValidatorDefinition validator_definition = 16;
Expand All @@ -208,7 +209,6 @@ message ActionView {
component.governance.v1.ProposalSubmit proposal_submit = 18;
component.governance.v1.ProposalWithdraw proposal_withdraw = 19;
component.governance.v1.ValidatorVote validator_vote = 20;
component.governance.v1.DelegatorVoteView delegator_vote = 21;
component.governance.v1.ProposalDepositClaim proposal_deposit_claim = 22;

component.dex.v1.PositionOpen position_open = 30;
Expand Down

0 comments on commit 7e4e6b0

Please sign in to comment.