Skip to content

Commit

Permalink
fix: benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshvarma committed Oct 19, 2023
1 parent 6744d84 commit 09b30d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chain-extensions/unified-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ std = [
# Astar
"astar-primitives/std",
"pallet-unified-accounts/std",
"unified-accounts-chain-extension-types/std"
"unified-accounts-chain-extension-types/std",
]
10 changes: 10 additions & 0 deletions pallets/unified-accounts/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use super::*;
use frame_benchmarking::v2::*;
use frame_support::assert_ok;
use frame_system::RawOrigin;

/// Assert that the last event equals the provided one.
Expand All @@ -42,6 +43,10 @@ mod benchmarks {
)
.into();

assert_ok!(T::Currency::mint_into(
&caller,
T::AccountMappingStorageFee::get()
));
let caller_clone = caller.clone();

#[extrinsic_call]
Expand All @@ -62,6 +67,11 @@ mod benchmarks {
let caller_clone = caller.clone();
let evm_address = T::DefaultNativeToEvm::into_h160(caller.clone());

assert_ok!(T::Currency::mint_into(
&caller,
T::AccountMappingStorageFee::get()
));

#[extrinsic_call]
_(RawOrigin::Signed(caller));

Expand Down
2 changes: 1 addition & 1 deletion pallets/unified-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub mod pallet {
/// The overarching event type
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// The Currency for managing evm address assets
type Currency: FungibleMutate<Self::AccountId>;
type Currency: FungibleMutate<Self::AccountId, Balance = Balance>;
/// Default evm address to account id conversion
type DefaultEvmToNative: AddressMapping<Self::AccountId>;
/// Default account id to evm address conversion
Expand Down

0 comments on commit 09b30d8

Please sign in to comment.