Skip to content

Commit

Permalink
Changed feature name
Browse files Browse the repository at this point in the history
  • Loading branch information
FloppyDisck committed Jun 6, 2024
1 parent aa249b9 commit 5d4220e
Show file tree
Hide file tree
Showing 34 changed files with 100 additions and 92 deletions.
2 changes: 1 addition & 1 deletion packages/proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ grpc = ["tonic", "tendermint-proto/grpc"]
cosmwasm = []
proto-descriptor = []
# Replaces all structs that use Any with a generic type
replace-any = []
abstract-any = []

[package.metadata.docs.rs]
all-features = true
Expand Down
174 changes: 87 additions & 87 deletions packages/proto/src/gen/mod.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![forbid(unsafe_code)]
#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)]

#[cfg(feature = "replace-any")]
#[cfg(feature = "abstract-any")]
pub mod any;

mod gen;
Expand Down
8 changes: 8 additions & 0 deletions proto-build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Proto Build

## Setup
### Buf
Head over to https://buf.build and install buf v1.31.0

# Generating Protos
Now simply run ``cargo run -p proto-build``
6 changes: 3 additions & 3 deletions proto-build/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ fn save(out_dir: &str, files: &BTreeMap<String, (File, BTreeMap<String, usize>)>
for (file, (data, _)) in files.iter() {
// Patch the mod file
let file_regex = Regex::new(r"(\.[[:alnum:]]+\.)rs").unwrap();
let new_file = file_regex.replace(file, "${1}advanced.rs").to_string();
let new_file = file_regex.replace(file, "${1}abstract.rs").to_string();

patch_file(
format!("{}/mod.rs", out_dir),
Expand All @@ -502,9 +502,9 @@ fn save(out_dir: &str, files: &BTreeMap<String, (File, BTreeMap<String, usize>)>
),
&format!(
"\
#[cfg(not(feature = \"replace-any\"))]\n\
#[cfg(not(feature = \"abstract-any\"))]\n\
include!(\"{}\");\n\
#[cfg(feature = \"replace-any\")]\n\
#[cfg(feature = \"abstract-any\")]\n\
include!(\"{}\");\
",
file, new_file
Expand Down

0 comments on commit 5d4220e

Please sign in to comment.