Skip to content

Commit

Permalink
Release v0.36.0 (#148)
Browse files Browse the repository at this point in the history
* Bump version to 0.36.0

* Release changelog

* Fix invalid doc comment in generated Rust code

* Add CI job to check that documentation builds succesfully
  • Loading branch information
romac committed Sep 28, 2023
1 parent d31d165 commit cd8d423
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .changelog/v0.36.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*September 28th, 2023*

Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security.
16 changes: 16 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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*
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-proto"
version = "0.35.0"
version = "0.36.0"
authors = ["Informal Systems <hello@informal.systems>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/prost/ibc.applications.transfer.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
38 changes: 28 additions & 10 deletions tools/proto-compiler/src/cmd/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit cd8d423

Please sign in to comment.