diff --git a/.changelog/unreleased/breaking-changes/147-fix-script-and-protos.md b/.changelog/v0.36.0/breaking-changes/147-fix-script-and-protos.md similarity index 100% rename from .changelog/unreleased/breaking-changes/147-fix-script-and-protos.md rename to .changelog/v0.36.0/breaking-changes/147-fix-script-and-protos.md diff --git a/.changelog/v0.36.0/summary.md b/.changelog/v0.36.0/summary.md new file mode 100644 index 00000000..813bd212 --- /dev/null +++ b/.changelog/v0.36.0/summary.md @@ -0,0 +1,3 @@ +*September 28th, 2023* + +Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security. diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a42e35c3..7154214e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -123,6 +123,22 @@ jobs: with: command: build + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + env: + RUSTDOCFLAGS: "-D warnings" + with: + command: doc + args: --all-features + publish-dry-run: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d5968f..6c3a5676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # CHANGELOG +## v0.36.0 + +*September 28th, 2023* + +Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security. + +### BREAKING CHANGES + +- Since ibc-proto v0.34.0, the script in charge of generating the Rust proto definitions + has been mistakenly checking out their latest version instead of the one + specified in the corresponding `src/*_COMMIT` file. This has now been fixed + and the protos have therefore been downgraded to their proper versions: + * IBC-Go: v7.3.0, + * Cosmos SDK: v0.47.5 + * Interchain Security: v3.1.0 + ([\#147](https://github.com/cosmos/ibc-proto-rs/pull/147)) + ## v0.35.0 *September 14th, 2023* diff --git a/Cargo.toml b/Cargo.toml index e484a840..ec5da088 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-proto" -version = "0.35.0" +version = "0.36.0" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/src/prost/ibc.applications.transfer.v1.rs b/src/prost/ibc.applications.transfer.v1.rs index 182655b1..350106c8 100644 --- a/src/prost/ibc.applications.transfer.v1.rs +++ b/src/prost/ibc.applications.transfer.v1.rs @@ -439,7 +439,7 @@ pub struct QueryParamsResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashRequest { - /// The denomination trace (\[port_id]/[channel_id])+/[denom\] + /// The denomination trace `(\[port_id]/[channel_id])+/[denom\]` #[prost(string, tag = "1")] pub trace: ::prost::alloc::string::String, } diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index c828d19e..e1939004 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -215,21 +215,39 @@ impl CompileCmd { out_dir.display() ); - { - println!("[info ] Patching cosmos.staking.v1beta1.rs..."); + const PATCHES: &[(&str, &[(&str, &str)])] = &[ + ( + "cosmos.staking.v1beta1.rs", + &[ + ("pub struct Validators", "pub struct ValidatorsVec"), + ("AllowList(Validators)", "AllowList(ValidatorsVec)"), + ("DenyList(Validators)", "DenyList(ValidatorsVec)"), + ], + ), + ( + "ibc.applications.transfer.v1.rs", + &[( + "The denomination trace (\\[port_id]/[channel_id])+/[denom\\]", + "The denomination trace `(\\[port_id]/[channel_id])+/[denom\\]`", + )], + ), + ]; + + for (file, patches) in PATCHES { + println!("[info ] Patching {file}..."); - let path = out_dir.join("cosmos.staking.v1beta1.rs"); - let contents = std::fs::read_to_string(&path)?; + let path = out_dir.join(file); + let original = std::fs::read_to_string(&path)?; + let mut patched = original.clone(); - let patched_contents = contents - .replace("pub struct Validators", "pub struct ValidatorsVec") - .replace("AllowList(Validators)", "AllowList(ValidatorsVec)") - .replace("DenyList(Validators)", "DenyList(ValidatorsVec)"); + for (before, after) in patches.iter() { + patched = patched.replace(before, after); + } - let diff = TextDiff::from_lines(&contents, &patched_contents); + let diff = TextDiff::from_lines(&original, &patched); println!("{}", diff.unified_diff().context_radius(3)); - std::fs::write(&path, patched_contents)?; + std::fs::write(&path, patched)?; } Ok(())