Skip to content

Commit

Permalink
fix: missed some spots on the rename
Browse files Browse the repository at this point in the history
  • Loading branch information
gluax committed Oct 1, 2024
1 parent 9d45e87 commit 24d0b09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/msgs/data_requests/execute_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ fn json_post_request() {

let args = PostDataRequestArgs {
version: Version::new(1, 0, 0),
dr_binary_id: "dr_binary_id".to_string(),
exec_program_id: "exec_program_id".to_string(),
dr_inputs: dr_inputs.clone(),
tally_binary_id: "tally_binary_id".to_string(),
tally_program_id: "tally_program_id".to_string(),
tally_inputs: tally_inputs.clone(),
replication_factor: 1,
consensus_filter: consensus_filter.clone(),
Expand All @@ -80,9 +80,9 @@ fn json_post_request() {
"post_data_request": {
"posted_dr": {
"version": "1.0.0",
"dr_binary_id": "dr_binary_id",
"exec_program_id": "exec_program_id",
"dr_inputs": dr_inputs,
"tally_binary_id": "tally_binary_id",
"tally_program_id": "tally_program_id",
"tally_inputs": tally_inputs,
"replication_factor": 1,
"consensus_filter": consensus_filter,
Expand Down
8 changes: 4 additions & 4 deletions src/msgs/data_requests/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ impl TryHashSelf for RevealBody {
#[cfg_attr(not(feature = "cosmwasm"), serde(rename_all = "snake_case"))]
pub struct PostDataRequestArgs {
pub version: Version,
pub dr_binary_id: String,
pub exec_program_id: String,
pub dr_inputs: Bytes,
pub tally_binary_id: String,
pub tally_program_id: String,
pub tally_inputs: Bytes,
pub replication_factor: u16,
pub consensus_filter: Bytes,
Expand Down Expand Up @@ -275,9 +275,9 @@ impl TryHashSelf for PostDataRequestArgs {
let mut dr_hasher = Keccak256::new();
dr_hasher.update(self.version.hash());
// I don't think we should decode to hash... expensive in cosmwasm no?
dr_hasher.update(hex::decode(&self.dr_binary_id)?);
dr_hasher.update(hex::decode(&self.exec_program_id)?);
dr_hasher.update(dr_inputs_hash);
dr_hasher.update(hex::decode(&self.tally_binary_id)?);
dr_hasher.update(hex::decode(&self.tally_program_id)?);
dr_hasher.update(tally_inputs_hash);
dr_hasher.update(self.replication_factor.to_be_bytes());
dr_hasher.update(consensus_filter_hash);
Expand Down
12 changes: 6 additions & 6 deletions src/msgs/data_requests/types_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ fn json_reveal_body() {
#[test]
fn json_post_data_request_args() {
let version = "1.0.0".to_string();
let dr_binary_id = "dr_binary_id".to_string();
let exec_program_id = "exec_program_id".to_string();
#[cfg(not(feature = "cosmwasm"))]
let dr_inputs = "dr_inputs".to_string();
#[cfg(feature = "cosmwasm")]
let dr_inputs: Bytes = "dr_inputs".as_bytes().into();
let tally_binary_id = "tally_binary_id".to_string();
let tally_program_id = "tally_program_id".to_string();
#[cfg(not(feature = "cosmwasm"))]
let tally_inputs = "tally_inputs".to_string();
#[cfg(feature = "cosmwasm")]
Expand All @@ -201,9 +201,9 @@ fn json_post_data_request_args() {

let expected_json = json!({
"version": version,
"dr_binary_id": dr_binary_id,
"exec_program_id": exec_program_id,
"dr_inputs": dr_inputs,
"tally_binary_id": tally_binary_id,
"tally_program_id": tally_program_id,
"tally_inputs": tally_inputs,
"replication_factor": replication_factor,
"consensus_filter": consensus_filter,
Expand All @@ -214,9 +214,9 @@ fn json_post_data_request_args() {

let msg = PostDataRequestArgs {
version: version.parse().unwrap(),
dr_binary_id,
exec_program_id,
dr_inputs,
tally_binary_id,
tally_program_id,
tally_inputs,
replication_factor,
consensus_filter,
Expand Down

0 comments on commit 24d0b09

Please sign in to comment.