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

SLPx mint support commission id #1261

Merged
merged 1 commit into from
Jun 11, 2024
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
1 change: 1 addition & 0 deletions pallets/slpx/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ mod benchmarks {
KSM,
TargetChain::Astar(receiver),
BoundedVec::default(),
None,
);
}

Expand Down
6 changes: 5 additions & 1 deletion pallets/slpx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ pub mod pallet {
currency_id: CurrencyIdOf<T>,
target_chain: TargetChain<AccountIdOf<T>>,
remark: BoundedVec<u8, ConstU32<32>>,
channel_id: Option<u32>,
) -> DispatchResultWithPostInfo {
let (source_chain_caller, derivative_account, bifrost_chain_caller) =
Self::ensure_singer_on_whitelist(origin.clone(), evm_caller, &target_chain)?;
Expand All @@ -456,6 +457,7 @@ pub mod pallet {
currency_id,
remark,
target_chain,
channel_id,
};

OrderQueue::<T>::mutate(|order_queue| -> DispatchResultWithPostInfo {
Expand Down Expand Up @@ -515,6 +517,7 @@ pub mod pallet {
bifrost_chain_caller,
derivative_account,
target_chain,
channel_id: None,
};

OrderQueue::<T>::mutate(|order_queue| -> DispatchResultWithPostInfo {
Expand Down Expand Up @@ -738,6 +741,7 @@ pub mod pallet {
currency_id,
remark,
target_chain,
channel_id: None,
};

OrderQueue::<T>::mutate(|order_queue| -> DispatchResultWithPostInfo {
Expand Down Expand Up @@ -1000,7 +1004,7 @@ impl<T: Config> Pallet<T> {
order.currency_id,
currency_amount,
order.remark.clone(),
None,
order.channel_id,
)
.map_err(|_| Error::<T>::ArgumentsError)?;
let vtoken_id = T::VtokenMintingInterface::vtoken_id(order.currency_id)
Expand Down
6 changes: 4 additions & 2 deletions pallets/slpx/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ fn test_add_order() {
source_chain_caller,
DOT,
TargetChain::Astar(source_chain_caller),
BoundedVec::default()
BoundedVec::default(),
None
));
assert_eq!(OrderQueue::<Test>::get().len(), 1usize);
assert_ok!(Slpx::redeem(
Expand Down Expand Up @@ -389,7 +390,8 @@ fn test_hook() {
source_chain_caller,
DOT,
TargetChain::Astar(source_chain_caller),
BoundedVec::default()
BoundedVec::default(),
None
));
assert_eq!(OrderQueue::<Test>::get().len(), 1usize);
<frame_system::Pallet<Test>>::set_block_number(2u32.into());
Expand Down
1 change: 1 addition & 0 deletions pallets/slpx/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ pub struct Order<AccountId, CurrencyId, Balance, BlockNumber> {
pub order_type: OrderType,
pub remark: BoundedVec<u8, ConstU32<32>>,
pub target_chain: TargetChain<AccountId>,
pub channel_id: Option<u32>,
}