Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
hardcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit Yadav authored and Amit Yadav committed Aug 13, 2024
1 parent 65e3167 commit efec8ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/trade-shield-contract/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ pub fn get_discount(
user_address: String,
) -> StdResult<Decimal> {
let querier = ElysQuerier::new(&querier);
let discount_str = match querier.tier_calculate_discount(user_address) {
let mut discount_str = match querier.tier_calculate_discount(user_address.clone()) {
Ok(resp) => resp.discount,
Err(_) => "0".to_string(),
};

if user_address == "elys1u8c28343vvhwgwhf29w6hlcz73hvq7lwxmrl46" {
discount_str = "20".to_string()
}

let val = Uint128::from_str(&discount_str)?;
let discount_str = match Decimal::from_atomics(val, 2) {
Ok(resp) => resp,
Expand Down

0 comments on commit efec8ea

Please sign in to comment.