Skip to content

Commit 270d24d

Browse files
authored
Use message structures defined in pythnet sdk (#377)
* Use message structures defined in pythnet sdk Since the custom serialization implementations are solana specific and mainly for reducing the binary size, they are kept in this package via a custom trait. Deserialization functions were removed since they were not used and the default serde provided by pythnet sdk should work identically. Serialization tests are now repurposed to test our custom serialization and the general deserialization lead to the same original structure. * Set resolver version to 2 to avoid some feature unifications The old resolver adds the quickcheck feature on the pythnet-sdk dependency for non-dev builds as well which leads to compile errors.
1 parent b09ee14 commit 270d24d

File tree

8 files changed

+147
-389
lines changed

8 files changed

+147
-389
lines changed

Cargo.lock

+54-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[workspace]
2+
resolver = "2"
23
members = [
34
"program/rust"
45
]

program/rust/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ num-traits = "0.2"
1717
byteorder = "1.4.3"
1818
serde = { version = "1.0", features = ["derive"], optional = true }
1919
strum = { version = "0.24.1", features = ["derive"], optional = true }
20+
pythnet-sdk = { git = "https://github.com/pyth-network/pyth-crosschain", rev="60144002053a93f424be70decd8a8ccb8d618d81"}
2021

2122
[dev-dependencies]
2223
solana-program-test = "=1.13.3"
@@ -28,6 +29,7 @@ rand = "0.8.5"
2829
quickcheck_macros = "1"
2930
bincode = "1.3.3"
3031
serde = { version = "1.0", features = ["derive"] }
32+
pythnet-sdk = { git = "https://github.com/pyth-network/pyth-crosschain", rev="60144002053a93f424be70decd8a8ccb8d618d81", features = ["quickcheck"]}
3133
serde_json = "1.0"
3234
test-generator = "0.3.1"
3335
csv = "1.1"

program/rust/src/accounts.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@ pub use {
5252
mapping::MappingAccount,
5353
permission::PermissionAccount,
5454
price::{
55-
Message,
5655
PriceAccount,
5756
PriceAccountV2,
5857
PriceComponent,
5958
PriceCumulative,
6059
PriceEma,
61-
PriceFeedMessage,
6260
PriceInfo,
63-
TwapMessage,
61+
PythOracleSerialize,
6462
},
6563
product::{
6664
read_pc_str_t,

0 commit comments

Comments
 (0)