diff --git a/Cargo.lock b/Cargo.lock index e53b44c62..356e91798 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2315,7 +2315,7 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "e2e-tests" -version = "1.2.2" +version = "1.5.0" dependencies = [ "acala-cli", "acala-primitives", @@ -9788,7 +9788,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.2.2" +version = "1.5.0" dependencies = [ "acala-primitives", "acala-service", @@ -12653,7 +12653,7 @@ dependencies = [ [[package]] name = "test-runner" -version = "1.2.2" +version = "1.5.0" dependencies = [ "env_logger 0.7.1", "frame-system", diff --git a/modules/cdp-treasury/src/lib.rs b/modules/cdp-treasury/src/lib.rs index 55b64d9e1..3571c1cf0 100644 --- a/modules/cdp-treasury/src/lib.rs +++ b/modules/cdp-treasury/src/lib.rs @@ -166,7 +166,7 @@ pub mod module { impl Pallet { #[pallet::weight(T::WeightInfo::extract_surplus_to_treasury())] #[transactional] - pub fn extract_surplus_to_treasury(origin: OriginFor, amount: Balance) -> DispatchResult { + pub fn extract_surplus_to_treasury(origin: OriginFor, #[pallet::compact] amount: Balance) -> DispatchResult { T::UpdateOrigin::ensure_origin(origin)?; T::Currency::transfer( T::GetStableCurrencyId::get(), @@ -182,8 +182,8 @@ pub mod module { pub fn auction_collateral( origin: OriginFor, currency_id: CurrencyId, - amount: Balance, - target: Balance, + #[pallet::compact] amount: Balance, + #[pallet::compact] target: Balance, splited: bool, ) -> DispatchResult { T::UpdateOrigin::ensure_origin(origin)?; @@ -209,7 +209,7 @@ pub mod module { pub fn set_expected_collateral_auction_size( origin: OriginFor, currency_id: CurrencyId, - size: Balance, + #[pallet::compact] size: Balance, ) -> DispatchResult { T::UpdateOrigin::ensure_origin(origin)?; ExpectedCollateralAuctionSize::::insert(currency_id, size); diff --git a/modules/collator-selection/src/lib.rs b/modules/collator-selection/src/lib.rs index 947feb463..1b714e7b2 100644 --- a/modules/collator-selection/src/lib.rs +++ b/modules/collator-selection/src/lib.rs @@ -303,7 +303,7 @@ pub mod pallet { } #[pallet::weight(T::WeightInfo::set_desired_candidates())] - pub fn set_desired_candidates(origin: OriginFor, max: u32) -> DispatchResult { + pub fn set_desired_candidates(origin: OriginFor, #[pallet::compact] max: u32) -> DispatchResult { T::UpdateOrigin::ensure_origin(origin)?; if max > T::MaxCandidates::get() { Err(Error::::MaxCandidatesExceeded)?; @@ -314,7 +314,7 @@ pub mod pallet { } #[pallet::weight(T::WeightInfo::set_candidacy_bond())] - pub fn set_candidacy_bond(origin: OriginFor, bond: BalanceOf) -> DispatchResult { + pub fn set_candidacy_bond(origin: OriginFor, #[pallet::compact] bond: BalanceOf) -> DispatchResult { T::UpdateOrigin::ensure_origin(origin)?; >::put(&bond); Self::deposit_event(Event::NewCandidacyBond(bond)); diff --git a/modules/dex/src/lib.rs b/modules/dex/src/lib.rs index c01509d5e..28c8fe533 100644 --- a/modules/dex/src/lib.rs +++ b/modules/dex/src/lib.rs @@ -463,11 +463,11 @@ pub mod module { origin: OriginFor, currency_id_a: CurrencyId, currency_id_b: CurrencyId, - min_contribution_a: Balance, - min_contribution_b: Balance, - target_provision_a: Balance, - target_provision_b: Balance, - not_before: T::BlockNumber, + #[pallet::compact] min_contribution_a: Balance, + #[pallet::compact] min_contribution_b: Balance, + #[pallet::compact] target_provision_a: Balance, + #[pallet::compact] target_provision_b: Balance, + #[pallet::compact] not_before: T::BlockNumber, ) -> DispatchResult { T::ListingOrigin::ensure_origin(origin)?; @@ -526,11 +526,11 @@ pub mod module { origin: OriginFor, currency_id_a: CurrencyId, currency_id_b: CurrencyId, - min_contribution_a: Balance, - min_contribution_b: Balance, - target_provision_a: Balance, - target_provision_b: Balance, - not_before: T::BlockNumber, + #[pallet::compact] min_contribution_a: Balance, + #[pallet::compact] min_contribution_b: Balance, + #[pallet::compact] target_provision_a: Balance, + #[pallet::compact] target_provision_b: Balance, + #[pallet::compact] not_before: T::BlockNumber, ) -> DispatchResult { T::ListingOrigin::ensure_origin(origin)?; let trading_pair = diff --git a/modules/evm/src/lib.rs b/modules/evm/src/lib.rs index 2838d1bce..1de1a302c 100644 --- a/modules/evm/src/lib.rs +++ b/modules/evm/src/lib.rs @@ -488,10 +488,10 @@ pub mod module { origin: OriginFor, action: TransactionAction, input: Vec, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, - _valid_until: T::BlockNumber, // checked by tx validation logic + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, + #[pallet::compact] _valid_until: T::BlockNumber, // checked by tx validation logic ) -> DispatchResultWithPostInfo { match action { TransactionAction::Call(target) => Self::call(origin, target, input, value, gas_limit, storage_limit), @@ -513,9 +513,9 @@ pub mod module { origin: OriginFor, target: EvmAddress, input: Vec, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let source = T::AddressMapping::get_or_create_evm_address(&who); @@ -561,9 +561,9 @@ pub mod module { from: EvmAddress, target: EvmAddress, input: Vec, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, ) -> DispatchResultWithPostInfo { ensure_root(origin)?; @@ -622,9 +622,9 @@ pub mod module { pub fn create( origin: OriginFor, init: Vec, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let source = T::AddressMapping::get_or_create_evm_address(&who); @@ -659,9 +659,9 @@ pub mod module { origin: OriginFor, init: Vec, salt: H256, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let source = T::AddressMapping::get_or_create_evm_address(&who); @@ -694,9 +694,9 @@ pub mod module { pub fn create_network_contract( origin: OriginFor, init: Vec, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, ) -> DispatchResultWithPostInfo { T::NetworkContractOrigin::ensure_origin(origin)?; @@ -735,9 +735,9 @@ pub mod module { origin: OriginFor, target: EvmAddress, init: Vec, - value: BalanceOf, - gas_limit: u64, - storage_limit: u32, + #[pallet::compact] value: BalanceOf, + #[pallet::compact] gas_limit: u64, + #[pallet::compact] storage_limit: u32, ) -> DispatchResultWithPostInfo { T::NetworkContractOrigin::ensure_origin(origin)?; diff --git a/modules/homa-lite/src/lib.rs b/modules/homa-lite/src/lib.rs index 2d8defab9..23b937e7b 100644 --- a/modules/homa-lite/src/lib.rs +++ b/modules/homa-lite/src/lib.rs @@ -153,7 +153,7 @@ pub mod module { /// - `amount`: The amount of Staking currency to be exchanged. #[pallet::weight(< T as Config >::WeightInfo::mint())] #[transactional] - pub fn mint(origin: OriginFor, amount: Balance) -> DispatchResult { + pub fn mint(origin: OriginFor, #[pallet::compact] amount: Balance) -> DispatchResult { let who = ensure_signed(origin)?; // Ensure the amount is above the minimum, after the MintFee is deducted. ensure!( @@ -220,7 +220,10 @@ pub mod module { /// conversion rate. #[pallet::weight(< T as Config >::WeightInfo::set_total_staking_currency())] #[transactional] - pub fn set_total_staking_currency(origin: OriginFor, staking_total: Balance) -> DispatchResult { + pub fn set_total_staking_currency( + origin: OriginFor, + #[pallet::compact] staking_total: Balance, + ) -> DispatchResult { T::GovernanceOrigin::ensure_origin(origin)?; ensure!(!staking_total.is_zero(), Error::::InvalidTotalStakingCurrency); @@ -275,7 +278,7 @@ pub mod module { /// - `new_cap`: The new cap for staking currency. #[pallet::weight(< T as Config >::WeightInfo::set_minting_cap())] #[transactional] - pub fn set_minting_cap(origin: OriginFor, new_cap: Balance) -> DispatchResult { + pub fn set_minting_cap(origin: OriginFor, #[pallet::compact] new_cap: Balance) -> DispatchResult { T::GovernanceOrigin::ensure_origin(origin)?; StakingCurrencyMintCap::::put(new_cap); @@ -290,7 +293,7 @@ pub mod module { /// - `xcm_dest_weight`: The new weight for XCM transfers. #[pallet::weight(< T as Config >::WeightInfo::set_xcm_dest_weight())] #[transactional] - pub fn set_xcm_dest_weight(origin: OriginFor, xcm_dest_weight: Weight) -> DispatchResult { + pub fn set_xcm_dest_weight(origin: OriginFor, #[pallet::compact] xcm_dest_weight: Weight) -> DispatchResult { T::GovernanceOrigin::ensure_origin(origin)?; XcmDestWeight::::put(xcm_dest_weight); diff --git a/modules/honzon/src/lib.rs b/modules/honzon/src/lib.rs index 7bec46d9d..f9282295b 100644 --- a/modules/honzon/src/lib.rs +++ b/modules/honzon/src/lib.rs @@ -162,7 +162,7 @@ pub mod module { pub fn close_loan_has_debit_by_dex( origin: OriginFor, currency_id: CurrencyId, - max_collateral_amount: Balance, + #[pallet::compact] max_collateral_amount: Balance, maybe_path: Option>, ) -> DispatchResult { let who = ensure_signed(origin)?; diff --git a/modules/incentives/src/lib.rs b/modules/incentives/src/lib.rs index f2bc00bba..78759f225 100644 --- a/modules/incentives/src/lib.rs +++ b/modules/incentives/src/lib.rs @@ -233,7 +233,11 @@ pub mod module { /// - `amount`: amount to stake #[pallet::weight(::WeightInfo::deposit_dex_share())] #[transactional] - pub fn deposit_dex_share(origin: OriginFor, lp_currency_id: CurrencyId, amount: Balance) -> DispatchResult { + pub fn deposit_dex_share( + origin: OriginFor, + lp_currency_id: CurrencyId, + #[pallet::compact] amount: Balance, + ) -> DispatchResult { let who = ensure_signed(origin)?; Self::do_deposit_dex_share(&who, lp_currency_id, amount)?; Ok(()) @@ -247,7 +251,11 @@ pub mod module { /// - `amount`: amount to unstake #[pallet::weight(::WeightInfo::withdraw_dex_share())] #[transactional] - pub fn withdraw_dex_share(origin: OriginFor, lp_currency_id: CurrencyId, amount: Balance) -> DispatchResult { + pub fn withdraw_dex_share( + origin: OriginFor, + lp_currency_id: CurrencyId, + #[pallet::compact] amount: Balance, + ) -> DispatchResult { let who = ensure_signed(origin)?; Self::do_withdraw_dex_share(&who, lp_currency_id, amount)?; Ok(()) diff --git a/modules/nft/src/lib.rs b/modules/nft/src/lib.rs index d30fc7673..a283cca78 100644 --- a/modules/nft/src/lib.rs +++ b/modules/nft/src/lib.rs @@ -262,7 +262,7 @@ pub mod module { class_id: ClassIdOf, metadata: CID, attributes: Attributes, - quantity: u32, + #[pallet::compact] quantity: u32, ) -> DispatchResult { let who = ensure_signed(origin)?; let to = T::Lookup::lookup(to)?; diff --git a/modules/polkadot-bridge/src/lib.rs b/modules/polkadot-bridge/src/lib.rs index 478768b67..7cbe03ee2 100644 --- a/modules/polkadot-bridge/src/lib.rs +++ b/modules/polkadot-bridge/src/lib.rs @@ -114,7 +114,11 @@ pub mod module { impl Pallet { #[pallet::weight(10_000)] #[transactional] - pub fn set_mock_reward_rate(origin: OriginFor, account_index: u32, reward_rate: Rate) -> DispatchResult { + pub fn set_mock_reward_rate( + origin: OriginFor, + #[pallet::compact] account_index: u32, + reward_rate: Rate, + ) -> DispatchResult { ensure_root(origin)?; SubAccounts::::mutate(account_index, |status| { status.mock_reward_rate = reward_rate; @@ -124,7 +128,11 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn simulate_bond_extra(origin: OriginFor, account_index: u32, amount: Balance) -> DispatchResult { + pub fn simulate_bond_extra( + origin: OriginFor, + #[pallet::compact] account_index: u32, + #[pallet::compact] amount: Balance, + ) -> DispatchResult { ensure_root(origin)?; Self::sub_account_bond_extra(account_index, amount)?; Ok(()) @@ -132,7 +140,11 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn simulate_unbond(origin: OriginFor, account_index: u32, amount: Balance) -> DispatchResult { + pub fn simulate_unbond( + origin: OriginFor, + #[pallet::compact] account_index: u32, + #[pallet::compact] amount: Balance, + ) -> DispatchResult { ensure_root(origin)?; Self::sub_account_unbond(account_index, amount)?; Ok(()) @@ -140,7 +152,11 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn simulate_rebond(origin: OriginFor, account_index: u32, amount: Balance) -> DispatchResult { + pub fn simulate_rebond( + origin: OriginFor, + #[pallet::compact] account_index: u32, + #[pallet::compact] amount: Balance, + ) -> DispatchResult { ensure_signed(origin)?; Self::sub_account_rebond(account_index, amount)?; Ok(()) @@ -148,7 +164,10 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn simulate_withdraw_unbonded(origin: OriginFor, account_index: u32) -> DispatchResult { + pub fn simulate_withdraw_unbonded( + origin: OriginFor, + #[pallet::compact] account_index: u32, + ) -> DispatchResult { // ignore because we don't care who send the message let _ = ensure_signed(origin)?; Self::sub_account_withdraw_unbonded(account_index); @@ -157,7 +176,11 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn simulate_payout_stakers(origin: OriginFor, account_index: u32, era: EraIndex) -> DispatchResult { + pub fn simulate_payout_stakers( + origin: OriginFor, + #[pallet::compact] account_index: u32, + #[pallet::compact] era: EraIndex, + ) -> DispatchResult { ensure_signed(origin)?; Self::payout_stakers(account_index, era); Ok(()) @@ -167,8 +190,8 @@ pub mod module { #[transactional] pub fn simulate_transfer_to_sub_account( origin: OriginFor, - account_index: u32, - amount: Balance, + #[pallet::compact] account_index: u32, + #[pallet::compact] amount: Balance, ) -> DispatchResult { let who = ensure_signed(origin)?; Self::transfer_to_sub_account(account_index, &who, amount)?; @@ -179,9 +202,9 @@ pub mod module { #[transactional] pub fn simualte_receive_from_sub_account( origin: OriginFor, - account_index: u32, + #[pallet::compact] account_index: u32, to: ::Source, - amount: Balance, + #[pallet::compact] amount: Balance, ) -> DispatchResult { ensure_root(origin)?; let to = T::Lookup::lookup(to)?; @@ -191,7 +214,11 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn simulate_slash_sub_account(origin: OriginFor, account_index: u32, amount: Balance) -> DispatchResult { + pub fn simulate_slash_sub_account( + origin: OriginFor, + #[pallet::compact] account_index: u32, + #[pallet::compact] amount: Balance, + ) -> DispatchResult { ensure_root(origin)?; SubAccounts::::mutate(account_index, |status| { status.bonded = status.bonded.saturating_sub(amount); @@ -201,7 +228,7 @@ pub mod module { #[pallet::weight(10_000)] #[transactional] - pub fn force_era(origin: OriginFor, at: T::BlockNumber) -> DispatchResult { + pub fn force_era(origin: OriginFor, #[pallet::compact] at: T::BlockNumber) -> DispatchResult { ensure_root(origin)?; if at > >::block_number() { ForcedEra::::put(at); diff --git a/modules/session-manager/src/lib.rs b/modules/session-manager/src/lib.rs index dd22062bc..e6b34a3f4 100644 --- a/modules/session-manager/src/lib.rs +++ b/modules/session-manager/src/lib.rs @@ -151,8 +151,8 @@ pub mod module { #[pallet::weight(T::WeightInfo::schedule_session_duration())] pub fn schedule_session_duration( origin: OriginFor, - start_session: SessionIndex, - duration: T::BlockNumber, + #[pallet::compact] start_session: SessionIndex, + #[pallet::compact] duration: T::BlockNumber, ) -> DispatchResult { ensure_root(origin)?; diff --git a/node/e2e-tests/Cargo.toml b/node/e2e-tests/Cargo.toml index 1b267dac0..fb0c8aeab 100644 --- a/node/e2e-tests/Cargo.toml +++ b/node/e2e-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "e2e-tests" -version = "1.2.2" +version = "1.5.0" authors = ["Acala Developers"] edition = "2018" diff --git a/node/e2e-tests/test-runner/Cargo.toml b/node/e2e-tests/test-runner/Cargo.toml index 56213e049..6d14a399c 100644 --- a/node/e2e-tests/test-runner/Cargo.toml +++ b/node/e2e-tests/test-runner/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-runner" -version = "1.2.2" +version = "1.5.0" authors = ["Acala Developers"] edition = "2018" diff --git a/runtime/integration-tests/Cargo.toml b/runtime/integration-tests/Cargo.toml index c49215705..a3903e08b 100644 --- a/runtime/integration-tests/Cargo.toml +++ b/runtime/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.2.2" +version = "1.5.0" authors = ["Acala Developers"] edition = "2018"