Skip to content

Commit

Permalink
penumbra: regenerate protos
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Jan 26, 2024
1 parent 7f0ad0f commit 63781f2
Show file tree
Hide file tree
Showing 11 changed files with 1,398 additions and 1,401 deletions.
16 changes: 0 additions & 16 deletions crates/proto/src/gen/penumbra.core.component.chain.v1alpha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@ impl ::prost::Name for Ratio {
::prost::alloc::format!("penumbra.core.component.chain.v1alpha1.{}", Self::NAME)
}
}
/// Parameters for Fuzzy Message Detection
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FmdParameters {
#[prost(uint32, tag = "1")]
pub precision_bits: u32,
#[prost(uint64, tag = "2")]
pub as_of_block_height: u64,
}
impl ::prost::Name for FmdParameters {
const NAME: &'static str = "FmdParameters";
const PACKAGE: &'static str = "penumbra.core.component.chain.v1alpha1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("penumbra.core.component.chain.v1alpha1.{}", Self::NAME)
}
}
/// Chain-specific genesis content.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
115 changes: 0 additions & 115 deletions crates/proto/src/gen/penumbra.core.component.chain.v1alpha1.serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,121 +411,6 @@ impl<'de> serde::Deserialize<'de> for EpochByHeightResponse {
deserializer.deserialize_struct("penumbra.core.component.chain.v1alpha1.EpochByHeightResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FmdParameters {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.precision_bits != 0 {
len += 1;
}
if self.as_of_block_height != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("penumbra.core.component.chain.v1alpha1.FmdParameters", len)?;
if self.precision_bits != 0 {
struct_ser.serialize_field("precisionBits", &self.precision_bits)?;
}
if self.as_of_block_height != 0 {
#[allow(clippy::needless_borrow)]
struct_ser.serialize_field("asOfBlockHeight", ToString::to_string(&self.as_of_block_height).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FmdParameters {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"precision_bits",
"precisionBits",
"as_of_block_height",
"asOfBlockHeight",
];

#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PrecisionBits,
AsOfBlockHeight,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;

impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}

#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"precisionBits" | "precision_bits" => Ok(GeneratedField::PrecisionBits),
"asOfBlockHeight" | "as_of_block_height" => Ok(GeneratedField::AsOfBlockHeight),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FmdParameters;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct penumbra.core.component.chain.v1alpha1.FmdParameters")
}

fn visit_map<V>(self, mut map_: V) -> std::result::Result<FmdParameters, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut precision_bits__ = None;
let mut as_of_block_height__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PrecisionBits => {
if precision_bits__.is_some() {
return Err(serde::de::Error::duplicate_field("precisionBits"));
}
precision_bits__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::AsOfBlockHeight => {
if as_of_block_height__.is_some() {
return Err(serde::de::Error::duplicate_field("asOfBlockHeight"));
}
as_of_block_height__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(FmdParameters {
precision_bits: precision_bits__.unwrap_or_default(),
as_of_block_height: as_of_block_height__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("penumbra.core.component.chain.v1alpha1.FmdParameters", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GenesisContent {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ pub struct CompactBlock {
super::super::super::super::crypto::tct::v1alpha1::MerkleRoot,
>,
/// The epoch root of this epoch (only present when the block is the last in an epoch).
#[prost(message, optional, tag = "17")]
#[prost(message, optional, tag = "5")]
pub epoch_root: ::core::option::Option<
super::super::super::super::crypto::tct::v1alpha1::MerkleRoot,
>,
/// If a proposal started voting in this block, this is set to `true`.
#[prost(bool, tag = "20")]
#[prost(bool, tag = "6")]
pub proposal_started: bool,
/// Latest Fuzzy Message Detection parameters.
#[prost(message, optional, tag = "100")]
#[prost(message, optional, tag = "7")]
pub fmd_parameters: ::core::option::Option<
super::super::chain::v1alpha1::FmdParameters,
super::super::shielded_pool::v1alpha1::FmdParameters,
>,
/// Price data for swaps executed in this block.
#[prost(message, repeated, tag = "5")]
#[prost(message, repeated, tag = "8")]
pub swap_outputs: ::prost::alloc::vec::Vec<
super::super::dex::v1alpha1::BatchSwapOutputData,
>,
/// Indicates updated app parameters.
#[prost(bool, tag = "6")]
#[prost(bool, tag = "9")]
pub app_parameters_updated: bool,
/// Updated gas prices, if they have changed.
#[prost(message, optional, tag = "7")]
#[prost(message, optional, tag = "10")]
pub gas_prices: ::core::option::Option<super::super::fee::v1alpha1::GasPrices>,
}
impl ::prost::Name for CompactBlock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,24 @@ impl ::prost::Name for GenesisContent {
)
}
}
/// Parameters for Fuzzy Message Detection
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FmdParameters {
#[prost(uint32, tag = "1")]
pub precision_bits: u32,
#[prost(uint64, tag = "2")]
pub as_of_block_height: u64,
}
impl ::prost::Name for FmdParameters {
const NAME: &'static str = "FmdParameters";
const PACKAGE: &'static str = "penumbra.core.component.shielded_pool.v1alpha1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!(
"penumbra.core.component.shielded_pool.v1alpha1.{}", Self::NAME
)
}
}
/// Generated client implementations.
#[cfg(feature = "rpc")]
pub mod query_service_client {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,121 @@ impl<'de> serde::Deserialize<'de> for EventSpend {
deserializer.deserialize_struct("penumbra.core.component.shielded_pool.v1alpha1.EventSpend", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FmdParameters {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.precision_bits != 0 {
len += 1;
}
if self.as_of_block_height != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("penumbra.core.component.shielded_pool.v1alpha1.FmdParameters", len)?;
if self.precision_bits != 0 {
struct_ser.serialize_field("precisionBits", &self.precision_bits)?;
}
if self.as_of_block_height != 0 {
#[allow(clippy::needless_borrow)]
struct_ser.serialize_field("asOfBlockHeight", ToString::to_string(&self.as_of_block_height).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FmdParameters {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"precision_bits",
"precisionBits",
"as_of_block_height",
"asOfBlockHeight",
];

#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PrecisionBits,
AsOfBlockHeight,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;

impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}

#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"precisionBits" | "precision_bits" => Ok(GeneratedField::PrecisionBits),
"asOfBlockHeight" | "as_of_block_height" => Ok(GeneratedField::AsOfBlockHeight),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FmdParameters;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct penumbra.core.component.shielded_pool.v1alpha1.FmdParameters")
}

fn visit_map<V>(self, mut map_: V) -> std::result::Result<FmdParameters, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut precision_bits__ = None;
let mut as_of_block_height__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PrecisionBits => {
if precision_bits__.is_some() {
return Err(serde::de::Error::duplicate_field("precisionBits"));
}
precision_bits__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::AsOfBlockHeight => {
if as_of_block_height__.is_some() {
return Err(serde::de::Error::duplicate_field("asOfBlockHeight"));
}
as_of_block_height__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(FmdParameters {
precision_bits: precision_bits__.unwrap_or_default(),
as_of_block_height: as_of_block_height__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("penumbra.core.component.shielded_pool.v1alpha1.FmdParameters", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GenesisContent {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
Expand Down
2 changes: 1 addition & 1 deletion crates/proto/src/gen/penumbra.view.v1alpha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ impl ::prost::Name for FmdParametersRequest {
pub struct FmdParametersResponse {
#[prost(message, optional, tag = "1")]
pub parameters: ::core::option::Option<
super::super::core::component::chain::v1alpha1::FmdParameters,
super::super::core::component::shielded_pool::v1alpha1::FmdParameters,
>,
}
impl ::prost::Name for FmdParametersResponse {
Expand Down
Binary file modified crates/proto/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
Loading

0 comments on commit 63781f2

Please sign in to comment.