I'm working on a feature that requires pallet-nfts ForceOrigin to only be callable by an account configured inside a separated pallet's storage. For example in pallet-A I have the following
#[pallet::storage]
pub type Authority<T: Config> = StorageValue<_, T::AccountId, OptionQuery>;
Now I need to configure pallet-nfts ForceOrigin
to take this Authority as the allowed origin. For this I'm trying to use EnsureOriginBy like this
impl pallet_nfts::Config for Runtime {
...
type ForceOrigin = EnsureSignedBy<Authority, AccountId>;
...
}
How could I define Authority
in the runtime config to get the value in pallet-A storage?
I have an alternative solution which is to define the account directly in the runtime config
pub const Authority: AccountId = AccountId::from(hex_literal::hex!("00000000000000000000000000000000000"));
But this would mean that the only way to change this authority is via a runtime upgrade and not though a call to a setAuthority()
extrinsic in pallet-A