Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions modules/cdp-treasury/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub mod module {
impl<T: Config> Pallet<T> {
#[pallet::weight(T::WeightInfo::extract_surplus_to_treasury())]
#[transactional]
pub fn extract_surplus_to_treasury(origin: OriginFor<T>, amount: Balance) -> DispatchResult {
pub fn extract_surplus_to_treasury(origin: OriginFor<T>, #[pallet::compact] amount: Balance) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
T::Currency::transfer(
T::GetStableCurrencyId::get(),
Expand All @@ -182,8 +182,8 @@ pub mod module {
pub fn auction_collateral(
origin: OriginFor<T>,
currency_id: CurrencyId,
amount: Balance,
target: Balance,
#[pallet::compact] amount: Balance,
#[pallet::compact] target: Balance,
splited: bool,
) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
Expand All @@ -209,7 +209,7 @@ pub mod module {
pub fn set_expected_collateral_auction_size(
origin: OriginFor<T>,
currency_id: CurrencyId,
size: Balance,
#[pallet::compact] size: Balance,
) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
ExpectedCollateralAuctionSize::<T>::insert(currency_id, size);
Expand Down
4 changes: 2 additions & 2 deletions modules/collator-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ pub mod pallet {
}

#[pallet::weight(T::WeightInfo::set_desired_candidates())]
pub fn set_desired_candidates(origin: OriginFor<T>, max: u32) -> DispatchResult {
pub fn set_desired_candidates(origin: OriginFor<T>, #[pallet::compact] max: u32) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
if max > T::MaxCandidates::get() {
Err(Error::<T>::MaxCandidatesExceeded)?;
Expand All @@ -314,7 +314,7 @@ pub mod pallet {
}

#[pallet::weight(T::WeightInfo::set_candidacy_bond())]
pub fn set_candidacy_bond(origin: OriginFor<T>, bond: BalanceOf<T>) -> DispatchResult {
pub fn set_candidacy_bond(origin: OriginFor<T>, #[pallet::compact] bond: BalanceOf<T>) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
<CandidacyBond<T>>::put(&bond);
Self::deposit_event(Event::NewCandidacyBond(bond));
Expand Down
20 changes: 10 additions & 10 deletions modules/dex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ pub mod module {
origin: OriginFor<T>,
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)?;

Expand Down Expand Up @@ -526,11 +526,11 @@ pub mod module {
origin: OriginFor<T>,
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 =
Expand Down
44 changes: 22 additions & 22 deletions modules/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ pub mod module {
origin: OriginFor<T>,
action: TransactionAction,
input: Vec<u8>,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
_valid_until: T::BlockNumber, // checked by tx validation logic
#[pallet::compact] value: BalanceOf<T>,
#[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),
Expand All @@ -513,9 +513,9 @@ pub mod module {
origin: OriginFor<T>,
target: EvmAddress,
input: Vec<u8>,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
#[pallet::compact] value: BalanceOf<T>,
#[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);
Expand Down Expand Up @@ -561,9 +561,9 @@ pub mod module {
from: EvmAddress,
target: EvmAddress,
input: Vec<u8>,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
#[pallet::compact] value: BalanceOf<T>,
#[pallet::compact] gas_limit: u64,
#[pallet::compact] storage_limit: u32,
) -> DispatchResultWithPostInfo {
ensure_root(origin)?;

Expand Down Expand Up @@ -622,9 +622,9 @@ pub mod module {
pub fn create(
origin: OriginFor<T>,
init: Vec<u8>,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
#[pallet::compact] value: BalanceOf<T>,
#[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);
Expand Down Expand Up @@ -659,9 +659,9 @@ pub mod module {
origin: OriginFor<T>,
init: Vec<u8>,
salt: H256,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
#[pallet::compact] value: BalanceOf<T>,
#[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);
Expand Down Expand Up @@ -694,9 +694,9 @@ pub mod module {
pub fn create_network_contract(
origin: OriginFor<T>,
init: Vec<u8>,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
#[pallet::compact] value: BalanceOf<T>,
#[pallet::compact] gas_limit: u64,
#[pallet::compact] storage_limit: u32,
) -> DispatchResultWithPostInfo {
T::NetworkContractOrigin::ensure_origin(origin)?;

Expand Down Expand Up @@ -735,9 +735,9 @@ pub mod module {
origin: OriginFor<T>,
target: EvmAddress,
init: Vec<u8>,
value: BalanceOf<T>,
gas_limit: u64,
storage_limit: u32,
#[pallet::compact] value: BalanceOf<T>,
#[pallet::compact] gas_limit: u64,
#[pallet::compact] storage_limit: u32,
) -> DispatchResultWithPostInfo {
T::NetworkContractOrigin::ensure_origin(origin)?;

Expand Down
11 changes: 7 additions & 4 deletions modules/homa-lite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>, amount: Balance) -> DispatchResult {
pub fn mint(origin: OriginFor<T>, #[pallet::compact] amount: Balance) -> DispatchResult {
let who = ensure_signed(origin)?;
// Ensure the amount is above the minimum, after the MintFee is deducted.
ensure!(
Expand Down Expand Up @@ -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<T>, staking_total: Balance) -> DispatchResult {
pub fn set_total_staking_currency(
origin: OriginFor<T>,
#[pallet::compact] staking_total: Balance,
) -> DispatchResult {
T::GovernanceOrigin::ensure_origin(origin)?;
ensure!(!staking_total.is_zero(), Error::<T>::InvalidTotalStakingCurrency);

Expand Down Expand Up @@ -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<T>, new_cap: Balance) -> DispatchResult {
pub fn set_minting_cap(origin: OriginFor<T>, #[pallet::compact] new_cap: Balance) -> DispatchResult {
T::GovernanceOrigin::ensure_origin(origin)?;

StakingCurrencyMintCap::<T>::put(new_cap);
Expand All @@ -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<T>, xcm_dest_weight: Weight) -> DispatchResult {
pub fn set_xcm_dest_weight(origin: OriginFor<T>, #[pallet::compact] xcm_dest_weight: Weight) -> DispatchResult {
T::GovernanceOrigin::ensure_origin(origin)?;

XcmDestWeight::<T>::put(xcm_dest_weight);
Expand Down
2 changes: 1 addition & 1 deletion modules/honzon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pub mod module {
pub fn close_loan_has_debit_by_dex(
origin: OriginFor<T>,
currency_id: CurrencyId,
max_collateral_amount: Balance,
#[pallet::compact] max_collateral_amount: Balance,
maybe_path: Option<Vec<CurrencyId>>,
) -> DispatchResult {
let who = ensure_signed(origin)?;
Expand Down
12 changes: 10 additions & 2 deletions modules/incentives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ pub mod module {
/// - `amount`: amount to stake
#[pallet::weight(<T as Config>::WeightInfo::deposit_dex_share())]
#[transactional]
pub fn deposit_dex_share(origin: OriginFor<T>, lp_currency_id: CurrencyId, amount: Balance) -> DispatchResult {
pub fn deposit_dex_share(
origin: OriginFor<T>,
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(())
Expand All @@ -247,7 +251,11 @@ pub mod module {
/// - `amount`: amount to unstake
#[pallet::weight(<T as Config>::WeightInfo::withdraw_dex_share())]
#[transactional]
pub fn withdraw_dex_share(origin: OriginFor<T>, lp_currency_id: CurrencyId, amount: Balance) -> DispatchResult {
pub fn withdraw_dex_share(
origin: OriginFor<T>,
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(())
Expand Down
2 changes: 1 addition & 1 deletion modules/nft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ pub mod module {
class_id: ClassIdOf<T>,
metadata: CID,
attributes: Attributes,
quantity: u32,
#[pallet::compact] quantity: u32,
) -> DispatchResult {
let who = ensure_signed(origin)?;
let to = T::Lookup::lookup(to)?;
Expand Down
Loading