Skip to content

Commit

Permalink
refactor: dr_escrow staker -> poster
Browse files Browse the repository at this point in the history
  • Loading branch information
gluax committed Dec 20, 2024
1 parent 520f041 commit 34f308a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contract/src/msgs/data_requests/execute/post_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl ExecuteHandler for execute::post_request::Execute {
&dr_id,
&Escrow {
amount: funds,
staker: info.sender,
poster: info.sender,
},
)?;

Expand Down
4 changes: 2 additions & 2 deletions contract/src/msgs/data_requests/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use timeouts::Timeouts;
/// Governance-controlled timeout configuration parameters.
pub const TIMEOUT_CONFIG: Item<TimeoutConfig> = Item::new("timeout_config");

/// Stores the amount, and the staker address.
/// Stores the amount, and the poster address.
#[cw_serde]
pub struct Escrow {
pub amount: Uint128,
// Safe to use Addr here as we aren't taking the type from a user input.
pub staker: Addr,
pub poster: Addr,
}

/// Maps a data request ID to the staked funds.
Expand Down
2 changes: 1 addition & 1 deletion contract/src/msgs/data_requests/sudo/remove_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ fn remove_request(

if !dr_escrow.amount.is_zero() {
bank_messages.push(BankMsg::Send {
to_address: dr_escrow.staker.to_string(),
to_address: dr_escrow.poster.to_string(),
amount: vec![amount_to_tokens(dr_escrow.amount, token)],
});
event = event.add_attribute(
Expand Down
2 changes: 1 addition & 1 deletion contract/src/msgs/data_requests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn post_data_request() {
)
.unwrap();
assert_eq!(20, staked.amount.u128());
assert_eq!(anyone.addr(), staked.staker);
assert_eq!(anyone.addr(), staked.poster);

// expect an error when trying to post it again
let res = test_info.post_data_request(&mut anyone, dr.clone(), vec![], vec![1, 2, 3], 1);
Expand Down

0 comments on commit 34f308a

Please sign in to comment.