I am attempting to use a custom struct in a map which needs to be stored.

#[derive(Encode, Decode, Default, Clone, PartialEq, TypeInfo)]
#[cfg_attr(feature = "std", derive(Debug))]
pub(super) struct Amendment<AccountId> {
        pub statement: Vec<u8>,
        pub owners: Vec<AccountId>,

#[pallet::getter(fn declaration_map)]
pub(super) type Declarations<T: Config> = StorageMap
<T as Config>::AccountId,
Amendment<<T as pallet::Config>::AccountId>,

It is giving me this error:

enter image description here

Is there a way to make it public?

1 Answer 1


#[pallet::storage] creates a pub fn amendment() -> Amendment<_> { .. } which leaks Amendment<_> which is according to your definition a narrower public scope.


pub(super) Amendment must become pub Amendment to resolve this.

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.