Skip to content

Commit

Permalink
Add error event (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Art3miX authored Jun 17, 2024
1 parent 292ea7a commit f87089a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ members = [
[workspace.package]
edition = "2021"
license = "BSL"
version = "0.1.0"
version = "0.1.4"
repository = "https://github.com/timewave-computer/valence-services"

rust-version = "1.66"
Expand Down
2 changes: 2 additions & 0 deletions contracts/services/rebalancer/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{Decimal, SubMsg, Uint128};
use serde::Serialize;
use valence_package::{
Expand Down Expand Up @@ -29,6 +30,7 @@ pub struct TargetHelper {
pub auction_min_amount: Decimal,
}

#[cw_serde]
pub struct RebalanceResponse<E: Serialize> {
pub config: RebalancerConfig,
pub msg: Option<SubMsg>,
Expand Down
4 changes: 4 additions & 0 deletions contracts/services/rebalancer/src/rebalance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ pub fn execute_system_rebalance(
should_pause,
}) = rebalance_res
else {
account_events.push(
Event::new("rebalancer-error")
.add_attribute("error", rebalance_res.unwrap_err().to_string()),
);
continue;
};

Expand Down

0 comments on commit f87089a

Please sign in to comment.