Skip to content

Commit

Permalink
rename get_reserved to get_reserve
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Aug 19, 2024
1 parent ba1d0aa commit 6b58587
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ impl<T: Config> Pallet<T> {
"Not distributing rewards for contract_id: {:?}, cycles: {:?}, reserved amount: {:?}",
contract.contract_id,
contract_payment_state.cycles,
contract_payment_state.get_reserved()
contract_payment_state.get_reserve()
);
}
Ok(().into())
Expand Down
6 changes: 3 additions & 3 deletions substrate-node/pallets/pallet-smart-contract/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ where
}

// Method to return the sum of standard_reserve_amount and additional_reserve_amount
pub fn get_reserved(&self) -> BalanceOf {
pub fn get_reserve(&self) -> BalanceOf {
self.standard_reserve
.defensive_saturating_add(self.additional_reserve)
}
Expand Down Expand Up @@ -613,12 +613,12 @@ mod tests {
}

#[test]
fn test_get_reserved() {
fn test_get_reserve() {
let mut payment_state = default_contract_payment_state();
payment_state.standard_reserve = 120;
payment_state.additional_reserve = 80;

let total_reserved = payment_state.get_reserved();
let total_reserved = payment_state.get_reserve();

assert_eq!(total_reserved, 200);
}
Expand Down

0 comments on commit 6b58587

Please sign in to comment.