I have approvals map in my pallet enter image description here

enter image description here So when i try to get value from my storage, I'm getting this error

enter image description here

So how to properly use pallet storage in tests?

1 Answer 1


You could add a getter for your storage.

#[pallet::getter(fn approvals)]
pub type Approvals<T: Config> = StorageDoubleMap<...>;

Then it could be used in your test.

assert_eq!(TemplateModule::approvals(whitelisted_caller(), recipient), Some(true));

Your Answer

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

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