error[E0308]: mismatched types

not sure how to solve it
error[E0308]****: mismatched types

--> /Users/annateklinska/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sp-core-8.0.0/src/sr25519.rs:591:33

|

591 | let mini_key: MiniSecretKey = mini_secret_from_entropy(entropy, password.unwrap_or(""))

| ____________________-------------^

| | |

| | expected due to this

592 | | .expect("32 bytes can always build a key; qed");

| |___________________________________________________________^ expected MiniSecretKey, found a different MiniSecretKey

|

= note: MiniSecretKey and MiniSecretKey have similar names, but are actually distinct types

note: MiniSecretKey is defined in crate schnorrkel

--> /Users/annateklinska/.cargo/registry/src/index.crates.io-6f17d22bba15001f/schnorrkel-0.11.4/src/keys.rs:99:1

|

99 | pub struct MiniSecretKey(pub (crate) [u8; MINI_SECRET_KEY_LENGTH]);

| ^^^^^^^^^^^^^^^^^^^^^^^^

note: MiniSecretKey is defined in crate schnorrkel

--> /Users/annateklinska/.cargo/registry/src/index.crates.io-6f17d22bba15001f/schnorrkel-0.9.1/src/keys.rs:99:1

|

99 | pub struct MiniSecretKey(pub (crate) [u8; MINI_SECRET_KEY_LENGTH]);

| ^^^^^^^^^^^^^^^^^^^^^^^^

= note: perhaps two different versions of crate schnorrkel are being used?

Compiling parity-util-mem-derive v0.1.0

Compiling sp-storage v4.0.0

Compiling parking_lot v0.11.2

Compiling const-oid v0.9.6

For more information about this error, try rustc --explain E0308.

error**:** could not compile sp-core (lib) due to 1 previous error

warning**:** build failed, waiting for other jobs to finish...

You use 2 different versions of schnorrkel 0.11.4 and 0.9.1 and try to use objects from one version with functions from another version. this doesnt work.

You should find out which of your dependencies import the different versions (look at cargo tree). then you can figure out which one to change and to which version.

that my schnorrkel tree
└── schnorrkel v0.9.1
└── schnorrkel v0.11.4
└── schnorrkel v0.9.1 ()
│ │ └── schnorrkel v0.11.4 (
)
│ │ ├── schnorrkel v0.11.4 ()
│ └── schnorrkel v0.9.1 (
)
│ ├── schnorrkel v0.9.1 ()
│ └── schnorrkel v0.11.4 (
)
│ ├── schnorrkel v0.9.1 ()
│ └── schnorrkel v0.9.1 (
)
└── schnorrkel v0.9.1 ()
│ └── schnorrkel v0.11.4 (
)
├── schnorrkel v0.11.4 ()
schnorrkel v0.9.1 (
)
schnorrkel v0.11.4 ()
├── schnorrkel v0.9.1 (
)
├── schnorrkel v0.11.4 ()
├── schnorrkel v0.9.1 (
)
├── schnorrkel v0.11.4 (*)
I also update the cargo.toml file to:
[package]

name = "pallet_ideas"

version = "0.1.0"

edition = "2021"

[dependencies]

schnorrkel = { version = "0.11.4", optional = true }

frame-support = { version = "4.0.0", default-features = false, features = ["std"] }

frame-system = { version = "4.0.0", default-features = false, features = ["std"] }

sp-runtime = { version = "4.0.0", default-features = false, features = ["std"] }

sp-std = { version = "4.0.0", default-features = false, features = ["std"] }

[workspace.dependencies]

schnorrkel = "0.11.4"

[lib]

name = "pallet_ideas"

path = "src/lib.rs"

but the issue persist. Do you have any idea how to solve it?

Please format your code (and errors, and toml files) according to the pinned topic - it's barely readable now and probably missing some of the info to formatting.

There is also information missing from your tree. That is only helpful if you see which crates are pulling in the different versions, so you need the full output (not filtered to the schnorrkel lines)