Skip to content

Commit

Permalink
Merge pull request #202 from cardinal-labs/avinash/crd-95
Browse files Browse the repository at this point in the history
Fixed extend expiration math
  • Loading branch information
TheCurryMan authored May 4, 2022
2 parents 9147299 + 7e1f34f commit 528f04f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ pub fn handler(ctx: Context<ExtendExpirationCtx>, seconds_to_add: u64) -> Result
}

let price_to_pay = seconds_to_add
.checked_div(time_invalidator.extension_duration_seconds.expect("No extension duration"))
.expect("Division error")
.checked_mul(time_invalidator.extension_payment_amount.expect("No extension amount"))
.expect("Multiplication error");
.expect("Multiplication error")
.checked_div(time_invalidator.extension_duration_seconds.expect("No extension duration"))
.expect("Division error");

if time_invalidator.disable_partial_extension != None
&& time_invalidator.disable_partial_extension.unwrap()
Expand Down

0 comments on commit 528f04f

Please sign in to comment.