fix: Use price id instead of product id in pyth on terra
Change-Id: Ic567803fd2bf798e0e4150c2a123bbc4788535f0
This commit is contained in:
parent
30a9d7410e
commit
91b58d7b64
|
@ -134,11 +134,11 @@ fn submit_vaa(
|
||||||
sequence(deps.storage).save(&vaa.sequence)?;
|
sequence(deps.storage).save(&vaa.sequence)?;
|
||||||
|
|
||||||
// Update price
|
// Update price
|
||||||
price_info(deps.storage).save(&message.product_id.to_bytes()[..], &data)?;
|
price_info(deps.storage).save(&message.price_id.to_bytes()[..], &data)?;
|
||||||
|
|
||||||
Ok(Response::new()
|
Ok(Response::new()
|
||||||
.add_attribute("action", "price_update")
|
.add_attribute("action", "price_update")
|
||||||
.add_attribute("price_feed", message.product_id.to_string()))
|
.add_attribute("price_feed", message.price_id.to_string()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_governance_payload(deps: DepsMut, env: Env, data: &Vec<u8>) -> StdResult<Response> {
|
fn handle_governance_payload(deps: DepsMut, env: Env, data: &Vec<u8>) -> StdResult<Response> {
|
||||||
|
@ -176,8 +176,8 @@ fn handle_upgrade_contract(_deps: DepsMut, env: Env, data: &Vec<u8>) -> StdResul
|
||||||
#[cfg_attr(not(feature = "library"), entry_point)]
|
#[cfg_attr(not(feature = "library"), entry_point)]
|
||||||
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
|
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
|
||||||
match msg {
|
match msg {
|
||||||
QueryMsg::PriceInfo { product_id } => {
|
QueryMsg::PriceInfo { price_id } => {
|
||||||
to_binary(&query_price_info(deps, product_id.as_slice())?)
|
to_binary(&query_price_info(deps, price_id.as_slice())?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,5 +31,5 @@ pub struct MigrateMsg {}
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
|
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum QueryMsg {
|
pub enum QueryMsg {
|
||||||
PriceInfo { product_id: Binary },
|
PriceInfo { price_id: Binary },
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue