Skip to content

Commit f2d7436

Browse files
authored
feat(lazer) Make price optional in jrpc update message (#3161)
1 parent 331c14e commit f2d7436

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/contracts/solana/programs/pyth-lazer-solana-contract/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ no-log-ix-name = []
1919
idl-build = ["anchor-lang/idl-build"]
2020

2121
[dependencies]
22-
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.19.0" }
22+
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.20.0" }
2323

2424
anchor-lang = "0.31.1"
2525
bytemuck = { version = "1.20.0", features = ["derive"] }

lazer/publisher_sdk/rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "pyth-lazer-publisher-sdk"
3-
version = "0.19.0"
3+
version = "0.20.0"
44
edition = "2021"
55
description = "Pyth Lazer Publisher SDK types."
66
license = "Apache-2.0"
77
repository = "https://github.com/pyth-network/pyth-crosschain"
88

99
[dependencies]
10-
pyth-lazer-protocol = { version = "0.19.0", path = "../../sdk/rust/protocol" }
10+
pyth-lazer-protocol = { version = "0.20.0", path = "../../sdk/rust/protocol" }
1111
anyhow = "1.0.98"
1212
protobuf = "3.7.2"
1313
serde_json = "1.0.140"

lazer/publisher_sdk/rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl From<UpdateParams> for Update {
5656
best_bid_price,
5757
best_ask_price,
5858
} => Update::PriceUpdate(PriceUpdate {
59-
price: Some(price.mantissa_i64()),
59+
price: price.map(|p| p.mantissa_i64()),
6060
best_bid_price: best_bid_price.map(|p| p.mantissa_i64()),
6161
best_ask_price: best_ask_price.map(|p| p.mantissa_i64()),
6262
special_fields: Default::default(),

lazer/sdk/rust/client/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "pyth-lazer-client"
3-
version = "8.5.0"
3+
version = "8.6.0"
44
edition = "2021"
55
description = "A Rust client for Pyth Lazer"
66
license = "Apache-2.0"
77

88
[dependencies]
9-
pyth-lazer-protocol = { path = "../protocol", version = "0.19.0" }
9+
pyth-lazer-protocol = { path = "../protocol", version = "0.20.0" }
1010
tokio = { version = "1", features = ["full"] }
1111
tokio-tungstenite = { version = "0.20", features = ["native-tls"] }
1212
futures-util = "0.3"

lazer/sdk/rust/protocol/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-lazer-protocol"
3-
version = "0.19.0"
3+
version = "0.20.0"
44
edition = "2021"
55
description = "Pyth Lazer SDK - protocol types."
66
license = "Apache-2.0"

lazer/sdk/rust/protocol/src/jrpc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub struct FeedUpdateParams {
4545
pub enum UpdateParams {
4646
#[serde(rename = "price")]
4747
PriceUpdate {
48-
price: Price,
48+
price: Option<Price>,
4949
best_bid_price: Option<Price>,
5050
best_ask_price: Option<Price>,
5151
},
@@ -190,7 +190,7 @@ mod tests {
190190
feed_id: PriceFeedId(1),
191191
source_timestamp: TimestampUs::from_micros(124214124124),
192192
update: UpdateParams::PriceUpdate {
193-
price: Price::from_integer(1234567890, 0).unwrap(),
193+
price: Some(Price::from_integer(1234567890, 0).unwrap()),
194194
best_bid_price: Some(Price::from_integer(1234567891, 0).unwrap()),
195195
best_ask_price: Some(Price::from_integer(1234567892, 0).unwrap()),
196196
},
@@ -231,7 +231,7 @@ mod tests {
231231
feed_id: PriceFeedId(1),
232232
source_timestamp: TimestampUs::from_micros(124214124124),
233233
update: UpdateParams::PriceUpdate {
234-
price: Price::from_integer(1234567890, 0).unwrap(),
234+
price: Some(Price::from_integer(1234567890, 0).unwrap()),
235235
best_bid_price: Some(Price::from_integer(1234567891, 0).unwrap()),
236236
best_ask_price: Some(Price::from_integer(1234567892, 0).unwrap()),
237237
},
@@ -272,7 +272,7 @@ mod tests {
272272
feed_id: PriceFeedId(1),
273273
source_timestamp: TimestampUs::from_micros(124214124124),
274274
update: UpdateParams::PriceUpdate {
275-
price: Price::from_integer(1234567890, 0).unwrap(),
275+
price: Some(Price::from_integer(1234567890, 0).unwrap()),
276276
best_bid_price: Some(Price::from_integer(1234567891, 0).unwrap()),
277277
best_ask_price: Some(Price::from_integer(1234567892, 0).unwrap()),
278278
},
@@ -312,7 +312,7 @@ mod tests {
312312
feed_id: PriceFeedId(1),
313313
source_timestamp: TimestampUs::from_micros(745214124124),
314314
update: UpdateParams::PriceUpdate {
315-
price: Price::from_integer(5432, 0).unwrap(),
315+
price: Some(Price::from_integer(5432, 0).unwrap()),
316316
best_bid_price: Some(Price::from_integer(5432, 0).unwrap()),
317317
best_ask_price: Some(Price::from_integer(5432, 0).unwrap()),
318318
},
@@ -351,7 +351,7 @@ mod tests {
351351
feed_id: PriceFeedId(1),
352352
source_timestamp: TimestampUs::from_micros(124214124124),
353353
update: UpdateParams::PriceUpdate {
354-
price: Price::from_integer(1234567890, 0).unwrap(),
354+
price: Some(Price::from_integer(1234567890, 0).unwrap()),
355355
best_bid_price: None,
356356
best_ask_price: None,
357357
},

0 commit comments

Comments
 (0)