2

I want to use the Asset pallet from another custom pallet. The goal is to use the custom pallet account and transfers the assets of this account to another one using this function: https://github.com/paritytech/substrate/blob/polkadot-v0.9.18/frame/assets/src/lib.rs#L692

But how do we handle the Origin ( https://github.com/paritytech/substrate/blob/polkadot-v0.9.18/frame/assets/src/lib.rs#L693 ) as we don't have the possibility to sign it ( because it use generated pallet account like treasury does) ?

1 Answer 1

1

What I can suggest is this. Don't tightly couple your pallet to pallet-assets. Instead, put an associated type in your pallet's config with a Transfer trait bound (assets pallet implements it). Then, you can use the transfer method from that trait, which does not require origin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.