Skip to content

Fix benchmarks of pallet-asset-index#323

Closed
clearloop wants to merge 10 commits intomainfrom
cl/chain-spec
Closed

Fix benchmarks of pallet-asset-index#323
clearloop wants to merge 10 commits intomainfrom
cl/chain-spec

Conversation

@clearloop
Copy link
Contributor

@clearloop clearloop commented Sep 2, 2021

Changes

  • reset the value of create_feed
  • updates all benchmarks of pallet-asset-index

Note: remove_asset requires remote-asset-manager which could not execute successfully

Tests

cargo b --release --features runtime-benchmarks
./target/release/pint benchmark -p pallet_asset_index -e "*" --chain pint-local --wasm-execution compiled

Issues

@clearloop clearloop changed the title Fix benchmarks of pallet-asset-index and pallet-saft-registry Fix benchmarks of pallet-asset-index Sep 2, 2021
#[test]
fn unlock() {
new_test_ext().execute_with(|| {
new_test_ext_from_genesis().execute_with(|| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs this to async with benchmarks

@clearloop clearloop marked this pull request as ready for review September 2, 2021 13:10
@clearloop clearloop added the needs review PR needs reviewing label Sep 2, 2021
@clearloop clearloop requested a review from mattsse September 3, 2021 08:30
@clearloop
Copy link
Contributor Author

#327

@clearloop clearloop closed this Sep 3, 2021
Comment on lines +113 to +118
// NOTE:
//
// the result will be 0 or 1
//
// - 0 for tests
// - 1 for benchmarks ( transaction fee )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is rather confusing and depends on the configured fees,
can we simplify this check somehow, by checking that fees are sent to the treasury?
or remove it, this selective check does probably more harm than good

Comment on lines +122 to +149
// TODO:
//
// This extrinsic requires `remote-asset-manager`
//
// ----
//
// remove_asset {
// let asset_id = T::try_convert(2u8).unwrap();
// let units = 100_u32.into();
// let amount = 1_000u32.into();
// let origin = T::AdminOrigin::successful_origin();
// let origin_account_id = T::AdminOrigin::ensure_origin(origin.clone()).unwrap();
// let receiver = whitelisted_account::<T>("receiver", 0);
//
// // create liquid assets
// assert_ok!(<AssetIndex<T>>::add_asset(
// origin.clone(),
// asset_id,
// units,
// MultiLocation::Null,
// amount
// ));
//
// // create price feed
// T::PriceFeedBenchmarks::create_feed(origin_account_id.clone(), asset_id).unwrap();
//
// // construct call
// let call = Call::<T>::remove_asset(asset_id, units, Some(receiver));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch with all the xcm dependent calls.
They can't be benchmarked like that in any case so we can remove them.
the weights for these calls will come from the upcoming xcm benchmarking suite in polkadot.

@clearloop clearloop deleted the cl/chain-spec branch September 3, 2021 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review PR needs reviewing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix benchmarks for pallet asset-index and pallet saft-registry

2 participants