When you go through the openbrush smart contract library. You will notice they are using upgradeable smart contract storage and while defining storage they are using some empty struct as key of similar lib name and using pub _reserved: Option<()>
, in data struct.
pub const STORAGE_KEY: u32 = openbrush::storage_unique_key!(Data)
#[derive(Default, Debug)]
#[openbrush::upgradeable_storage(STORAGE_KEY)]
pub struct Data {
pub attributes: Mapping<(Id, String), String, AttributesKey>,
pub _reserved: Option<()>,
}
pub token_owner: Mapping<Id, Owner>,
pub struct AttributesKey;
impl<'a> TypeGuard<'a> for AttributesKey {
type Type = &'a (&'a Id, &'a String);
}
Why we use pub struct AttributesKey
and pub _reserved: Option<()>
here ?
pub _reserved: Option<()>