Merge #1749: refac: remove patch field from Version

fef70879b9507e0429a8a0a5211ba0547b68cc92 refac: remove patch field from Version (edouardparis)

Pull request description:

  The Version struct is used across the software
  to display the release version. A release version
  does not include patch number as we increment
  only the major and the minor during a new release.

  For very small patch that does not change the
  API and does not require a new release, then the crates Cargo.toml version patch number will be incremented.

ACKs for top commit:
  jp1ac4:
    tACK fef70879b9507e0429a8a0a5211ba0547b68cc92.

Tree-SHA512: 1a4e94c156377e810e15ba93267e6eddd0a273de48b18d0722f9e879eceb9b6ce8cb5f1347c075c1c17a47278b5fd6a64b51ad244cf15f390250d267cd8e23c7
This commit is contained in:
edouardparis 2025-06-17 11:13:56 +02:00
commit ad75d77e94
No known key found for this signature in database
GPG Key ID: E65F7A089C20DC8F
4 changed files with 3 additions and 6 deletions

View File

@ -36,7 +36,7 @@ const SETTINGS_KEY: &str = "settings";
const LIANA_VERSION_KEY: &str = "liana_version";
pub fn liana_version() -> String {
format!("{}.{}.{}", VERSION.major, VERSION.minor, VERSION.patch)
format!("{}.{}", VERSION.major, VERSION.minor)
}
fn now() -> u64 {

View File

@ -20,7 +20,6 @@ use lianad::Version;
pub const VERSION: Version = Version {
major: 11,
minor: 0,
patch: 0,
};
#[cfg(test)]

View File

@ -71,19 +71,17 @@ pub fn setup_panic_hook() {
pub struct Version {
pub major: u32,
pub minor: u32,
pub patch: u32,
}
impl fmt::Display for Version {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}.{}.{}-dev", self.major, self.minor, self.patch)
write!(f, "{}.{}-dev", self.major, self.minor)
}
}
pub const VERSION: Version = Version {
major: 11,
minor: 0,
patch: 0,
};
#[derive(Debug)]

View File

@ -26,7 +26,7 @@ MAX_DERIV = 2**31 - 1
def test_getinfo(lianad):
res = lianad.rpc.getinfo()
assert "timestamp" in res.keys()
assert res["version"] == "11.0.0-dev"
assert res["version"] == "11.0-dev"
assert res["network"] == "regtest"
wait_for(lambda: lianad.rpc.getinfo()["block_height"] == 101)
res = lianad.rpc.getinfo()