I have a substrate pallet A and it has following Errors Defined

    pub enum Error<T> {
        /// Not a coffee

trait implementation in Pallet A

pub trait A<AccountId, Error> {

    fn is_valid_coffee(coffee_id: u32) -> Result<bool, Error>;

impl<T: Config> A<AccountIdOf<T>, Error<T>> for Pallet<T> {

    fn is_valid_coffee(coffee_id: u32) -> Result<bool, Error<T>> {

I am using a trait defined in this Pallet A (is_valid_coffee) in pallet B, it requires the Error defined in Pallet A. How to import it to Pallet B?

1 Answer 1

trait Config: frame_system::Config + another_pallet::Config {}

fn example<T>() -> DispatchError 
    T: Config

Your Answer

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

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