Skip to content

Commit

Permalink
slahser modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay111meher committed Nov 12, 2024
1 parent 7c76a2b commit 9ab3a2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion slasher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ matching_engine_helpers = { path = "../matching_engine", package = "matching_eng
reqwest = { version = "0.12.4", features = ["json"] }
serde = { version = "1.0.178", features = ["derive"] }
serde_json = "1.0.104"
tokio = { version = "1.15.0", features = ["full"] }
tokio = { version = "1.15.0", features = ["full"] }

[features]
default = []
force_transactions = []
8 changes: 6 additions & 2 deletions slasher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,15 @@ impl SlashingInstance {
let ask_state =
matching_engine_helpers::ask_lib::ask_status::get_ask_state(ask_state);

if ask_state == AskState::DeadlineCrossed {
let slashing_transaction = self
if ask_state == AskState::DeadlineCrossed || ask_state == AskState::Assigned {
let mut slashing_transaction = self
.proof_marketplace
.slash_generator(ask_id, self.reward_address);

if cfg!(feature = "force_transactions") {
slashing_transaction = slashing_transaction.gas(10_000_000);
}

let slashing_transaction = match slashing_transaction.send().await {
Ok(data) => data.confirmations(10),
Err(err) => {
Expand Down

0 comments on commit 9ab3a2e

Please sign in to comment.