[cosmwasm] Move data structures to pyth-sdk-cw (#578)
* pyth-sdk-cw add data structures * consume pyth-sdk-cw data structure * pre commit hooks
This commit is contained in:
parent
3e9472b8ef
commit
62083eb6d6
|
@ -1309,6 +1309,7 @@ dependencies = [
|
|||
"cosmwasm-schema",
|
||||
"cosmwasm-std",
|
||||
"pyth-sdk 0.7.0",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
use {
|
||||
cosmwasm_schema::write_api,
|
||||
pyth_cosmwasm::msg::{
|
||||
ExecuteMsg,
|
||||
InstantiateMsg,
|
||||
MigrateMsg,
|
||||
},
|
||||
pyth_sdk_cw::{
|
||||
ExecuteMsg,
|
||||
QueryMsg,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use {
|
||||
crate::{
|
||||
error::PythContractError,
|
||||
governance::{
|
||||
GovernanceAction::{
|
||||
AuthorizeGovernanceDataSourceTransfer,
|
||||
|
@ -13,10 +12,8 @@ use {
|
|||
GovernanceInstruction,
|
||||
},
|
||||
msg::{
|
||||
ExecuteMsg,
|
||||
InstantiateMsg,
|
||||
MigrateMsg,
|
||||
QueryMsg,
|
||||
},
|
||||
state::{
|
||||
config,
|
||||
|
@ -27,7 +24,6 @@ use {
|
|||
PriceInfo,
|
||||
PythDataSource,
|
||||
},
|
||||
Price,
|
||||
},
|
||||
cosmwasm_std::{
|
||||
coin,
|
||||
|
@ -52,9 +48,13 @@ use {
|
|||
WasmQuery,
|
||||
},
|
||||
pyth_sdk_cw::{
|
||||
error::PythContractError,
|
||||
ExecuteMsg,
|
||||
Price,
|
||||
PriceFeed,
|
||||
PriceFeedResponse,
|
||||
PriceIdentifier,
|
||||
QueryMsg,
|
||||
},
|
||||
pyth_wormhole_attester_sdk::{
|
||||
BatchPriceAttestation,
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
extern crate lazy_static;
|
||||
|
||||
pub mod contract;
|
||||
pub mod error;
|
||||
pub mod governance;
|
||||
pub mod msg;
|
||||
pub mod state;
|
||||
|
||||
pub use pyth_sdk::Price;
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
pub use pyth_sdk_cw::QueryMsg;
|
||||
use {
|
||||
crate::state::PythDataSource,
|
||||
cosmwasm_schema::cw_serde,
|
||||
cosmwasm_std::{
|
||||
Binary,
|
||||
Coin,
|
||||
},
|
||||
cosmwasm_std::Coin,
|
||||
};
|
||||
|
||||
// cw_serde attribute is equivalent to
|
||||
|
@ -29,14 +25,6 @@ pub struct InstantiateMsg {
|
|||
pub fee: Coin,
|
||||
}
|
||||
|
||||
#[derive(Eq)]
|
||||
#[cw_serde]
|
||||
pub enum ExecuteMsg {
|
||||
// TODO: add UpdatePriceFeeds if necessary
|
||||
UpdatePriceFeeds { data: Vec<Binary> },
|
||||
ExecuteGovernanceInstruction { data: Binary },
|
||||
}
|
||||
|
||||
#[derive(Eq)]
|
||||
#[cw_serde]
|
||||
pub struct MigrateMsg {}
|
||||
|
|
|
@ -15,3 +15,4 @@ keywords = [ "pyth", "oracle", "cosmwasm" ]
|
|||
pyth-sdk = "0.7.0"
|
||||
cosmwasm-std = { version = "1.0.0" }
|
||||
cosmwasm-schema = "1.1.9"
|
||||
thiserror = "1.0.20"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
pub mod error;
|
||||
pub use pyth_sdk::{
|
||||
Price,
|
||||
PriceFeed,
|
||||
PriceIdentifier,
|
||||
};
|
||||
|
@ -14,6 +16,12 @@ use {
|
|||
std::time::Duration,
|
||||
};
|
||||
|
||||
#[derive(Eq)]
|
||||
#[cw_serde]
|
||||
pub enum ExecuteMsg {
|
||||
UpdatePriceFeeds { data: Vec<Binary> },
|
||||
ExecuteGovernanceInstruction { data: Binary },
|
||||
}
|
||||
|
||||
#[cw_serde]
|
||||
#[derive(QueryResponses)]
|
||||
|
|
Loading…
Reference in New Issue