Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"

members = [
"pyth-sdk",
Expand Down
7 changes: 4 additions & 3 deletions examples/sol-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ edition = "2021"
crate-type = ["cdylib", "lib"]

[dependencies]
borsh = "0.10.3"
borsh = { version = "1.5.0", features = ["derive"] }
borsh-derive = "1.5.0"
arrayref = "0.3.6"
solana-program = ">= 1.10"
pyth-sdk-solana = { path = "../../pyth-sdk-solana", version = "0.10.0" }
solana-program = "1.18.4"
pyth-sdk-solana = { path = "../../pyth-sdk-solana" }
2 changes: 1 addition & 1 deletion examples/sol-contract/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! Init{} initializing some loan information and
//! Loan2Value{} checking the loan-to-value ratio of the loan.

use borsh::{
use borsh_derive::{
BorshDeserialize,
BorshSerialize,
};
Expand Down
7 changes: 2 additions & 5 deletions examples/sol-contract/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ use solana_program::pubkey::Pubkey;
use solana_program::sysvar::clock::Clock;
use solana_program::sysvar::Sysvar;

use borsh::{
BorshDeserialize,
BorshSerialize,
};
use borsh::BorshDeserialize;
use pyth_sdk_solana::state::SolanaPriceAccount;

use crate::instruction::ExampleInstructions;
Expand Down Expand Up @@ -56,7 +53,7 @@ pub fn process_instruction(
SolanaPriceAccount::account_info_to_feed(pyth_loan_account)?;
SolanaPriceAccount::account_info_to_feed(pyth_collateral_account)?;

let config_data = config.try_to_vec()?;
let config_data = borsh::to_vec(&config)?;
let config_dst = &mut admin_config_account.try_borrow_mut_data()?;
sol_memcpy(config_dst, &config_data, 1 + 32 + 32);
Ok(())
Expand Down
10 changes: 5 additions & 5 deletions pyth-sdk-solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ keywords = [ "pyth", "solana", "oracle" ]
readme = "README.md"

[dependencies]
solana-program = ">= 1.9"
borsh = "0.10.3"
borsh-derive = "0.10.3"
solana-program = "1.18.14"
borsh = "1.5.0"
borsh-derive = "1.5.0"
bytemuck = "1.7.2"
num-derive = "0.3"
num-traits = "0.2"
Expand All @@ -22,8 +22,8 @@ serde = { version = "1.0.136", features = ["derive"] }
pyth-sdk = { path = "../pyth-sdk", version = "0.8.0" }

[dev-dependencies]
solana-client = ">= 1.9"
solana-sdk = ">= 1.9"
solana-client = "1.18.14"
solana-sdk = "1.18.14"

[lib]
crate-type = ["cdylib", "lib"]
Expand Down
2 changes: 1 addition & 1 deletion pyth-sdk-solana/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Structures and functions for interacting with Solana on-chain account data.

use borsh::{
use borsh_derive::{
BorshDeserialize,
BorshSerialize,
};
Expand Down
14 changes: 7 additions & 7 deletions pyth-sdk-solana/test-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ test-bpf = []
no-entrypoint = []

[dependencies]
pyth-sdk-solana = { path = "../", version = "0.10.0" }
solana-program = ">= 1.10, <= 1.16"
pyth-sdk-solana = { path = "../" }
solana-program = "1.18.14"
bytemuck = "1.7.2"
borsh = "0.10.3"
borsh-derive = "0.10.3"
borsh = "1.5.0"
borsh-derive = "1.5.0"

[dev-dependencies]
solana-program-test = ">= 1.10, <= 1.16"
solana-client = ">= 1.10, <= 1.16"
solana-sdk = ">= 1.10, <= 1.16"
solana-program-test = "1.18.4"
solana-client = "1.18.4"
solana-sdk = "1.18.4"

[lib]
crate-type = ["cdylib", "lib"]
Expand Down
4 changes: 2 additions & 2 deletions pyth-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ crate-type = ["cdylib", "lib"]

[dependencies]
hex = { version = "0.4.3", features = ["serde"] }
borsh = "0.10.3"
borsh-derive = "0.10.3"
borsh = "1.5.0"
borsh-derive = "1.5.0"
serde = { version = "1.0.136", features = ["derive"] }
schemars = "0.8.8"
getrandom = { version = "0.2.2", features = ["custom"] }
Expand Down
2 changes: 1 addition & 1 deletion pyth-sdk/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use borsh::{
use borsh_derive::{
BorshDeserialize,
BorshSerialize,
};
Expand Down
2 changes: 1 addition & 1 deletion pyth-sdk/src/price.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use borsh::{
use borsh_derive::{
BorshDeserialize,
BorshSerialize,
};
Expand Down