fix: Use price id instead of product id in pyth on terra

Change-Id: Ic567803fd2bf798e0e4150c2a123bbc4788535f0
This commit is contained in:
Hendrik Hofstadt 2021-12-28 17:44:00 +01:00 committed by Evan Gray
parent 30a9d7410e
commit 91b58d7b64
2 changed files with 5 additions and 5 deletions

View File

@ -134,11 +134,11 @@ fn submit_vaa(
sequence(deps.storage).save(&vaa.sequence)?;
// 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()
.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> {
@ -176,8 +176,8 @@ fn handle_upgrade_contract(_deps: DepsMut, env: Env, data: &Vec<u8>) -> StdResul
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::PriceInfo { product_id } => {
to_binary(&query_price_info(deps, product_id.as_slice())?)
QueryMsg::PriceInfo { price_id } => {
to_binary(&query_price_info(deps, price_id.as_slice())?)
}
}
}

View File

@ -31,5 +31,5 @@ pub struct MigrateMsg {}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
PriceInfo { product_id: Binary },
PriceInfo { price_id: Binary },
}