From e44d25c39ea2f15d12837ab835b838c15b87880f Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:45:56 +0200 Subject: [PATCH] feat: support ConsensusParams.VersionParams.consensus_version from Tenderdash 1.3 (#101) * chore: add consensus_version to consensus params version * build(deps): update deprecated actions/upload-artifact v1 to v4 --- .github/workflows/test.yml | 2 +- proto-compiler/src/constants.rs | 4 ++++ proto/build.rs | 2 +- proto/tests/unit.rs | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e6d5b1..ecec2f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,7 @@ jobs: run: docker logs tenderdash > tenderdash.log 2>&1 - name: Archive docker logs - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 if: failure() with: name: tenderdash.log diff --git a/proto-compiler/src/constants.rs b/proto-compiler/src/constants.rs index eae86ce..ab8ef4e 100644 --- a/proto-compiler/src/constants.rs +++ b/proto-compiler/src/constants.rs @@ -256,4 +256,8 @@ pub static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[ ".tendermint.types.VersionParams.app_version", QUOTED_WITH_DEFAULT, ), + ( + ".tendermint.types.VersionParams.consensus_version", + QUOTED_WITH_DEFAULT, + ), ]; diff --git a/proto/build.rs b/proto/build.rs index 2cf3ce6..f74a282 100644 --- a/proto/build.rs +++ b/proto/build.rs @@ -4,7 +4,7 @@ use tenderdash_proto_compiler::GenerationMode; fn main() { // default Tenderdash version to use if TENDERDASH_COMMITISH is not set - const DEFAULT_VERSION: &str = "v1.1.0"; + const DEFAULT_VERSION: &str = "68a03d69dcfaa64a6edb829b6efed40e72e8e7bd"; // check if TENDERDASH_COMMITISH is already set; if not, set it to the current // version diff --git a/proto/tests/unit.rs b/proto/tests/unit.rs index 229c353..7dd4258 100644 --- a/proto/tests/unit.rs +++ b/proto/tests/unit.rs @@ -154,6 +154,7 @@ pub fn test_consensus_params_serde() { ] }, "version": { + "consensus_version": "1", "app_version": "1" }, "synchrony": { @@ -173,5 +174,6 @@ pub fn test_consensus_params_serde() { } "#; - let _new_params: ConsensusParams = serde_json::from_str(json).unwrap(); + let new_params: ConsensusParams = serde_json::from_str(json).unwrap(); + assert_eq!(new_params.version.unwrap().consensus_version, 1) }