0

I want to remove this wildcard import, but don't know how to do.

enter image description here

I am working on the "pallet/xxx/src/lib.rs", while this file is very similar to the one from "substrate-node-template" repository. When I modify the part like below as you said, I can see this error messages.

pub use pallet::{Pallet, Config};

enter image description here

At the moment, I modify the part again following the messages like below, and get the other error messages.

pub use pallet::{Config, Error, Pallet, PostById, PostReactionKindByAccount,};

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

I am trying to fix these errors, but don't know how to do because of my knowledge's lack. What should I do now?

1 Answer 1

0

There is no problem in using the wildcard export. The FRAME macros currently require that you have this artificial module and then re-export all the types from there to the top of your crate as the module doesn't exist. When Rust will support macros to be declared on the crate level these artificial module can be removed.

If you really don't like the wildcard export, you can switch it to using individual exports:

pub use pallet::{Pallet, Config};

However, that is a tedious manual approach.

4
  • Thanks for your message, but I want to let you know more about.
    – TinyDev
    Nov 4, 2022 at 23:16
  • I updated my question, if you are available, please check it again. All the best.
    – TinyDev
    Nov 4, 2022 at 23:16
  • Ahh yeah, I see. You should for now put tt_default_parts in the export list. I think this is something we should fix. It is some macro generated by the macro and should be put into the public export automatically.
    – bkchr
    Nov 4, 2022 at 23:32
  • Awesome, thanks a lot, @bkchr.
    – TinyDev
    Nov 4, 2022 at 23:40

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .