I was trying to transfer nft
from relay chain
to parachain
through transact
instruction of Xcm
.
Here is snippet of code I am using
Xcm(vec![Transact {
origin_kind:OriginKind::Xcm,
require_weight_at_most: Weight::from_parts(1_000, 1_000),
call: pallet_nfts::Call::<T, I>::create {
admin,
config
}
.encode()
.into(),
}]), )
{
Ok((hash, cost)) =>
Self::deposit_event(Event::NftSent( hash, cost)),
Err(e) =>
Self::deposit_event(Event::NFTSendingError(e, )),
}
Through this I was trying to call create
function of pallet-nfts
on parachain
from relay chain, the code executed successfully and received event NFTSent
on relay chain. The problem I faced on parachain is Failed to Decode
.
Here is the function create of pallet-nfts
pub fn create(
origin: OriginFor<T>,
admin: AccountIdLookupOf<T>,
config: CollectionConfigFor<T, I>,
) -> DispatchResult {
let collection =
NextCollectionId::<T, I>::get().unwrap_or(T::CollectionId::initial_value());
frame_support::log::warn!("kuch bi ");
let owner = T::CreateOrigin::ensure_origin(origin, &collection)?;
frame_support::log::warn!("ye owner hai bhai {:?}",owner);
let admin = T::Lookup::lookup(admin)?;
In this function we are passing three parameters, Origin
, admin
, config
.My question here is how should I call this transact instruction
so that it pass successfully it will be very helpful any one can guide me on this. Below is the code snippet of the transaction instruction that I am using.
call: pallet_nfts::Call::<T, I>::create {
admin,
config