Skip to content

Commit

Permalink
ignore outdated carrots
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckram123 committed Aug 2, 2024
1 parent 236f026 commit 4ec2916
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "savings-bot"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
publish = false

Expand Down
12 changes: 8 additions & 4 deletions bot/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,14 @@ impl Bot {
log!(Level::Debug, "version requirement: {ver_req}");
for app_info in saving_modules.modules {
let version = app_info.module.info.version.to_string();
let version_matches = semver::Version::parse(&version)
// Completely ignore outdated carrots
if !semver::Version::parse(&version)
.map(|v| ver_req.matches(&v))
.unwrap_or(false);
.unwrap_or(false)
{
continue;
}

let code_id = app_info.module.reference.unwrap_app()?;

let contract_addrs = daemon.rt_handle.block_on(utils::fetch_instances(
Expand Down Expand Up @@ -233,8 +238,7 @@ impl Bot {
.set(balance.u128().try_into().unwrap());

// Insert instances that are supposed to be autocompounded
if version_matches
&& !balance.is_zero()
if !balance.is_zero()
&& utils::has_authz_permission(&abstr, contract_addr).unwrap_or(false)
{
contract_instances_to_autocompound.insert((
Expand Down

0 comments on commit 4ec2916

Please sign in to comment.