Skip to content

Commit

Permalink
chore: emit posted dr height on commit & reveal
Browse files Browse the repository at this point in the history
  • Loading branch information
gluax committed Nov 27, 2024
1 parent 95ce303 commit 804c6a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contract/src/msgs/data_requests/execute/commit_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ impl ExecuteHandler for execute::commit_result::Execute {
// add the commitment to the data request
let commitment = Hash::from_hex_str(&self.commitment)?;
dr.commits.insert(self.public_key.clone(), commitment);
state::commit(deps.storage, env.block.height, dr_id, dr)?;

Ok(Response::new().add_attribute("action", "commit_data_result").add_event(
let resp = Response::new().add_attribute("action", "commit_data_result").add_event(
Event::new("seda-commitment").add_attributes([
("dr_id", self.dr_id),
("posted_dr_height", dr.height.to_string()),
("commitment", self.commitment),
("executor", self.public_key),
("version", CONTRACT_VERSION.to_string()),
]),
))
);
state::commit(deps.storage, env.block.height, dr_id, dr)?;
Ok(resp)
}
}
1 change: 1 addition & 0 deletions contract/src/msgs/data_requests/execute/reveal_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl ExecuteHandler for execute::reveal_result::Execute {
let response = Response::new().add_attribute("action", "reveal_data_result").add_event(
Event::new("seda-reveal").add_attributes([
("dr_id", self.dr_id.clone()),
("posted_dr_height", dr.height.to_string()),
("reveal", to_json_string(&self.reveal_body)?),
("stdout", to_json_string(&self.stdout)?),
("stderr", to_json_string(&self.stderr)?),
Expand Down

0 comments on commit 804c6a1

Please sign in to comment.