-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
kenta-elys
commented
Dec 8, 2023
•
edited
Loading
edited
- Add a special endpoint for querying usdc price on oracle.
src/msg/query_msg.rs
Outdated
@@ -48,4 +50,6 @@ pub enum QueryMsg { | |||
GetCommitments { delegator_addr: String }, | |||
#[returns(QueryEarnPoolResponse)] | |||
GetLiquidityPools { pool_ids: Option<Vec<u64>>, filter_type: FilterType, pagination: Option<PageRequest> }, | |||
#[returns(Decimal)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to return a Response msg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot to change it here
let querier = ElysQuerier::new(&deps.querier); | ||
let usdc_oracle_price = querier.get_oracle_price(ElysDenom::USDC.as_str().to_string(), "".to_string(), 0)?; | ||
let usdc_usd_price = usdc_oracle_price.price.price.checked_div(Decimal::from_atomics(Uint128::new(1000000), 0).unwrap()).unwrap(); | ||
Ok(usdc_usd_price) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to return a Response msg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also change the version of the contract