Skip to content

Commit

Permalink
chore: add consensus_version to consensus params version
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Sep 16, 2024
1 parent 03b741f commit 22e16d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions proto-compiler/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
];
2 changes: 1 addition & 1 deletion proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion proto/tests/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ pub fn test_consensus_params_serde() {
]
},
"version": {
"consensus_version": "1",
"app_version": "1"
},
"synchrony": {
Expand All @@ -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)
}

0 comments on commit 22e16d6

Please sign in to comment.