Skip to content

Commit

Permalink
Revert formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylavrenov committed Jun 18, 2023
1 parent 39109b1 commit 7086528
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
6 changes: 2 additions & 4 deletions frame/evm/precompile/dispatch/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ impl pallet_evm::Config for Test {
type WeightPerGas = WeightPerGas;

type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping<Self>;
type CallOrigin =
EnsureAddressRoot<<Self::AccountProvider as pallet_evm::AccountProvider>::AccountId>;
type CallOrigin = EnsureAddressRoot<<Self::AccountProvider as pallet_evm::AccountProvider>::AccountId>;

type WithdrawOrigin =
EnsureAddressNever<<Self::AccountProvider as pallet_evm::AccountProvider>::AccountId>;
type WithdrawOrigin = EnsureAddressNever<<Self::AccountProvider as pallet_evm::AccountProvider>::AccountId>;
type AddressMapping = IdentityAddressMapping;
type Currency = Balances;

Expand Down
22 changes: 7 additions & 15 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,12 @@ pub mod pallet {
/// Allow the origin to call on behalf of given address.
type CallOrigin: EnsureAddressOrigin<Self::RuntimeOrigin>;
/// Allow the origin to withdraw on behalf of given address.
type WithdrawOrigin: EnsureAddressOrigin<
Self::RuntimeOrigin,
Success = <Self::AccountProvider as AccountProvider>::AccountId,
>;
type WithdrawOrigin: EnsureAddressOrigin<Self::RuntimeOrigin, Success = <Self::AccountProvider as AccountProvider>::AccountId>;

/// Mapping from address to account id.
type AddressMapping: AddressMapping<<Self::AccountProvider as AccountProvider>::AccountId>;
/// Currency type for withdraw and balance storage.
type Currency: Currency<<Self::AccountProvider as AccountProvider>::AccountId>
+ Inspect<<Self::AccountProvider as AccountProvider>::AccountId>;
type Currency: Currency<<Self::AccountProvider as AccountProvider>::AccountId> + Inspect<<Self::AccountProvider as AccountProvider>::AccountId>;

/// The overarching event type.
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
Expand Down Expand Up @@ -518,14 +514,12 @@ pub mod pallet {
}

/// Type alias for currency balance.
pub type BalanceOf<T> = <<T as Config>::Currency as Currency<
<<T as Config>::AccountProvider as AccountProvider>::AccountId,
>>::Balance;
pub type BalanceOf<T> =
<<T as Config>::Currency as Currency<<<T as Config>::AccountProvider as AccountProvider>::AccountId>>::Balance;

/// Type alias for negative imbalance during fees
type NegativeImbalanceOf<C, T> = <C as Currency<
<<T as Config>::AccountProvider as AccountProvider>::AccountId,
>>::NegativeImbalance;
type NegativeImbalanceOf<C, T> =
<C as Currency<<<T as Config>::AccountProvider as AccountProvider>::AccountId>>::NegativeImbalance;

pub trait EnsureAddressOrigin<OuterOrigin> {
/// Success return type.
Expand Down Expand Up @@ -791,9 +785,7 @@ where
Opposite = C::PositiveImbalance,
>,
OU: OnUnbalanced<NegativeImbalanceOf<C, T>>,
U256: UniqueSaturatedInto<
<C as Currency<<<T as Config>::AccountProvider as AccountProvider>::AccountId>>::Balance,
>,
U256: UniqueSaturatedInto<<C as Currency<<<T as Config>::AccountProvider as AccountProvider>::AccountId>>::Balance>,
{
// Kept type as Option to satisfy bound of Default
type LiquidityInfo = Option<NegativeImbalanceOf<C, T>>;
Expand Down
6 changes: 2 additions & 4 deletions frame/evm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,9 @@ impl crate::Config for Test {
type WeightPerGas = WeightPerGas;

type BlockHashMapping = crate::SubstrateBlockHashMapping<Self>;
type CallOrigin =
EnsureAddressRoot<<Self::AccountProvider as crate::AccountProvider>::AccountId>;
type CallOrigin = EnsureAddressRoot<<Self::AccountProvider as crate::AccountProvider>::AccountId>;

type WithdrawOrigin =
EnsureAddressNever<<Self::AccountProvider as crate::AccountProvider>::AccountId>;
type WithdrawOrigin = EnsureAddressNever<<Self::AccountProvider as crate::AccountProvider>::AccountId>;
type AddressMapping = IdentityAddressMapping;
type Currency = Balances;

Expand Down

0 comments on commit 7086528

Please sign in to comment.