difftreelog
doc: why transactional is needed in XCM extensions
in: master
1 file changed
pallets/common/src/lib.rsdiffbeforeafterboth2354 /// Create a collection's item using a transaction.2354 /// Create a collection's item using a transaction.2355 ///2355 ///2356 /// This function performs additional XCM-related checks before the actual creation.2356 /// This function performs additional XCM-related checks before the actual creation.2357 ///2358 /// The `transactional` attribute is needed because the inbound XCM messages2359 /// are processed in a non-transactional context.2360 /// To perform the needed logic, we use the internal pallets' functions2361 /// that are not inherently safe to use outside a transaction.2362 ///2363 /// This requirement is temporary until XCM message processing becomes transactional:2364 /// https://github.com/paritytech/polkadot-sdk/issues/4902357 #[transactional]2365 #[transactional]2358 fn create_item(2366 fn create_item(2359 &self,2367 &self,2381 /// Transfer an item from the `from` account to the `to` account using a transaction.2389 /// Transfer an item from the `from` account to the `to` account using a transaction.2382 ///2390 ///2383 /// This function performs additional XCM-related checks before the actual transfer.2391 /// This function performs additional XCM-related checks before the actual transfer.2392 ///2393 /// The `transactional` attribute is needed because the inbound XCM messages2394 /// are processed in a non-transactional context.2395 /// To perform the needed logic, we use the internal pallets' functions2396 /// that are not inherently safe to use outside a transaction.2397 ///2398 /// This requirement is temporary until XCM message processing becomes transactional:2399 /// https://github.com/paritytech/polkadot-sdk/issues/4902384 #[transactional]2400 #[transactional]2385 fn transfer_item(2401 fn transfer_item(2386 &self,2402 &self,2414 ) -> DispatchResult;2430 ) -> DispatchResult;241524312416 /// Burn a collection's item using a transaction.2432 /// Burn a collection's item using a transaction.2433 ///2434 /// The `transactional` attribute is needed because the inbound XCM messages2435 /// are processed in a non-transactional context.2436 /// To perform the needed logic, we use the internal pallets' functions2437 /// that are not inherently safe to use outside a transaction.2438 ///2439 /// This requirement is temporary until XCM message processing becomes transactional:2440 /// https://github.com/paritytech/polkadot-sdk/issues/4902417 #[transactional]2441 #[transactional]2418 fn burn_item(&self, from: T::CrossAccountId, token: TokenId, amount: u128) -> DispatchResult {2442 fn burn_item(&self, from: T::CrossAccountId, token: TokenId, amount: u128) -> DispatchResult {2419 self.burn_item_internal(from, token, amount)2443 self.burn_item_internal(from, token, amount)