Skip to content

Commit

Permalink
use AllCounted/AllOfCounted instead of All/AllOf
Browse files Browse the repository at this point in the history
  • Loading branch information
mn13 committed Jun 14, 2023
1 parent dc8f687 commit 1ac4303
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions pallets/eq-balances/src/xcm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,18 @@ impl<T: Config> Pallet<T> {
}

xcm.0.push(DepositAsset {
assets: (AllOf {
assets: (AllOfCounted {
id: Concrete(fee_location),
fun: WildFungibility::Fungible,
count: 2,
})
.into(),
beneficiary: equilibrium_souvereign_multilocation.unwrap(),
});
}

xcm.0.push(DepositAsset {
assets: All.into(),
assets: AllCounted(2).into(),
beneficiary: beneficiary.clone(),
});

Expand Down
18 changes: 9 additions & 9 deletions pallets/eq-balances/src/xcm_impl_old.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use xcm::v3::send_xcm;
use xcm::v3::{send_xcm, MultiAssets};

use super::*;

Expand All @@ -35,20 +35,20 @@ impl<T: Config> Pallet<T> {
beneficiary: MultiLocation,
reserved: bool,
) -> Xcm<()> {
let asset_and_fee = vec![asset, fees.clone()].into();
let asset_and_fee: MultiAssets = vec![asset, fees.clone()].into();
Xcm(vec![
if reserved {
ReserveAssetDeposited(asset_and_fee)
ReserveAssetDeposited(asset_and_fee.clone())
} else {
WithdrawAsset(asset_and_fee)
WithdrawAsset(asset_and_fee.clone())
},
ClearOrigin,
BuyExecution {
fees,
weight_limit: WeightLimit::Unlimited,
},
DepositAsset {
assets: All.into(),
assets: AllCounted(asset_and_fee.len() as u32).into(),
beneficiary,
},
])
Expand Down Expand Up @@ -125,7 +125,7 @@ impl<T: Config> Pallet<T> {
weight_limit: WeightLimit::Unlimited,
},
DepositAsset {
assets: All.into(),
assets: AllCounted(multi_assets.len() as u32).into(),
beneficiary: beneficiary.clone(),
},
]);
Expand All @@ -143,16 +143,16 @@ impl<T: Config> Pallet<T> {
id: Concrete(xcm_fee_asset_multilocation),
fun: Fungible(xcm_fee_amount),
};
let multi_assets = vec![xcm_fee_asset_multiasset.clone(), multi_asset].into();
let multi_assets: MultiAssets = vec![xcm_fee_asset_multiasset.clone(), multi_asset].into();
let xcm = Xcm(vec![
WithdrawAsset(multi_assets),
WithdrawAsset(multi_assets.clone()),
ClearOrigin,
BuyExecution {
fees: xcm_fee_asset_multiasset,
weight_limit: WeightLimit::Unlimited,
},
DepositAsset {
assets: All.into(),
assets: AllCounted(multi_assets.len() as u32).into(),
beneficiary: beneficiary.clone(),
},
]);
Expand Down

0 comments on commit 1ac4303

Please sign in to comment.