Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed May 29, 2024
1 parent 17a180c commit 5f7f868
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
5 changes: 2 additions & 3 deletions libs/types/src/locations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ impl From<DomainAddress> for RestrictedTransferLocation {
mod test {

use hex::FromHex;
use staging_xcm::v3::MultiLocation;
use staging_xcm::v4::Location;

use super::*;

#[test]
fn from_xcm_versioned_address_works() {
// TODO-1.7: Must be changed to V4?
let xa = VersionedLocation::V3(MultiLocation::default());
let xa = VersionedLocation::V4(Location::default());
let l = RestrictedTransferLocation::from(xa.clone());
assert_eq!(
l,
Expand Down
15 changes: 5 additions & 10 deletions pallets/liquidity-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,19 +899,14 @@ pub mod pallet {

let pallet_index = <T as frame_system::Config>::PalletInfo::index::<Pallet<T>>();

// There are formating issues with the long pattern matching
#[cfg_attr(rustfmt, rustfmt_skip)]
// There are formating issues with the long pattern matching
match location.unpack() {
(
0,
&[
PalletInstance(pallet_instance),
GlobalConsensus(NetworkId::Ethereum { chain_id }),
AccountKey20 {
network: None,
key: address,
}
],
&[PalletInstance(pallet_instance), GlobalConsensus(NetworkId::Ethereum { chain_id }), AccountKey20 {
network: None,
key: address,
}],
) if Some(pallet_instance.into()) == pallet_index => {
Ok(LiquidityPoolsWrappedToken::EVM { chain_id, address })
}
Expand Down
12 changes: 4 additions & 8 deletions pallets/pool-system/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1372,8 +1372,7 @@ fn valid_tranche_structure_is_enforced() {
],
AUSD_CURRENCY_ID,
10_000 * CURRENCY,

vec![],
vec![],
),
Error::<Runtime>::InvalidTrancheStructure
);
Expand Down Expand Up @@ -1436,8 +1435,7 @@ fn valid_tranche_structure_is_enforced() {
],
AUSD_CURRENCY_ID,
10_000 * CURRENCY,

vec![],
vec![],
),
Error::<Runtime>::InvalidTrancheStructure
);
Expand Down Expand Up @@ -1492,8 +1490,7 @@ fn valid_tranche_structure_is_enforced() {
],
AUSD_CURRENCY_ID,
10_000 * CURRENCY,

vec![],
vec![],
),
Error::<Runtime>::InvalidTrancheStructure
);
Expand Down Expand Up @@ -1545,8 +1542,7 @@ fn valid_tranche_structure_is_enforced() {
],
AUSD_CURRENCY_ID,
10_000 * CURRENCY,

vec![],
vec![],
),
Error::<Runtime>::InvalidTrancheStructure
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ mod development {
None,
// Changed: Add some location which cannot be converted to
// LiquidityPoolsWrappedToken
Some(Some(VersionedLocation::V3(Default::default()))),
Some(Some(VersionedLocation::V4(Default::default()))),
// No change for transferability required as it is already allowed for
// LiquidityPools
None,
Expand Down Expand Up @@ -1624,7 +1624,7 @@ mod development {
None,
// Changed: Add some location which cannot be converted to
// LiquidityPoolsWrappedToken
Some(Some(VersionedLocation::V3(Default::default()))),
Some(Some(VersionedLocation::V4(Default::default()))),
// No change for transferability required as it is already allowed for
// LiquidityPools
None,
Expand Down

0 comments on commit 5f7f868

Please sign in to comment.