From 3872f8d18ad140d07a0451756a46b24239e142bf Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Mon, 2 May 2022 13:27:23 +0000 Subject: [PATCH 1/7] Add deprecated as status and in readme Apparently badge doesn't show in ui. So I needed to add in readme too --- Cargo.toml | 5 ++++- README.md | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 50db23f..7f24c81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-client" -version = "0.5.0" +version = "0.5.1" authors = ["Pyth Data Foundation"] edition = "2018" license = "Apache-2.0" @@ -10,6 +10,9 @@ description = "pyth price oracle data structures and example usage" keywords = [ "pyth", "solana", "oracle" ] readme = "README.md" +[badges] +maintenance = { status = "deprecated" } + [features] test-bpf = [] no-entrypoint = [] diff --git a/README.md b/README.md index fb1e4fa..3cf7758 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Pyth Client +**This crate has deprecated. Please use [pyth-sdk-solana](https://github.com/pyth-network/pyth-sdk-rs/tree/main/pyth-sdk-solana) instead.** + This crate provides utilities for reading price feeds from the [pyth.network](https://pyth.network/) oracle on the Solana network. The crate includes a library for on-chain programs and an off-chain example program. From dece48304aa3a86fb3b55feaa9a6aa9115f71cb1 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Mon, 2 May 2022 13:33:10 +0000 Subject: [PATCH 2/7] Add deprecated attribute to functions and structs --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 01454a8..1a5c6f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,6 +110,7 @@ pub struct AccKey } /// Mapping accounts form a linked-list containing the listing of all products on Pyth. +#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(C)] pub struct Mapping @@ -139,6 +140,7 @@ unsafe impl Pod for Mapping {} /// Product accounts contain metadata for a single product, such as its symbol ("Crypto.BTC/USD") /// and its base/quote currencies. +#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(C)] pub struct Product @@ -219,6 +221,7 @@ pub struct Ema } /// Price accounts represent a continuously-updating price feed for a product. +#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] #[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] #[repr(C)] pub struct Price @@ -390,6 +393,7 @@ fn load(data: &[u8]) -> Result<&T, PodCastError> { } /** Get a `Mapping` account from the raw byte value of a Solana account. */ +#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub fn load_mapping(data: &[u8]) -> Result<&Mapping, PythError> { let pyth_mapping = load::(&data).map_err(|_| PythError::InvalidAccountData)?; @@ -407,6 +411,7 @@ pub fn load_mapping(data: &[u8]) -> Result<&Mapping, PythError> { } /** Get a `Product` account from the raw byte value of a Solana account. */ +#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub fn load_product(data: &[u8]) -> Result<&Product, PythError> { let pyth_product = load::(&data).map_err(|_| PythError::InvalidAccountData)?; @@ -424,6 +429,7 @@ pub fn load_product(data: &[u8]) -> Result<&Product, PythError> { } /** Get a `Price` account from the raw byte value of a Solana account. */ +#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub fn load_price(data: &[u8]) -> Result<&Price, PythError> { let pyth_price = load::(&data).map_err(|_| PythError::InvalidAccountData)?; From 1399f9f4e316a20d557bcebaae3a9191bc83807e Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Mon, 2 May 2022 15:45:10 +0000 Subject: [PATCH 3/7] Revert "Add deprecated attribute to functions and structs" This reverts commit dece48304aa3a86fb3b55feaa9a6aa9115f71cb1. --- src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1a5c6f0..01454a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,7 +110,6 @@ pub struct AccKey } /// Mapping accounts form a linked-list containing the listing of all products on Pyth. -#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(C)] pub struct Mapping @@ -140,7 +139,6 @@ unsafe impl Pod for Mapping {} /// Product accounts contain metadata for a single product, such as its symbol ("Crypto.BTC/USD") /// and its base/quote currencies. -#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(C)] pub struct Product @@ -221,7 +219,6 @@ pub struct Ema } /// Price accounts represent a continuously-updating price feed for a product. -#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] #[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] #[repr(C)] pub struct Price @@ -393,7 +390,6 @@ fn load(data: &[u8]) -> Result<&T, PodCastError> { } /** Get a `Mapping` account from the raw byte value of a Solana account. */ -#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub fn load_mapping(data: &[u8]) -> Result<&Mapping, PythError> { let pyth_mapping = load::(&data).map_err(|_| PythError::InvalidAccountData)?; @@ -411,7 +407,6 @@ pub fn load_mapping(data: &[u8]) -> Result<&Mapping, PythError> { } /** Get a `Product` account from the raw byte value of a Solana account. */ -#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub fn load_product(data: &[u8]) -> Result<&Product, PythError> { let pyth_product = load::(&data).map_err(|_| PythError::InvalidAccountData)?; @@ -429,7 +424,6 @@ pub fn load_product(data: &[u8]) -> Result<&Product, PythError> { } /** Get a `Price` account from the raw byte value of a Solana account. */ -#[deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub fn load_price(data: &[u8]) -> Result<&Price, PythError> { let pyth_price = load::(&data).map_err(|_| PythError::InvalidAccountData)?; From a04e0112ff8ab10d404e80a747cb3bc1684198bd Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Mon, 2 May 2022 16:10:50 +0000 Subject: [PATCH 4/7] Fix test bug (probably because of solana updated) Reason is that lock file is not committed and libs don't have that. --- tests/common.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/common.rs b/tests/common.rs index 6d98755..40e3b85 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -3,7 +3,7 @@ use { pyth_client::processor::process_instruction, solana_program::instruction::Instruction, solana_program_test::*, - solana_sdk::{signature::Signer, transaction::Transaction}, + solana_sdk::{signature::Signer, transaction::Transaction, pubkey::Pubkey}, }; // Panics if running instruction fails From 89795c8e0d578471fb3bdf0db5e277845b3eb0c6 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Mon, 2 May 2022 16:12:46 +0000 Subject: [PATCH 5/7] Make whole crate deprecate --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 01454a8..1ee99a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ //! A Rust library for consuming price feeds from the [pyth.network](https://pyth.network/) oracle on the Solana network. //! //! Please see the [crates.io page](https://crates.io/crates/pyth-client/) for documentation and example usage. +#![deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] pub use self::price_conf::PriceConf; pub use self::error::PythError; From 407f69575d768387f762d3f6c6a4fa2033c93836 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Mon, 2 May 2022 16:12:53 +0000 Subject: [PATCH 6/7] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cf7758..17c23cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pyth Client -**This crate has deprecated. Please use [pyth-sdk-solana](https://github.com/pyth-network/pyth-sdk-rs/tree/main/pyth-sdk-solana) instead.** +**This crate has deprecated. Please use [pyth-sdk-solana](https://github.com/pyth-network/pyth-sdk-rs/tree/main/pyth-sdk-solana) instead. pyth-sdk-solana provides identical functionalities with an easier interface.** This crate provides utilities for reading price feeds from the [pyth.network](https://pyth.network/) oracle on the Solana network. The crate includes a library for on-chain programs and an off-chain example program. From a6b5e10bdb0ee4d488fb7d9c7794429478698070 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Tue, 3 May 2022 09:25:59 +0000 Subject: [PATCH 7/7] Modify deprecation message --- README.md | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17c23cd..faf7bc8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pyth Client -**This crate has deprecated. Please use [pyth-sdk-solana](https://github.com/pyth-network/pyth-sdk-rs/tree/main/pyth-sdk-solana) instead. pyth-sdk-solana provides identical functionalities with an easier interface.** +**This crate has been deprecated. Please use [pyth-sdk-solana](https://github.com/pyth-network/pyth-sdk-rs/tree/main/pyth-sdk-solana) instead. pyth-sdk-solana provides identical functionalities with an easier interface.** This crate provides utilities for reading price feeds from the [pyth.network](https://pyth.network/) oracle on the Solana network. The crate includes a library for on-chain programs and an off-chain example program. diff --git a/src/lib.rs b/src/lib.rs index 1ee99a6..7a56f5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ //! A Rust library for consuming price feeds from the [pyth.network](https://pyth.network/) oracle on the Solana network. //! //! Please see the [crates.io page](https://crates.io/crates/pyth-client/) for documentation and example usage. -#![deprecated = "This crate has deprecated. Please use pyth-sdk-solana"] +#![deprecated = "This crate has been deprecated. Please use pyth-sdk-solana instead."] pub use self::price_conf::PriceConf; pub use self::error::PythError;