Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Oct 20, 2024
1 parent c7053d1 commit dd5d8ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bridges/snowbridge/primitives/router/src/outbound/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ where

fn convert(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
let result = match self.peek() {
Ok(ReserveAssetDeposited { .. }) => self.send_native_tokens_message(),
Ok(ReserveAssetDeposited { .. }) => self.make_mint_foreign_token_command(),
// Get withdraw/deposit and make native tokens create message.
Ok(WithdrawAsset { .. }) => self.send_tokens_message(),
Ok(WithdrawAsset { .. }) => self.make_unlock_native_token_command(),
Err(e) => Err(e),
_ => return Err(XcmConverterError::UnexpectedInstruction),
}?;
Expand All @@ -219,7 +219,7 @@ where
Ok(result)
}

fn send_tokens_message(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
fn make_unlock_native_token_command(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
use XcmConverterError::*;

// Get the reserve assets from WithdrawAsset.
Expand Down Expand Up @@ -268,9 +268,9 @@ where
ensure!(reserve_assets.len() == 1, TooManyAssets);
let reserve_asset = reserve_assets.get(0).ok_or(AssetResolutionFailed)?;

// Enough Fees are collected on Asset Hub, up front and directly from the user, to cover the
// Fees are collected on AH, up front and directly from the user, to cover the
// complete cost of the transfer. Any additional fees provided in the XCM program are
// refunded to the beneficairy. We only validate the fee here if its provided to make sure
// refunded to the beneficiary. We only validate the fee here if its provided to make sure
// the XCM program is well formed. Another way to think about this from an XCM perspective
// would be that the user offered to pay X amount in fees, but we charge 0 of that X amount
// (no fee) and refund X to the user.
Expand Down Expand Up @@ -330,7 +330,7 @@ where
/// # BuyExecution
/// # DepositAsset
/// # SetTopic
fn send_native_tokens_message(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
fn make_mint_foreign_token_command(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
use XcmConverterError::*;

// Get the reserve assets.
Expand Down Expand Up @@ -379,9 +379,9 @@ where
ensure!(reserve_assets.len() == 1, TooManyAssets);
let reserve_asset = reserve_assets.get(0).ok_or(AssetResolutionFailed)?;

// Enough Fees are collected on Asset Hub, up front and directly from the user, to cover the
// Fees are collected on AH, up front and directly from the user, to cover the
// complete cost of the transfer. Any additional fees provided in the XCM program are
// refunded to the beneficairy. We only validate the fee here if its provided to make sure
// refunded to the beneficiary. We only validate the fee here if its provided to make sure
// the XCM program is well formed. Another way to think about this from an XCM perspective
// would be that the user offered to pay X amount in fees, but we charge 0 of that X amount
// (no fee) and refund X to the user.
Expand Down

0 comments on commit dd5d8ee

Please sign in to comment.