Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use explicit call index #35

Merged
merged 2 commits into from
Feb 2, 2023
Merged
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
9 changes: 9 additions & 0 deletions lib/stable-asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ pub mod pallet {

#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::create_pool())]
#[transactional]
pub fn create_pool(
Expand Down Expand Up @@ -578,6 +579,7 @@ pub mod pallet {
)
}

#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::mint(amounts.len() as u32))]
#[transactional]
pub fn mint(
Expand All @@ -590,6 +592,7 @@ pub mod pallet {
<Self as StableAsset>::mint(&who, pool_id, amounts, min_mint_amount)
}

#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::swap(*asset_length))]
#[transactional]
pub fn swap(
Expand All @@ -606,6 +609,7 @@ pub mod pallet {
Ok(())
}

#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::redeem_proportion(min_redeem_amounts.len() as u32))]
#[transactional]
pub fn redeem_proportion(
Expand All @@ -618,6 +622,7 @@ pub mod pallet {
<Self as StableAsset>::redeem_proportion(&who, pool_id, amount, min_redeem_amounts)
}

#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::redeem_single(*asset_length))]
#[transactional]
pub fn redeem_single(
Expand All @@ -633,6 +638,7 @@ pub mod pallet {
Ok(())
}

#[pallet::call_index(5)]
#[pallet::weight(T::WeightInfo::redeem_multi(amounts.len() as u32))]
#[transactional]
pub fn redeem_multi(
Expand All @@ -645,6 +651,7 @@ pub mod pallet {
<Self as StableAsset>::redeem_multi(&who, pool_id, amounts, max_redeem_amount)
}

#[pallet::call_index(6)]
#[pallet::weight(T::WeightInfo::modify_a())]
#[transactional]
pub fn modify_a(
Expand All @@ -657,6 +664,7 @@ pub mod pallet {
<Self as StableAsset>::modify_a(pool_id, a, future_a_block)
}

#[pallet::call_index(7)]
#[pallet::weight(T::WeightInfo::modify_fees())]
#[transactional]
pub fn modify_fees(
Expand Down Expand Up @@ -688,6 +696,7 @@ pub mod pallet {
})
}

#[pallet::call_index(8)]
#[pallet::weight(T::WeightInfo::modify_recipients())]
#[transactional]
pub fn modify_recipients(
Expand Down