Skip to content

Commit

Permalink
cleanup comments around priority saturation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshy Orndorff committed Oct 9, 2023
1 parent a323669 commit fa797b5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions wardrobe/money/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,10 @@ impl<const ID: u8> SimpleConstraintChecker for SpendMoney<ID> {
ConstraintCheckerError::OutputsExceedInputs
);

// Priority is based on how many token are burned
// Type stuff is kinda ugly. Maybe division would be better?
let burned = total_input_value - total_output_value;

// Priority is based on how many token are burned
// Just a saturated version of the burned amount.
// TODO can't I use saturating_into or something here instead of writing it myself?
let priority = if burned < u64::max_value() as u128 {
burned as u64
} else {
Expand Down

0 comments on commit fa797b5

Please sign in to comment.