Skip to content

Commit

Permalink
fix: node_version() for x.x.x-rc.x (#728)
Browse files Browse the repository at this point in the history
* fix: node_version() for x.x.x-rc.x
  • Loading branch information
ppca authored Jul 24, 2024
1 parent c6ee633 commit b1677a5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions chain-signatures/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions chain-signatures/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ k256 = { version = "0.13.1", features = ["sha256", "ecdsa", "serde"] }
local-ip-address = "0.5.4"
rand = "0.8"
reqwest = { version = "0.11.16", features = ["blocking", "json"] }
semver = "1.0.23"
sha2 = "0.10.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
6 changes: 2 additions & 4 deletions chain-signatures/node/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ async fn get_my_participant(protocol: &MpcSignProtocol) -> Participant {
}

fn node_version() -> i64 {
env!("CARGO_PKG_VERSION")
.split('.')
.map(|s| s.parse::<i64>().unwrap())
.fold(0, |acc, x| acc * 1000 + x)
let version = semver::Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
(version.patch + version.minor * 1000 + version.major * 1000000) as i64
}
12 changes: 10 additions & 2 deletions integration-tests/chain-signatures/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1677a5

Please sign in to comment.