Skip to content

Commit

Permalink
proto: sort includes in generated tendermint.rs
Browse files Browse the repository at this point in the history
This normalizes the content of the module for protocol updates.
  • Loading branch information
mzabaluev committed Sep 8, 2022
1 parent d9f6f3d commit 3c51c74
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
52 changes: 26 additions & 26 deletions proto/src/tendermint.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
//! Tendermint-proto auto-generated sub-modules for Tendermint
pub mod state {
include!("prost/tendermint.state.rs");
}

pub mod version {
include!("prost/tendermint.version.rs");
}

pub mod abci {
include!("prost/tendermint.abci.rs");
}

pub mod blocksync {
include!("prost/tendermint.blocksync.rs");
}

pub mod consensus {
include!("prost/tendermint.consensus.rs");
}
Expand All @@ -20,12 +16,22 @@ pub mod crypto {
include!("prost/tendermint.crypto.rs");
}

pub mod blocksync {
include!("prost/tendermint.blocksync.rs");
pub mod libs {
pub mod bits {
include!("prost/tendermint.libs.bits.rs");
}
}

pub mod types {
include!("prost/tendermint.types.rs");
pub mod mempool {
include!("prost/tendermint.mempool.rs");
}

pub mod p2p {
include!("prost/tendermint.p2p.rs");
}

pub mod privval {
include!("prost/tendermint.privval.rs");
}

pub mod rpc {
Expand All @@ -34,30 +40,24 @@ pub mod rpc {
}
}

pub mod libs {
pub mod bits {
include!("prost/tendermint.libs.bits.rs");
}
pub mod state {
include!("prost/tendermint.state.rs");
}

pub mod statesync {
include!("prost/tendermint.statesync.rs");
}

pub mod privval {
include!("prost/tendermint.privval.rs");
}

pub mod p2p {
include!("prost/tendermint.p2p.rs");
pub mod store {
include!("prost/tendermint.store.rs");
}

pub mod mempool {
include!("prost/tendermint.mempool.rs");
pub mod types {
include!("prost/tendermint.types.rs");
}

pub mod store {
include!("prost/tendermint.store.rs");
pub mod version {
include!("prost/tendermint.version.rs");
}

pub mod meta {
Expand Down
2 changes: 1 addition & 1 deletion tools/proto-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "tendermint-proto-compiler"
version = "0.1.0"
authors = ["Informal Systems <[email protected]>"]
edition = "2018"
edition = "2021"
publish = false

[dependencies]
Expand Down
6 changes: 4 additions & 2 deletions tools/proto-compiler/src/functions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
collections::BTreeSet,
fs::{copy, create_dir_all, remove_dir_all, File},
io::Write,
path::{Path, PathBuf},
Expand Down Expand Up @@ -217,8 +218,9 @@ pub fn generate_tendermint_lib(prost_dir: &PathBuf, tendermint_lib_target: &Path
&& e.file_name().to_str().unwrap().starts_with("tendermint.")
&& e.file_name().to_str().unwrap().ends_with(".rs")
})
.map(|d| d.file_name().to_str().unwrap().to_string())
.collect::<Vec<_>>();
.map(|d| d.file_name().to_str().unwrap().to_owned())
.collect::<BTreeSet<_>>();
let file_names = Vec::from_iter(file_names);

let mut content =
String::from("//! Tendermint-proto auto-generated sub-modules for Tendermint\n");
Expand Down

0 comments on commit 3c51c74

Please sign in to comment.