Skip to content

Remove transactional #800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions payments/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub mod pallet {
};
use frame_support::{
dispatch::DispatchResultWithPostInfo, fail, pallet_prelude::*, require_transactional,
storage::bounded_btree_map::BoundedBTreeMap, traits::tokens::BalanceStatus, transactional,
storage::bounded_btree_map::BoundedBTreeMap, traits::tokens::BalanceStatus,
};
use frame_system::pallet_prelude::*;
use orml_traits::{MultiCurrency, MultiReservableCurrency};
Expand Down Expand Up @@ -279,7 +279,6 @@ pub mod pallet {
/// the option to add a remark, this remark can then be used to run
/// custom logic and trigger alternate payment flows. the specified
/// amount.
#[transactional]
#[pallet::weight(T::WeightInfo::pay(T::MaxRemarkLength::get()))]
pub fn pay(
origin: OriginFor<T>,
Expand Down Expand Up @@ -314,7 +313,6 @@ pub mod pallet {

/// Release any created payment, this will transfer the reserved amount
/// from the creator of the payment to the assigned recipient
#[transactional]
#[pallet::weight(T::WeightInfo::release())]
pub fn release(origin: OriginFor<T>, to: T::AccountId) -> DispatchResultWithPostInfo {
let from = ensure_signed(origin)?;
Expand All @@ -333,7 +331,6 @@ pub mod pallet {
/// Cancel a payment in created state, this will release the reserved
/// back to creator of the payment. This extrinsic can only be called by
/// the recipient of the payment
#[transactional]
#[pallet::weight(T::WeightInfo::cancel())]
pub fn cancel(origin: OriginFor<T>, creator: T::AccountId) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
Expand All @@ -356,7 +353,6 @@ pub mod pallet {
/// recipient of the payment.
/// This extrinsic allows the assigned judge to
/// cancel/release/partial_release the payment.
#[transactional]
#[pallet::weight(T::WeightInfo::resolve_payment())]
pub fn resolve_payment(
origin: OriginFor<T>,
Expand Down Expand Up @@ -392,7 +388,6 @@ pub mod pallet {
/// Allow the creator of a payment to initiate a refund that will return
/// the funds after a configured amount of time that the reveiver has to
/// react and opose the request
#[transactional]
#[pallet::weight(T::WeightInfo::request_refund())]
pub fn request_refund(origin: OriginFor<T>, recipient: T::AccountId) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
Expand Down Expand Up @@ -440,7 +435,6 @@ pub mod pallet {
/// payment creator This does not cancel the request, instead sends the
/// payment to a NeedsReview state The assigned resolver account can
/// then change the state of the payment after review.
#[transactional]
#[pallet::weight(T::WeightInfo::dispute_refund())]
pub fn dispute_refund(origin: OriginFor<T>, creator: T::AccountId) -> DispatchResultWithPostInfo {
use PaymentState::*;
Expand Down Expand Up @@ -487,7 +481,6 @@ pub mod pallet {
// using the `accept_and_pay` extrinsic. The payment will be in
// PaymentRequested State and can only be modified by the `accept_and_pay`
// extrinsic.
#[transactional]
#[pallet::weight(T::WeightInfo::request_payment())]
pub fn request_payment(
origin: OriginFor<T>,
Expand Down Expand Up @@ -516,7 +509,6 @@ pub mod pallet {
// This extrinsic allows the sender to fulfill a payment request created by a
// recipient. The amount will be transferred to the recipient and payment
// removed from storage
#[transactional]
#[pallet::weight(T::WeightInfo::accept_and_pay())]
pub fn accept_and_pay(origin: OriginFor<T>, to: T::AccountId) -> DispatchResultWithPostInfo {
let from = ensure_signed(origin)?;
Expand Down
8 changes: 1 addition & 7 deletions xtokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use frame_support::{
pallet_prelude::*,
require_transactional,
traits::{Contains, Get},
transactional, Parameter,
Parameter,
};
use frame_system::{ensure_signed, pallet_prelude::*};
use sp_runtime::{
Expand Down Expand Up @@ -200,7 +200,6 @@ pub mod module {
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer(currency_id.clone(), *amount, dest))]
#[transactional]
pub fn transfer(
origin: OriginFor<T>,
currency_id: T::CurrencyId,
Expand All @@ -226,7 +225,6 @@ pub mod module {
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer_multiasset(asset, dest))]
#[transactional]
pub fn transfer_multiasset(
origin: OriginFor<T>,
asset: Box<VersionedMultiAsset>,
Expand Down Expand Up @@ -261,7 +259,6 @@ pub mod module {
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer(currency_id.clone(), *amount, dest))]
#[transactional]
pub fn transfer_with_fee(
origin: OriginFor<T>,
currency_id: T::CurrencyId,
Expand Down Expand Up @@ -298,7 +295,6 @@ pub mod module {
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer_multiasset(asset, dest))]
#[transactional]
pub fn transfer_multiasset_with_fee(
origin: OriginFor<T>,
asset: Box<VersionedMultiAsset>,
Expand Down Expand Up @@ -330,7 +326,6 @@ pub mod module {
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer_multicurrencies(currencies, fee_item, dest))]
#[transactional]
pub fn transfer_multicurrencies(
origin: OriginFor<T>,
currencies: Vec<(T::CurrencyId, T::Balance)>,
Expand Down Expand Up @@ -360,7 +355,6 @@ pub mod module {
/// by the network, and if the receiving chain would handle
/// messages correctly.
#[pallet::weight(Pallet::<T>::weight_of_transfer_multiassets(assets, fee_item, dest))]
#[transactional]
pub fn transfer_multiassets(
origin: OriginFor<T>,
assets: Box<VersionedMultiAssets>,
Expand Down