Skip to content

Commit

Permalink
fix issues after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Aug 15, 2024
1 parent 5825728 commit 84c03a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pallets/liquidity-pools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ pub mod pallet {
ensure_root(origin)?;

ensure!(
matches!(domain_address.domain(), Domain::EVM(_)),
matches!(domain_address.domain(), Domain::Evm(_)),
Error::<T>::InvalidDomain
);

Expand All @@ -1030,7 +1030,7 @@ pub mod pallet {
Message::RecoverAssets {
contract: incorrect_contract,
asset,
recipient: T::DomainAddressToAccountId::convert(domain_address).into(),
recipient: domain_address.as_local(),
amount: amount.into(),
},
)?;
Expand Down
9 changes: 4 additions & 5 deletions pallets/liquidity-pools/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cfg_traits::Seconds;
use cfg_types::{
domain_address::DomainAddress,
domain_address::{Domain, DomainAddress},
permissions::{PermissionScope, PoolRole, Role},
tokens::CurrencyId,
};
Expand Down Expand Up @@ -1990,17 +1990,16 @@ mod recover_assets {
const ASSET: [u8; 32] = [43; 32];

fn config_mocks() {
DomainAddressToAccountId::mock_convert(move |_| ALICE_EVM_LOCAL_ACCOUNT);
Permissions::mock_has(|_, _, _| false);
Gateway::mock_handle(|sender, destination, msg| {
assert_eq!(sender, TreasuryAccount::get());
assert_eq!(destination, EVM_DOMAIN);
assert_eq!(destination, Domain::Evm(42));
assert_eq!(
msg,
Message::RecoverAssets {
contract: CONTRACT,
asset: ASSET,
recipient: ALICE_EVM_LOCAL_ACCOUNT.into(),
recipient: ALICE_EVM_DOMAIN_ADDRESS.as_local(),
amount: sp_core::U256::from(AMOUNT).into(),
}
);
Expand Down Expand Up @@ -2070,7 +2069,7 @@ mod recover_assets {
assert_noop!(
LiquidityPools::recover_assets(
RuntimeOrigin::root(),
DomainAddress::Centrifuge(ALICE.into()),
DomainAddress::Local(ALICE.into()),
CONTRACT,
ASSET,
AMOUNT.into(),
Expand Down
2 changes: 1 addition & 1 deletion pallets/liquidity-pools/src/tests/inbound.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cfg_traits::liquidity_pools::InboundMessageHandler;
use cfg_types::{
domain_address::{Domain, DomainAddress},
domain_address::DomainAddress,
permissions::{PermissionScope, PoolRole, Role},
};
use frame_support::{
Expand Down

0 comments on commit 84c03a8

Please sign in to comment.