From 1e2a8c45b5b01e7bc2fe9d2053842b9170adb757 Mon Sep 17 00:00:00 2001 From: Deepanshu Hooda Date: Thu, 19 Oct 2023 13:56:32 +0530 Subject: [PATCH] add comments --- runtime/shibuya/src/lib.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 7c2af331bb..d374335d8b 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -1946,6 +1946,8 @@ impl_runtime_apis! { Ok(MultiLocation::parent()) } fn worst_case_holding(_depositable_count: u32) -> MultiAssets { + // we can have max of 64 assets in holding so this should be + // a good estimate for worst case const HOLDING_FUNGIBLES: u32 = 62; let fungibles_amount: u128 = 100; let assets = (0..HOLDING_FUNGIBLES).map(|i| { @@ -1983,11 +1985,12 @@ impl_runtime_apis! { // not sure what will be the worst case for Response // either `Assets(MultiAssets)` or `PalletsInfo(BoundedVec)` // in either case, what will be the worst case? - let assets: Vec = vec![MultiAsset { - id: Concrete(MultiLocation::parent()), - fun: Fungible(u128::MAX), - }]; - (0u64, Response::Assets(assets.into())) + // let assets: Vec = vec![MultiAsset { + // id: Concrete(MultiLocation::parent()), + // fun: Fungible(u128::MAX), + // }]; + // (0u64, Response::Assets(assets.into())) + (0u64, Response::Version(Default::default())) } @@ -2063,9 +2066,7 @@ impl_runtime_apis! { /// Give me a fungible asset that your asset transactor is going to accept. fn get_multi_asset() -> MultiAsset { - // send some token to alice for existential deposit - - // create an asset + // create an asset and make it sufficient assert_ok!(pallet_assets::Pallet::::force_create(RuntimeOrigin::root(),parity_scale_codec::Compact(1),sp_runtime::MultiAddress::Id(AccountId32::new([0u8; 32])),true,1)); let location = MultiLocation { parents : 0, interior :X1(GeneralIndex(1)) }; // convert mapping for asset id