添加pallet_assets 错误:^^^ 在'pallet_assets'

问题描述

我在尝试编译时遇到此错误,但似乎无法解决...:

在终端中,运行“货物检查”后,我得到:


Compiling node-template-runtime v2.0.1 (/runtime)
  error[E0405]: cannot find trait `Config` in crate `pallet_assets`
     --> /runtime/src/lib.rs:360:21
      |
  360 | impl pallet_assets::Config for Runtime {
      |                     ^^^^^^ not found in `pallet_assets`

  error: aborting due to prevIoUs error...

我尝试使用 'Trait' 而不是 Config,但抛出了更多错误......?

提示将不胜感激。谢谢

解决方法

Config 特性是在 3.0.0 版中引入的。正如您所指出的,它以前是 Trait。如果您使用所有相同的主要版本(2.x 或 3.x)进行构建,则任何基板项目都应该是可编译的。我强烈建议从现在开始使用 v3+,预计不会再支持 v2。