No custom data migration logic for this pallet. but the data retrieved by the chain state has changed. here is code logic.
#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)]
pub enum MyEnum {
A,
B,
C,
D,
}
#[derive(Clone, Encode, Decode, Eq, Copy, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)]
pub struct MyStruct<
Balance: Encode + Decode + Clone + Debug + Eq + PartialEq,
AccountId: Encode + Decode + Clone + Debug + Eq + PartialEq,
> {
pub account: AccountId,
pub cost: Balance,
pub action: MyEnum,
}
#[pallet::storage]
#[pallet::getter(fn action_list)]
pub(super) type ActionListOf<T: Config> =
StorageMap<_, Blake2_128Concat, MyEnum, Vec<Option<MyStruct<BalanceOf<T>, T::AccountId>>>, ValueQuery>;
before the upgrade, the retrieved data of the chain state is as follows:
[
[
[
B
]
[
{
account: 5HgtRNQxpttSomysgAsGgYmohdMD8knPBt8HtR5EH3neLbvV
fee: 100,000,000,000,000,0
action: B
}
]
]
]
After the upgrade, the retrieved data of the chain state is as follows:
[
[
[
A
]
[
{
account: 5HgtRNQxpttSomysgAsGgYmohdMD8knPBt8HtR5EH3neLbvV
fee: 100,000,000,000,000,0
action: B
}
]
]
]
The key in the StorageMap has changed, how to fix this problem?
commit checklist QA:
- no update code for this pallet
- update system weight