From efec8ea71b686e1a1b20d02c71a91782ba152c62 Mon Sep 17 00:00:00 2001 From: Amit Yadav Date: Tue, 13 Aug 2024 23:16:13 +0530 Subject: [PATCH] hardcode --- contracts/trade-shield-contract/src/helper.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/trade-shield-contract/src/helper.rs b/contracts/trade-shield-contract/src/helper.rs index baff71da..558bc5c0 100644 --- a/contracts/trade-shield-contract/src/helper.rs +++ b/contracts/trade-shield-contract/src/helper.rs @@ -38,11 +38,15 @@ pub fn get_discount( user_address: String, ) -> StdResult { 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,