Skip to content

Commit

Permalink
modify buildAndAuthorize protobuf definition
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei authored and conorsch committed Jan 18, 2024
1 parent cad3d2a commit 5be65ed
Show file tree
Hide file tree
Showing 5 changed files with 969 additions and 1,010 deletions.
5 changes: 0 additions & 5 deletions crates/proto/src/gen/penumbra.view.v1alpha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ pub struct AuthorizeAndBuildRequest {
pub transaction_plan: ::core::option::Option<
super::super::core::transaction::v1alpha1::TransactionPlan,
>,
/// The authorization data to use to authorize the transaction plan.
#[prost(message, optional, tag = "2")]
pub authorization_data: ::core::option::Option<
super::super::core::transaction::v1alpha1::AuthorizationData,
>,
}
impl ::prost::Name for AuthorizeAndBuildRequest {
const NAME: &'static str = "AuthorizeAndBuildRequest";
Expand Down
18 changes: 0 additions & 18 deletions crates/proto/src/gen/penumbra.view.v1alpha1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,16 +645,10 @@ impl serde::Serialize for AuthorizeAndBuildRequest {
if self.transaction_plan.is_some() {
len += 1;
}
if self.authorization_data.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("penumbra.view.v1alpha1.AuthorizeAndBuildRequest", len)?;
if let Some(v) = self.transaction_plan.as_ref() {
struct_ser.serialize_field("transactionPlan", v)?;
}
if let Some(v) = self.authorization_data.as_ref() {
struct_ser.serialize_field("authorizationData", v)?;
}
struct_ser.end()
}
}
Expand All @@ -667,14 +661,11 @@ impl<'de> serde::Deserialize<'de> for AuthorizeAndBuildRequest {
const FIELDS: &[&str] = &[
"transaction_plan",
"transactionPlan",
"authorization_data",
"authorizationData",
];

#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TransactionPlan,
AuthorizationData,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
Expand All @@ -697,7 +688,6 @@ impl<'de> serde::Deserialize<'de> for AuthorizeAndBuildRequest {
{
match value {
"transactionPlan" | "transaction_plan" => Ok(GeneratedField::TransactionPlan),
"authorizationData" | "authorization_data" => Ok(GeneratedField::AuthorizationData),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
Expand All @@ -718,7 +708,6 @@ impl<'de> serde::Deserialize<'de> for AuthorizeAndBuildRequest {
V: serde::de::MapAccess<'de>,
{
let mut transaction_plan__ = None;
let mut authorization_data__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TransactionPlan => {
Expand All @@ -727,17 +716,10 @@ impl<'de> serde::Deserialize<'de> for AuthorizeAndBuildRequest {
}
transaction_plan__ = map_.next_value()?;
}
GeneratedField::AuthorizationData => {
if authorization_data__.is_some() {
return Err(serde::de::Error::duplicate_field("authorizationData"));
}
authorization_data__ = map_.next_value()?;
}
}
}
Ok(AuthorizeAndBuildRequest {
transaction_plan: transaction_plan__,
authorization_data: authorization_data__,
})
}
}
Expand Down
Binary file modified crates/proto/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
Loading

0 comments on commit 5be65ed

Please sign in to comment.