1

I am trying to build a solana program but get this error.

error[E0277]: the trait bound `T: spl_discriminator::discriminator::SplDiscriminate` is not satisfied

the dependencies I have are as follows:

[package]
name = "cumulus_delta_v2"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"
rust-version = "1.75.0"

[lib]
crate-type = ["cdylib", "lib"]
name = "cumulus_delta_v2"

[features]
default = []
cpi = ["no-entrypoint"]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]

[dependencies]
anchor-lang = {version = "0.30.1", features = ["idl-build", "init-if-needed"]}
anchor-spl = {version = "0.30.1", features = ["idl-build"]}
spl-token-2022 = "5.0.2"
solana-program = "2.0.13"
spl-discriminator = "0.3.0"
spl-tlv-account-resolution = "0.8.1"
spl-transfer-hook-interface = "0.8.2"
spl-type-length-value = "0.6.0"
spl-pod = "0.4.0"

I have look at the other answers on here but am unable to make any sense of it.

1 Answer 1

1

I was able to isolate this to an incompatibility between the newest SPL libraries and Anchor. Since Anchor 0.30.1 uses spl-token-2022 v3 and solana-program v1.18, you'll need to bump down a few other dependencies.

I got this to work:

[dependencies]
anchor-lang = {version = "0.30.1", features = ["idl-build", "init-if-needed"]}
anchor-spl = {version = "0.30.1", features = ["idl-build"]}
spl-token-2022 = "3.0.0"
solana-program = "=2.0.13"
spl-discriminator = "0.2.0"
spl-tlv-account-resolution = "0.6.0"
spl-transfer-hook-interface = "0.6.0"
spl-type-length-value = "0.4.0"
spl-pod = "0.2.0"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.