Skip to content

Commit

Permalink
fix to support higher exponent for switchboard v2 (solana-labs#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
nope-finance authored Jun 10, 2022
1 parent ffe29eb commit a116cfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion token-lending/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,7 @@ fn get_switchboard_price_v2(
return Err(LendingError::InvalidOracleConfig.into());
}
let price = Decimal::from(price_switchboard_desc.mantissa as u128);
let exp = (10u64).checked_pow(price_switchboard_desc.scale).unwrap();
let exp = Decimal::from((10u128).checked_pow(price_switchboard_desc.scale).unwrap());
price.try_div(exp)
}

Expand Down
2 changes: 1 addition & 1 deletion token-lending/program/tests/obligation_end_to_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ async fn test_success2() {
);

// limit to track compute unit increase
test.set_bpf_compute_max_units(148_000);
test.set_bpf_compute_max_units(156_000);

const FEE_AMOUNT: u64 = 100;
const HOST_FEE_AMOUNT: u64 = 20;
Expand Down

0 comments on commit a116cfc

Please sign in to comment.