Skip to content

Commit

Permalink
ref: compare whole version instead of major minor patch
Browse files Browse the repository at this point in the history
  • Loading branch information
joemonem committed Jan 15, 2025
1 parent 1403abb commit d7861e7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions contracts/os/andromeda-adodb/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ pub fn store_code_id(
let should_update = current_ado_version
.map(|(ver, _)| {
let current_version = semver::Version::parse(&ver).unwrap_or(Version::new(0, 0, 0));
// Check each component separately to ensure proper semantic versioning rules
version.major > current_version.major
|| (version.major == current_version.major
&& version.minor > current_version.minor)
|| (version.major == current_version.major
&& version.minor == current_version.minor
&& version.patch > current_version.patch)
version > current_version
})
.unwrap_or(true); // If there's no current version, we should update

Expand Down

0 comments on commit d7861e7

Please sign in to comment.