0

Im in pallet x - and in one of the benchmarking functions, i need to access a storage map from a pallet y. Hence what my approach was - add the pallet y in the cargo.toml dev dependencies of pallet x, and just import the storage map in my benchmark code like the below use pallet_y::StorageMapExample; and then access this in my benchmarking functions

I have added the pallet y in dev dependency - am i missing something else because my pallet y is not being recognised

1 Answer 1

0

dev-dependencies is a built-in field in Cargo, indicating that it is used for cargo test (development profile).

However, runtime-benchmarks is a customized feature flag specific to the polkadot-sdk. It is typically used with the command cargo build --features runtime-benchmarks ...

In your case, you should write something like:

[dependencies]
pallet-y = { optional = true, default-features = false, .. }

[features]
std = [
  "pallet-y?/std",
  ..
]

runtime-benchmarks = [
  "pallet-y",
  ..
]

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.