diff --git a/.github/workflows/ci-lazer-solana-contract.yml b/.github/workflows/ci-lazer-solana-contract.yml index caddf82985..7dc84d5255 100644 --- a/.github/workflows/ci-lazer-solana-contract.yml +++ b/.github/workflows/ci-lazer-solana-contract.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.81.0 + toolchain: 1.82.0 - name: install taplo run: cargo install --locked taplo-cli@0.9.3 - uses: actions/setup-node@v4 @@ -45,6 +45,7 @@ jobs: - name: Install Anchor run: | rustup install 1.79.0 + rustup install nightly-2025-04-15 RUSTFLAGS= cargo +1.79.0 install --git https://github.com/coral-xyz/anchor --tag v0.30.1 --locked anchor-cli - name: Run anchor tests run: pnpm run test:anchor diff --git a/lazer/Cargo.lock b/lazer/Cargo.lock index e3f26bebc9..158c2cca18 100644 --- a/lazer/Cargo.lock +++ b/lazer/Cargo.lock @@ -3843,7 +3843,7 @@ dependencies = [ [[package]] name = "pyth-lazer-protocol" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", diff --git a/lazer/contracts/solana/package.json b/lazer/contracts/solana/package.json index 8c0068ec02..1fcd44cc29 100644 --- a/lazer/contracts/solana/package.json +++ b/lazer/contracts/solana/package.json @@ -5,7 +5,7 @@ "scripts": { "fix:format": "prettier --write **/*.*", "test:format": "prettier --check **/*.*", - "test:anchor": "CARGO_TARGET_DIR=\"$PWD/target\" anchor test", + "test:anchor": "CARGO_TARGET_DIR=\"$PWD/target\" RUSTUP_TOOLCHAIN=nightly-2025-04-15 anchor test", "setup": "pnpm ts-node scripts/setup.ts", "check-trusted-signer": "pnpm ts-node scripts/check_trusted_signer.ts" }, diff --git a/lazer/sdk/rust/protocol/Cargo.toml b/lazer/sdk/rust/protocol/Cargo.toml index 975f44bbb9..3d27f1b2d2 100644 --- a/lazer/sdk/rust/protocol/Cargo.toml +++ b/lazer/sdk/rust/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-lazer-protocol" -version = "0.7.0" +version = "0.7.1" edition = "2021" description = "Pyth Lazer SDK - protocol types." license = "Apache-2.0" diff --git a/lazer/sdk/rust/protocol/src/api.rs b/lazer/sdk/rust/protocol/src/api.rs index 0a451f7b20..9c6d5de8b8 100644 --- a/lazer/sdk/rust/protocol/src/api.rs +++ b/lazer/sdk/rust/protocol/src/api.rs @@ -4,7 +4,7 @@ use crate::router::{ Channel, Format, JsonBinaryEncoding, JsonUpdate, PriceFeedId, PriceFeedProperty, TimestampUs, }; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct LatestPriceRequest { pub price_feed_ids: Vec, @@ -21,7 +21,7 @@ pub struct LatestPriceRequest { pub channel: Channel, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PriceRequest { pub timestamp: TimestampUs, @@ -37,7 +37,7 @@ pub struct PriceRequest { pub channel: Channel, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ReducePriceRequest { pub payload: JsonUpdate, diff --git a/lazer/sdk/rust/protocol/src/payload.rs b/lazer/sdk/rust/protocol/src/payload.rs index bd5a750c0d..2e01b0deee 100644 --- a/lazer/sdk/rust/protocol/src/payload.rs +++ b/lazer/sdk/rust/protocol/src/payload.rs @@ -40,7 +40,7 @@ pub enum PayloadPropertyValue { FundingTimestamp(Option), } -#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct AggregatedPriceFeedData { pub price: Option, pub best_bid_price: Option, diff --git a/lazer/sdk/rust/protocol/src/publisher.rs b/lazer/sdk/rust/protocol/src/publisher.rs index fccbe67f7d..281b22c5f2 100644 --- a/lazer/sdk/rust/protocol/src/publisher.rs +++ b/lazer/sdk/rust/protocol/src/publisher.rs @@ -10,7 +10,7 @@ use { /// Represents a binary (bincode-serialized) stream update sent /// from the publisher to the router. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PriceFeedDataV2 { pub price_feed_id: PriceFeedId, @@ -36,7 +36,7 @@ pub struct PriceFeedDataV2 { /// Old Represents a binary (bincode-serialized) stream update sent /// from the publisher to the router. /// Superseded by `PriceFeedData`. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct PriceFeedDataV1 { pub price_feed_id: PriceFeedId, @@ -75,14 +75,14 @@ impl From for PriceFeedDataV2 { /// A response sent from the server to the publisher client. /// Currently only serde errors are reported back to the client. -#[derive(Debug, Clone, Serialize, Deserialize, From)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, From)] #[serde(tag = "type")] #[serde(rename_all = "camelCase")] pub enum ServerResponse { UpdateDeserializationError(UpdateDeserializationErrorResponse), } /// Sent to the publisher if the binary data could not be parsed -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UpdateDeserializationErrorResponse { pub error: String, diff --git a/lazer/sdk/rust/protocol/src/router.rs b/lazer/sdk/rust/protocol/src/router.rs index ddff77ed7b..e7c64c0485 100644 --- a/lazer/sdk/rust/protocol/src/router.rs +++ b/lazer/sdk/rust/protocol/src/router.rs @@ -14,13 +14,13 @@ use { }, }; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] pub struct PublisherId(pub u16); -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] pub struct PriceFeedId(pub u32); -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] pub struct ChannelId(pub u8); #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] diff --git a/lazer/sdk/rust/protocol/src/subscription.rs b/lazer/sdk/rust/protocol/src/subscription.rs index 3d5b2b8611..c773283839 100644 --- a/lazer/sdk/rust/protocol/src/subscription.rs +++ b/lazer/sdk/rust/protocol/src/subscription.rs @@ -8,7 +8,7 @@ use { }; /// A request sent from the client to the server. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(tag = "type")] #[serde(rename_all = "camelCase")] pub enum Request { @@ -16,10 +16,10 @@ pub enum Request { Unsubscribe(UnsubscribeRequest), } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] pub struct SubscriptionId(pub u64); -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SubscribeRequest { pub subscription_id: SubscriptionId, @@ -27,7 +27,7 @@ pub struct SubscribeRequest { pub params: SubscriptionParams, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct UnsubscribeRequest { pub subscription_id: SubscriptionId,