Add CreateOrigin to Assets Pallet (#12586)

* add CreateOrigin to Assets pallet

* fix asset-tx-payment test

* use AccountId > u64 in test

* Update frame/assets/src/benchmarking.rs

Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>

Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>
This commit is contained in:
joe petrowski
2022-11-09 20:59:40 +01:00
committed by GitHub
parent fa33efedcb
commit 11a01e89e3
6 changed files with 29 additions and 15 deletions
+5 -3
View File
@@ -150,12 +150,14 @@ fn assert_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::Runti
benchmarks_instance_pallet! {
create {
let caller: T::AccountId = whitelisted_caller();
let asset_id = Default::default();
let origin = T::CreateOrigin::successful_origin(&asset_id);
let caller = T::CreateOrigin::ensure_origin(origin, &asset_id).unwrap();
let caller_lookup = T::Lookup::unlookup(caller.clone());
T::Currency::make_free_balance_be(&caller, DepositBalanceOf::<T, I>::max_value());
}: _(SystemOrigin::Signed(caller.clone()), Default::default(), caller_lookup, 1u32.into())
}: _(SystemOrigin::Signed(caller.clone()), asset_id, caller_lookup, 1u32.into())
verify {
assert_last_event::<T, I>(Event::Created { asset_id: Default::default(), creator: caller.clone(), owner: caller }.into());
assert_last_event::<T, I>(Event::Created { asset_id, creator: caller.clone(), owner: caller }.into());
}
force_create {