Skip to content
Snippets Groups Projects

Oneshot accounts

Merged Pascal Engélibert requested to merge poc-oneshot-accounts into master
Compare and Show latest version
2 files
+ 9
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -23,6 +23,7 @@ use frame_support::traits::{
Currency, ExistenceRequirement, Imbalance, IsSubType, WithdrawReasons,
};
use frame_system::pallet_prelude::*;
use pallet_transaction_payment::OnChargeTransaction;
use sp_runtime::traits::{DispatchInfoOf, PostDispatchInfoOf, Saturating, StaticLookup, Zero};
#[frame_support::pallet]
@@ -46,6 +47,7 @@ pub mod pallet {
type Currency: Currency<Self::AccountId>;
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type InnerOnChargeTransaction: OnChargeTransaction<Self>;
}
// STORAGE //
@@ -329,7 +331,7 @@ pub mod pallet {
impl<T: Config> pallet_transaction_payment::OnChargeTransaction<T> for Pallet<T>
where
T::Call: IsSubType<Call<T>>,
T::Currency:
/*T::Currency:
Currency<
T::AccountId,
Balance = <T::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<
@@ -343,12 +345,12 @@ where
<T::Currency as Currency<T::AccountId>>::NegativeImbalance: Imbalance<
<T::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance,
Opposite = <T::Currency as Currency<T::AccountId>>::PositiveImbalance,
>,
/*T::OnChargeTransaction: pallet_transaction_payment::OnChargeTransaction<
>,*/
T::InnerOnChargeTransaction: pallet_transaction_payment::OnChargeTransaction<
T,
Balance = <T::Currency as Currency<T::AccountId>>::Balance,
LiquidityInfo = Option<<T::Currency as Currency<T::AccountId>>::NegativeImbalance>,
>,*/
>,
{
type Balance = <T::Currency as Currency<T::AccountId>>::Balance;
type LiquidityInfo = Option<<T::Currency as Currency<T::AccountId>>::NegativeImbalance>;
@@ -384,7 +386,7 @@ where
InvalidTransaction::Payment,
))
} else {
T::OnChargeTransaction::withdraw_fee(who, call, dispatch_info, fee, tip)
T::InnerOnChargeTransaction::withdraw_fee(who, call, dispatch_info, fee, tip)
}
}
fn correct_and_deposit_fee(
@@ -395,7 +397,7 @@ where
tip: Self::Balance,
already_withdrawn: Self::LiquidityInfo,
) -> Result<(), TransactionValidityError> {
T::OnChargeTransaction::correct_and_deposit_fee(
T::InnerOnChargeTransaction::correct_and_deposit_fee(
who,
dispatch_info,
post_info,
Loading