Skip to content

pyth-solana-receiver-sdk 1.2.0 compiles natively against anchor-lang 0.32.1 #3756

Description

@ConvertibleCapital

The issue is a version conflict: pyth-solana-receiver-sdk 1.2.0 internally depends on anchor-lang 0.32.1, but the project uses anchor-lang 1.0.2

pyth-solana-receiver-sdk 1.2.0 → anchor-lang 0.32.1 → borsh 0.10.4
pythnet-sdk 2.3.1 → anchor-lang 1.0.2 → borsh 1.6.1

[dependencies]
anchor-lang = { version = "1.0.2", features = ["init-if-needed"] }
anchor-spl = "1.0.2"
pyth-solana-receiver-sdk = "1.2.0"
getrandom = { version = "0.2", features = ["custom"] }
Error Details

Compiling pyth-solana-receiver-sdk v1.2.0
error[E0277]: the trait bound pythnet_sdk::messages::PriceFeedMessage: BorshSerialize is not satisfied
--> src/price_update.rs:49:1
|
49 | #[account]
| ^^^^^^^^^^ the trait BorshSerialize is not implemented for pythnet_sdk::messages::PriceFeedMessage
|
note: there are multiple different versions of crate borsh in the dependency graph
--> src/ser/mod.rs:44:1
|
= note: this is the required trait
|
::: src/lib.rs:5:5
|
5 | anchor_lang::{declare_id, prelude::*},
| -----------
| |
| one version of crate borsh used here, as a dependency of crate solana_pubkey
| one version of crate borsh used here, as a dependency of crate solana_pubkey
--> src/messages.rs:93:1
|
= note: this type doesn't implement the required trait
--> src/de/mod.rs:36:1
|
= note: this is the found trait
= help: you can use cargo tree to explore your dependency tree
= help: see issue #48214
= note: this error originates in the derive macro AnchorSerialize (in Nightly builds, run with -Z macro-backtrace for more info)
help: add #![feature(trivial_bounds)] to the crate attributes to enable
--> src/lib.rs:4:1
|
4 + #![feature(trivial_bounds)]
|

error[E0277]: the trait bound pythnet_sdk::messages::PriceFeedMessage: BorshDeserialize is not satisfied
--> src/price_update.rs:49:1
|
49 | #[account]
| ^^^^^^^^^^ the trait BorshDeserialize is not implemented for pythnet_sdk::messages::PriceFeedMessage
|
note: there are multiple different versions of crate borsh in the dependency graph
--> src/de/mod.rs:35:1
|
= note: this is the required trait
::: src/de/mod.rs:36:1
|
= note: this is the found trait
|
::: src/lib.rs:5:5
|
5 | anchor_lang::{declare_id, prelude::*},
| -----------
| |
| one version of crate borsh used here, as a dependency of crate solana_pubkey
| one version of crate borsh used here, as a dependency of crate solana_pubkey
--> src/messages.rs:93:1
|
= note: this type doesn't implement the required trait
= help: you can use cargo tree to explore your dependency tree
= help: see issue #48214
= note: this error originates in the derive macro AnchorDeserialize (in Nightly builds, run with -Z macro-backtrace for more info)
help: add #![feature(trivial_bounds)] to the crate attributes to enable
--> src/lib.rs:4:1
|
4 + #![feature(trivial_bounds)]
|

error[E0277]: the trait bound pythnet_sdk::messages::PriceFeedMessage: BorshSerialize is not satisfied
--> src/price_update.rs:49:1
|
49 | #[account]
| ^^^^^^^^^^ the trait BorshSerialize is not implemented for pythnet_sdk::messages::PriceFeedMessage
|
note: there are multiple different versions of crate borsh in the dependency graph
--> src/ser/mod.rs:44:1
|
= note: this is the required trait
|
::: src/lib.rs:5:5
|
5 | anchor_lang::{declare_id, prelude::*},
| -----------
| |
| one version of crate borsh used here, as a dependency of crate solana_pubkey
| one version of crate borsh used here, as a dependency of crate solana_pubkey
--> src/messages.rs:93:1
|
= note: this type doesn't implement the required trait
--> src/de/mod.rs:36:1
|
= note: this is the found trait
= help: you can use cargo tree to explore your dependency tree
note: required for PriceUpdateV2 to implement BorshSerialize
--> src/price_update.rs:49:1
|
49 | #[account]
| ^^^^^^^^^^ unsatisfied trait bound introduced in this derive macro
50 | #[derive(BorshSchema)]
51 | pub struct PriceUpdateV2 {
| ^^^^^^^^^^^^^
= note: this error originates in the attribute macro account which comes from the expansion of the derive macro AnchorSerialize (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound pythnet_sdk::messages::PriceFeedMessage: BorshDeserialize is not satisfied
--> src/price_update.rs:49:1
|
49 | #[account]
| ^^^^^^^^^^ the trait BorshDeserialize is not implemented for pythnet_sdk::messages::PriceFeedMessage
|
note: there are multiple different versions of crate borsh in the dependency graph
--> src/de/mod.rs:35:1
|
= note: this is the required trait
::: src/de/mod.rs:36:1
|
= note: this is the found trait
|
::: src/lib.rs:5:5
|
5 | anchor_lang::{declare_id, prelude::*},
| -----------
| |
| one version of crate borsh used here, as a dependency of crate solana_pubkey
| one version of crate borsh used here, as a dependency of crate solana_pubkey
--> src/messages.rs:93:1
|
= note: this type doesn't implement the required trait
= help: you can use cargo tree to explore your dependency tree
note: required for PriceUpdateV2 to implement BorshDeserialize
--> src/price_update.rs:49:1
|
49 | #[account]
| ^^^^^^^^^^ unsatisfied trait bound introduced in this derive macro
50 | #[derive(BorshSchema)]
51 | pub struct PriceUpdateV2 {
| ^^^^^^^^^^^^^
= note: this error originates in the attribute macro account which comes from the expansion of the derive macro AnchorDeserialize (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try rustc --explain E0277.
error: could not compile pyth-solana-receiver-sdk (lib) due to 4 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions