Skip to content

Commit e368873

Browse files
authored
Add 1000ms channel to Lazer protocol
2 parents 5794589 + 50e7e43 commit e368873

File tree

8 files changed

+24
-19
lines changed

8 files changed

+24
-19
lines changed

Cargo.lock

Lines changed: 12 additions & 12 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.15.2" }
22+
pyth-lazer-protocol = { path = "../../../../sdk/rust/protocol", version = "0.16.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.12.2"
3+
version = "0.13.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.15.2", path = "../../sdk/rust/protocol" }
10+
pyth-lazer-protocol = { version = "0.16.0", path = "../../sdk/rust/protocol" }
1111
anyhow = "1.0.98"
1212
protobuf = "3.7.2"
1313
serde_json = "1.0.140"

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.1.1"
3+
version = "8.2.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.15.2" }
9+
pyth-lazer-protocol = { path = "../protocol", version = "0.16.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.15.2"
3+
version = "0.16.0"
44
edition = "2021"
55
description = "Pyth Lazer SDK - protocol types."
66
license = "Apache-2.0"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ impl Channel {
237237
Channel::FixedRate(fixed_rate) => match fixed_rate.duration().as_millis() {
238238
50 => ChannelId::FIXED_RATE_50,
239239
200 => ChannelId::FIXED_RATE_200,
240+
1000 => ChannelId::FIXED_RATE_1000,
240241
_ => panic!("unknown channel: {self:?}"),
241242
},
242243
Channel::RealTime => ChannelId::REAL_TIME,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl ChannelId {
5252
pub const REAL_TIME: ChannelId = ChannelId(1);
5353
pub const FIXED_RATE_50: ChannelId = ChannelId(2);
5454
pub const FIXED_RATE_200: ChannelId = ChannelId(3);
55+
pub const FIXED_RATE_1000: ChannelId = ChannelId(4);
5556
}
5657

5758
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,15 @@ impl FixedRate {
499499
pub const RATE_200_MS: Self = Self {
500500
rate: DurationUs::from_millis_u32(200),
501501
};
502+
pub const RATE_1000_MS: Self = Self {
503+
rate: DurationUs::from_millis_u32(1000),
504+
};
502505

503506
// Assumptions (tested below):
504507
// - Values are sorted.
505508
// - 1 second contains a whole number of each interval.
506509
// - all intervals are divisable by the smallest interval.
507-
pub const ALL: [Self; 2] = [Self::RATE_50_MS, Self::RATE_200_MS];
510+
pub const ALL: [Self; 3] = [Self::RATE_50_MS, Self::RATE_200_MS, Self::RATE_1000_MS];
508511
pub const MIN: Self = Self::ALL[0];
509512

510513
pub fn from_millis(millis: u32) -> Option<Self> {

0 commit comments

Comments
 (0)