Parcourir la source

update borsh to v1.5.1

Ayaz Abbas il y a 1 an
Parent
commit
85203eb834

+ 2 - 2
pythnet/pythnet_sdk/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "pythnet-sdk"
-version = "2.3.0"
+version = "2.4.0"
 description = "Pyth Runtime for Solana"
 authors = ["Pyth Data Association"]
 repository = "https://github.com/pyth-network/pythnet"
@@ -17,7 +17,7 @@ solana-program = ["dep:solana-program", "dep:anchor-lang"]
 
 [dependencies]
 bincode = "1.3.1"
-borsh = "0.10.3"
+borsh = { version = "1.5.1", features = ["unstable__schema"] }
 bytemuck = { version = "1.11.0", features = ["derive"] }
 byteorder = "1.4.3"
 fast-math = "0.1"

+ 3 - 3
pythnet/pythnet_sdk/src/accumulators/merkle.rs

@@ -73,7 +73,7 @@ pub struct MerkleTree<H: Hasher = Keccak256> {
     pub root: MerkleRoot<H>,
 
     #[serde(skip)]
-    #[borsh_skip]
+    #[borsh(skip)]
     pub nodes: Vec<H::Hash>,
 }
 
@@ -336,11 +336,11 @@ mod test {
             ema:        50,
             ema_expo:   1,
         };
-        let item_a = borsh::BorshSerialize::try_to_vec(&price_account_a).unwrap();
+        let item_a = borsh::to_vec(&price_account_a).unwrap();
 
         let mut price_only_b = PriceOnly::from(price_account_a);
         price_only_b.price = 200;
-        let item_b = BorshSerialize::try_to_vec(&price_only_b).unwrap();
+        let item_b = borsh::to_vec(&price_only_b).unwrap();
         let item_c = 2usize.to_be_bytes();
         let item_d = 88usize.to_be_bytes();