When sending Transact XCM Instruction from parachain A, how do I specify (or how does the xcm-executor know) the pallet / pallet id on the target Parachain B which contains the extrinsic to be executed, or is it not required?
for example. The following Transact Xcm message is sent from parachain A to execute an extrinsic called ping defined in the cumulus-ping pallet on Parachain B. In the xcm message below, I do not see the cumulus-ping pallet or the index of the cumulus-ping pallet specified in the XCM instruction. so how does XCM determine the pallet / module where the ping extrinsic on Parachain B is located? The code I attached below is from the cumulus repo here
// This is Parachain A, which sends the xcm message
send_xcm::<T::XcmSender>(
(Parent, Junction::Parachain(para.into())).into(),
Xcm(vec![Transact {
origin_kind: OriginKind::Native,
require_weight_at_most: Weight::from_parts(1_000, 1_000),
call: <T as Config>::RuntimeCall::from(Call::<T>::ping {
seq,
payload: payload.clone().to_vec(),
})
.encode()
.into(),
}]),
)
// This is the runtime of patachain B which contains cumulus-ping pallet which has the ping extrinsic
construct_runtime! {
pub enum Runtime where
Block = Block,
NodeBlock = generic::Block<Header, sp_runtime::OpaqueExtrinsic>,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
...
Spambot: cumulus_ping::{Pallet, Call, Storage, Event<T>} = 99,
}
}