-
Notifications
You must be signed in to change notification settings - Fork 308
[cosmos] Misc code cleanup #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| governance_sequence_number: msg.governance_sequence_number, | ||
| valid_time_period: Duration::from_secs(msg.valid_time_period_secs as u64), | ||
| fee: msg.fee, | ||
| fee_denom: msg.fee_denom, |
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.
fee is a Coin now so it has the denom already
| env: Env, | ||
| info: MessageInfo, | ||
| data: &Binary, | ||
| data: &[Binary], |
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.
Pass in an array of price updates to update_price_feeds for consistency with the EVM implementation.
| } | ||
| _ => Err(PythContractError::InvalidGovernancePayload)?, | ||
| } | ||
| transfer_governance(&mut updated_config, &state, &parsed_claim_vaa)? |
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.
moved to helper function (per previous PR comment)
| emitter: vaa.emitter_address.clone().into(), | ||
| pyth_emitter_chain: vaa.emitter_chain, | ||
| emitter: vaa.emitter_address.clone().into(), | ||
| chain_id: vaa.emitter_chain, |
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.
(I renamed this field in data source)
| SetValidPeriod, | ||
| }, | ||
| state::PythDataSource, | ||
| }, |
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.
fix same file imports (per previous PR)
| QueryMsg::GetValidTimePeriod => to_binary(&get_valid_time_period(deps)?), | ||
| QueryMsg::PriceFeed { id } => to_binary(&query_price_feed(&deps, env, id.as_ref())?), | ||
| QueryMsg::GetUpdateFee { vaas } => to_binary(&get_update_fee(&deps, &vaas)?), | ||
| QueryMsg::GetValidTimePeriod => to_binary(&get_valid_time_period(&deps)?), |
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.
changed signature to borrow (for consistency with the rest of the functions)
ali-behjati
left a comment
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.
Awesome!
Clean up a few miscellaneous issues from earlier PRs. Main changes are:
I suggest reading
msg.rsandstate.rsfirst to get the main changes before looking atcontract.rs(which is mostly mechanical)..