Open bkontur opened 3 weeks ago
Part of: https://github.com/paritytech/polkadot-sdk/issues/3214 Follow-up of: https://github.com/paritytech/polkadot-sdk/pull/6148
RemoteLockedFungibles
actual shape:
pallet::storage] pub(super) type RemoteLockedFungibles<T: Config> = StorageDoubleMap< _, ( NMapKey<Twox64Concat, XcmVersion>, NMapKey<Blake2_128Concat, T::AccountId>, NMapKey<Blake2_128Concat, VersionedAssetId>, ), RemoteLockedFungibleRecord<T::RemoteLockConsumerIdentifier, T::MaxRemoteLockConsumers>, OptionQuery, >;
proposed shape: - we don't need XcmVersion nmapkey prefx here
XcmVersion
#[pallet::storage] pub(super) type RemoteLockedFungibles<T: Config> = StorageDoubleMap< _, Blake2_128Concat, T::AccountId, Blake2_128Concat, VersionedAssetId, RemoteLockedFungibleRecord<T::RemoteLockConsumerIdentifier, T::MaxRemoteLockConsumers>, OptionQuery, >;
VersionedLocation
VersionedLocation::V4
VersionedLocation::V5
ensure!(self.locker == record.locker && self.owner == record.owner, UnexpectedState); ensure!(old.locker == record.locker && old.owner == record.owner, WouldClobber);
LockedFungibles
x.1.try_as::<_>() == Ok(&unlocker)
RecordedXcm
xcm::latest::Xcm
xcm::VersionedXcm
try_state
Does RecordedXcm work when adding a new XCM version? Possibly it could work, when XCM is compatible.
Part of: https://github.com/paritytech/polkadot-sdk/issues/3214 Follow-up of: https://github.com/paritytech/polkadot-sdk/pull/6148
RemoteLockedFungibles
actual shape:
proposed shape: - we don't need
XcmVersion
nmapkey prefx hereVersionedLocation
does not work when comparingVersionedLocation::V4
andVersionedLocation::V5
LockedFungibles
we do a correct checks e.g.:x.1.try_as::<_>() == Ok(&unlocker)
RecordedXcm
change storedxcm::latest::Xcm
toxcm::VersionedXcm
?try_state
checkDoes
RecordedXcm
work when adding a new XCM version? Possibly it could work, when XCM is compatible.Bump storage version
RemoteLockedFungibles
requires this bump