From 407d32ba09b062c0fb8a56847730372ad948b5ae Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Tue, 30 May 2023 13:14:02 +0800 Subject: [PATCH] /~https://github.com/pendulum-chain/spacewalk/pull/350#discussion_r1206408348, /~https://github.com/pendulum-chain/spacewalk/pull/350#discussion_r1206417445, /~https://github.com/pendulum-chain/spacewalk/pull/350#discussion_r1206419298 --- pallets/issue/src/benchmarking.rs | 19 +++++++++++++++---- pallets/issue/src/mock.rs | 2 +- testchain/node/src/chain_spec.rs | 2 +- testchain/runtime/src/lib.rs | 6 ------ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/pallets/issue/src/benchmarking.rs b/pallets/issue/src/benchmarking.rs index 7ac051a07..257b032b7 100644 --- a/pallets/issue/src/benchmarking.rs +++ b/pallets/issue/src/benchmarking.rs @@ -64,9 +64,7 @@ benchmarks! { request_issue { let origin: T::AccountId = account("Origin", 0, 0); let vault_id = get_vault_id::(); - // this amount is when running the benchmark with the testchain - // let amount = 1000_0000u32.into(); - let amount = 1000u32.into(); + let amount = 10_000_000u32.into(); let asset = vault_id.wrapped_currency(); let relayer_id: T::AccountId = account("Relayer", 0, 0); @@ -187,6 +185,19 @@ benchmarks! { impl_benchmark_test_suite!( Issue, - crate::mock::ExtBuilder::build_with(Default::default()), + crate::mock::ExtBuilder::build_with(orml_tokens::GenesisConfig:: { + balances: vec![ + currency::testing_constants::DEFAULT_COLLATERAL_CURRENCY, + currency::testing_constants::DEFAULT_NATIVE_CURRENCY + ] + .into_iter() + .flat_map(|currency_id| { + vec![ + (crate::mock::USER, currency_id, 1_000_000_000_000), + (crate::mock::VAULT.account_id, currency_id, 1_000_000_000_000), + ] + }) + .collect(), + }), crate::mock::Test ); diff --git a/pallets/issue/src/mock.rs b/pallets/issue/src/mock.rs index 9541efcf0..042d90356 100644 --- a/pallets/issue/src/mock.rs +++ b/pallets/issue/src/mock.rs @@ -376,7 +376,7 @@ impl ExtBuilder { fee::GenesisConfig:: { issue_fee: UnsignedFixedPoint::checked_from_rational(5, 1000).unwrap(), // 0.5% - issue_griefing_collateral: UnsignedFixedPoint::checked_from_rational(5, 100000) + issue_griefing_collateral: UnsignedFixedPoint::checked_from_rational(5, 1_000_000_000) .unwrap(), // 0.005% redeem_fee: UnsignedFixedPoint::checked_from_rational(5, 1000).unwrap(), // 0.5% premium_redeem_fee: UnsignedFixedPoint::checked_from_rational(5, 100).unwrap(), // 5% diff --git a/testchain/node/src/chain_spec.rs b/testchain/node/src/chain_spec.rs index c10f92d6d..9d8590deb 100644 --- a/testchain/node/src/chain_spec.rs +++ b/testchain/node/src/chain_spec.rs @@ -451,7 +451,7 @@ fn testnet_genesis( AssetId::new(b"FIAT".to_vec(), b"MXN-USD".to_vec()), AssetId::new(b"Stellar".to_vec(), b"XLM".to_vec()), ], - batching_api: b"http://dia-00.pendulumchain.tech:8070/currencies".to_vec(), + batching_api: b"https://dia-00.pendulumchain.tech:8070/currencies".to_vec(), coin_infos_map: vec![], }, } diff --git a/testchain/runtime/src/lib.rs b/testchain/runtime/src/lib.rs index 71275236f..835133257 100644 --- a/testchain/runtime/src/lib.rs +++ b/testchain/runtime/src/lib.rs @@ -176,12 +176,6 @@ impl pallet_aura::Config for Runtime { impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - // type KeyOwnerProof = - // >::Proof; - // type KeyOwnerIdentification = >::IdentificationTuple; type KeyOwnerProof = sp_core::Void; type WeightInfo = (); type MaxAuthorities = MaxAuthorities;