Skip to content

Commit

Permalink
throw error for orml tokens ztg
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralt98 committed Jul 17, 2023
1 parent f4ad1c7 commit c5ee57b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/common/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ macro_rules! impl_foreign_fees {
NoAssetMetadata = 2,
NoFeeFactor = 3,
InvalidAssetId = 4,
// Used Some(AssetId::Ztg) instead of None for real ZTG token of pallet_balances
TokensZtgUsedInsteadOfPalletBalances = 5,
}

// It does calculate foreign fees by extending transactions to include an optional
Expand Down Expand Up @@ -143,7 +145,11 @@ macro_rules! impl_foreign_fees {
asset_id: CurrencyId,
) -> Result<Balance, Self::Error> {
match asset_id {
Asset::Ztg => Ok(native_fee),
Asset::Ztg => {
return Err(TransactionValidityError::Invalid(InvalidTransaction::Custom(
CustomTxError::TokensZtgUsedInsteadOfPalletBalances as u8,
)));
}
#[cfg(not(feature = "parachain"))]
Asset::ForeignAsset(_) => {
return Err(TransactionValidityError::Invalid(InvalidTransaction::Custom(
Expand Down

0 comments on commit c5ee57b

Please sign in to comment.