Skip to content

Commit

Permalink
Testing checked_from_decimal_to_value in walkthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-cichocki committed Sep 18, 2023
1 parent 5c62da1 commit 9de2e5e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/walkthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ mod walkthrough {
let convert_err = Percentage::checked_from_decimal(Price::max_instance()).unwrap_err();
assert_eq!(convert_err, "checked_from_scale: can't convert to result");
}
// checked_from_decimal_to_value
{
let result = Price::checked_from_decimal_to_value(Price::max_instance()).unwrap();
assert_eq!(result, U256::from(Price::max_value()));
}
// checked_big_div_by_number & checked_big_div_by_number_up
{
let three = U256::from(Price::from_integer(3).get());
Expand Down

0 comments on commit 9de2e5e

Please sign in to comment.