Skip to content

Commit

Permalink
proto: Remove serialization of Block and Evidence
Browse files Browse the repository at this point in the history
These are now handled on the domain types directly.
  • Loading branch information
mzabaluev committed Oct 25, 2022
1 parent 8dae679 commit f52b30b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions proto/src/prost/v0_34/tendermint.types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ pub struct EventDataRoundState {
pub step: ::prost::alloc::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Evidence {
#[prost(oneof="evidence::Sum", tags="1, 2")]
Expand All @@ -400,7 +399,6 @@ pub struct Evidence {
pub mod evidence {
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(tag = "type", content = "value")]
#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(message, tag="1")]
Expand Down Expand Up @@ -444,14 +442,11 @@ pub struct LightClientAttackEvidence {
#[prost(message, optional, tag="5")]
pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvidenceList {
#[prost(message, repeated, tag="1")]
#[serde(with = "crate::serializers::nullable")]
pub evidence: ::prost::alloc::vec::Vec<Evidence>,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
#[prost(message, optional, tag="1")]
Expand Down
5 changes: 0 additions & 5 deletions proto/src/prost/v0_37/tendermint.types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ pub struct EventDataRoundState {
pub step: ::prost::alloc::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Evidence {
#[prost(oneof="evidence::Sum", tags="1, 2")]
Expand All @@ -394,7 +393,6 @@ pub struct Evidence {
pub mod evidence {
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(tag = "type", content = "value")]
#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(message, tag="1")]
Expand Down Expand Up @@ -438,14 +436,11 @@ pub struct LightClientAttackEvidence {
#[prost(message, optional, tag="5")]
pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvidenceList {
#[prost(message, repeated, tag="1")]
#[serde(with = "crate::serializers::nullable")]
pub evidence: ::prost::alloc::vec::Vec<Evidence>,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
#[prost(message, optional, tag="1")]
Expand Down
5 changes: 0 additions & 5 deletions tools/proto-compiler/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const RENAME_SRPUBKEY: &str = r#"#[serde(rename = "tendermint/PubKeySr25519", wi
const RENAME_DUPLICATEVOTE: &str = r#"#[serde(rename = "tendermint/DuplicateVoteEvidence")]"#;
const RENAME_LIGHTCLIENTATTACK: &str =
r#"#[serde(rename = "tendermint/LightClientAttackEvidence")]"#;
const EVIDENCE_VARIANT: &str = r#"#[serde(from = "crate::serializers::evidence::EvidenceVariant", into = "crate::serializers::evidence::EvidenceVariant")]"#;
const ALIAS_VALIDATOR_POWER_QUOTED: &str =
r#"#[serde(alias = "ValidatorPower", with = "crate::serializers::from_str")]"#;
const ALIAS_TOTAL_VOTING_POWER_QUOTED: &str =
Expand All @@ -70,9 +69,7 @@ pub static CUSTOM_TYPE_ATTRIBUTES: &[(&str, &str)] = &[
(".tendermint.libs.bits.BitArray", SERIALIZED),
(".tendermint.types.EvidenceParams", SERIALIZED),
(".tendermint.types.BlockIDFlag", PRIMITIVE_ENUM),
(".tendermint.types.Block", SERIALIZED),
(".tendermint.types.Data", SERIALIZED),
(".tendermint.types.EvidenceList", SERIALIZED),
(".tendermint.types.Evidence", SERIALIZED),
(".tendermint.types.DuplicateVoteEvidence", SERIALIZED),
(".tendermint.types.Vote", SERIALIZED),
Expand All @@ -95,7 +92,6 @@ pub static CUSTOM_TYPE_ATTRIBUTES: &[(&str, &str)] = &[
(".tendermint.types.Validator", SERIALIZED),
(".tendermint.types.CanonicalVote", SERIALIZED),
(".tendermint.types.BlockMeta", SERIALIZED),
(".tendermint.types.Evidence", EVIDENCE_VARIANT),
(".tendermint.types.TxProof", SERIALIZED),
(".tendermint.crypto.Proof", SERIALIZED),
];
Expand Down Expand Up @@ -150,7 +146,6 @@ pub static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[
(".tendermint.types.Header.evidence_hash", HEXSTRING),
(".tendermint.types.Header.proposer_address", HEXSTRING),
(".tendermint.types.Data.txs", NULLABLEVECARRAY),
(".tendermint.types.EvidenceList.evidence", NULLABLE),
(".tendermint.types.Commit.height", QUOTED),
(".tendermint.types.Commit.signatures", NULLABLE),
(".tendermint.types.CommitSig.validator_address", HEXSTRING),
Expand Down

0 comments on commit f52b30b

Please sign in to comment.