Open NachoPal opened 1 year ago
TBH I'm not sure why the storage items are private. For example in Staking the storage is public, which allows building upon it.
It's really useful for 3rd-party developers that want to introduce their own logic building upon frame
.
Currently a lot of 3rd party projects implement their own Assets and other pallets, because there is no easy way to customize the current design or reuse some of it's parts.
And all the storage is public anyway when you access it from the outside world.
One concern is it exposes some internal structs that are subject to change, but that's not such a big problem as this will produce compile-time errors if some other pallet depends on those and any changes to pallet storage should be accompanied by migrations anyway.
The other concern is storage modification bypassing the rules a pallet imposes in it's logic, but that's the price one might want to pay for extensibility. Or at the very least being able to expose storage as RO is already a big win.
I was trying to populate my chain with some assets via a runtime upgrade + storage migration, but it seems it is not possible because
AssetDetails
&AssetMetadata
fields are private.Here an example of a migration that will not compile:
What I am trying to do is actually not possible? or I am missing something? Might it be possible to make those Structs public?