error[E0432]: unresolved import `sp_runtime::testing`
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:5:41
|
5 | traits::{BlakeTwo256, IdentityLookup}, testing::Header, Perbill,
| ^^^^^^^ could not find `testing` in `sp_runtime` error[E0433]: failed to resolve: could not find `GenesisConfig` in `system`
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:66:10
|
66 | system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
| ^^^^^^^^^^^^^ could not find `GenesisConfig` in `system` error[E0412]: cannot find type `Box` in this scope
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:10:1
|
10 | / impl_outer_origin! {
11 | | pub enum Origin for Test {}
12 | | }
| |_^ not found in this scope
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
1 | use crate::Box;
|
1 | use frame_support::traits::Box;
|
1 | use sp_std::boxed::Box;
| error[E0433]: failed to resolve: use of undeclared type `Box`
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:10:1
|
10 | / impl_outer_origin! {
11 | | pub enum Origin for Test {}
12 | | }
| |_^ not found in this scope
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
1 | use crate::Box;
|
1 | use frame_support::traits::Box;
|
1 | use sp_std::boxed::Box;
| error[E0433]: failed to resolve: use of undeclared type `Box`
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:10:1
|
10 | / impl_outer_origin! {
11 | | pub enum Origin for Test {}
12 | | }
| |_^ not found in this scope
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
1 | use crate::Box;
|
1 | use frame_support::traits::Box;
|
1 | use sp_std::boxed::Box;
| error[E0433]: failed to resolve: use of undeclared type `Box`
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:10:1
|
10 | / impl_outer_origin! {
11 | | pub enum Origin for Test {}
12 | | }
| |_^ not found in this scope
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
1 | use crate::Box;
|
1 | use frame_support::traits::Box;
|
1 | use sp_std::boxed::Box;
| error[E0412]: cannot find type `TestExternalities` in crate `sp_io`
--> /Users/suyinrong/bitcoin-proj/substrate-course/substrate-node-template/pallets/poe/src/mock.rs:65:33
|
65 | pub fn new_test_ext() -> sp_io::TestExternalities {
| ^^^^^^^^^^^^^^^^^ not found in `sp_io` error: aborting due to 7 previous errors Some errors have detailed explanations: E0412, E0432, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `pallet-poe` To learn more, run the command again with --verbose.

遇见此类错误信息是因为,在你的测试mod上面需要加上#[cfg(test)]

例如我这里就是在mod mork上没有添加此类设置报错。  

substrate 编译出错unresolved import `sp_runtime::testing` failed to resolve: could not find `GenesisConfig` in `system`的更多相关文章

  1. unresolved import 解决办法

    安装paramiko 需要先安装另两个模块 安装时未注意32bit,安装了64的,本地python是32的所以出错,重装后报错unresolved import,环境是eclipse(pydev) 用 ...

  2. Weblogic jsp页面编译出错,Weblogic jsp编译异常

    Weblogic jsp页面编译出错,Weblogic jsp编译异常 ======================== 蕃薯耀 2018年1月29日 http://www.cnblogs.com/f ...

  3. Android Studio2.1.2 Java8环境下引用Java Library编译出错

    转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...

  4. protobuf编译出错的解决方案(iOS,OSX)

    protobuf 最近使用protobuf,变编译工具时遇上一点问题.现在附上解决方案 编译过程 完全参照 https://github.com/alexeyxo/protobuf-objc 编译出错 ...

  5. Xamarin.iOS编译出错

    Xamarin.iOS编译出错 错误信息:C:/Program Files(x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0 ...

  6. [Eclipse] - 解决导入flask模块出现的Unresolved Import flask问题

    http://www.cnblogs.com/mizhon/p/4242073.html [Eclipse] - 解决导入flask模块出现的Unresolved Import flask问题 最近想 ...

  7. 运行 appium 自带实例报错:unresolved import:webdriver

    python demo 中from appium import webdriver报错unresolved import:webdriver 之所以会报这样的error是因为没有装clientclie ...

  8. 解决Eclipse Pydev中import时报错:Unresolved import

    在安装 图像处理工具包 mahotas 后,在eclipse中尝试import mahotas时,出现Unresolved import错误,按快捷无法自动生成代码提示 但是,程序运行时可以通过,在命 ...

  9. 解决eclipse下pydev的unresolved import的问题

    有些模块,比如PIL,已经装入过,但是在pydev中无法自动提示,甚至有报 unresolved import的问题,虽然不会引起运行时问题,但是无法实现自动提示,还是一件很麻烦的事情.   下面有个 ...

  10. Cocos2d-x 3.0 编译出错 解决 error: expected &#39;;&#39; at end of member declaration

    近期把项目移植到cocos2d-x 3.0,在整Android编译环境的时候,出现一大堆的编译出错,都是类似"error: expected ';' at end of member dec ...

随机推荐

  1. Duplicate File Finder Pro - 重复文件查找器,给你的 Mac 清理出大量磁盘空间

    重复文件查找器 Duplicate File Finder Pro 是一个实用程序,只需3次点击就能在Mac上找到重复的文件.拖放功能和尽可能多的文件夹,你想,然后按下扫描按钮.在一分钟,应用程序将给 ...

  2. Moho Pro - Mac 上一款专业的二维动画制作软件,强大的功能让你尽情发挥创意

    Moho,以前被称为动画工作室专业版,是最好的质量的2D动画软件之一.这个程序是理想的专业人士寻找一个更有效的替代方法来创建动画,没有繁琐的详细逐帧处理.具有直观的界面和现成的人物和附加对象(卡通对象 ...

  3. flutter系列之:在flutter中使用媒体播放器

    目录 简介 使用前的准备工作 在flutter中使用video_player 总结 简介 现在的app功能越来越强大,除了基本的图文之外,还需要各种各样的其他的功能,比如视频,和直播. 直播可能会比较 ...

  4. 计网学习笔记五 wireless && mobile networks

    老师把无线网络用一节课一遍过了-感觉没能学透,便课后自己总结,看书,找资料补充,把无线网络大概摸了个七七八八.虽然不算精细,但还能看!内容包括WLAN总概,WiFi-WLAN的实现,802.11规定的 ...

  5. [Linux]调整swap

    在启动Tomcat的过程中,tomcat/catalina.out中报出如下故障: > /opt/govern/wydaas/logs/catalina.out # There is insuf ...

  6. maven下载和配置信息

    1. 下载maven: https://maven.apache.org/ 2. 进入官网点击 Download 3. 最新版直接下载 .tar.gz 格式linux系统 .zip windows系统 ...

  7. (一)pyahocorasick和marisa_trie,字符串快速查找的python包,自然语言处理,命名实体识别可用的高效包

    Pyahocorasick Pyahocorasick是一个基于AC自动机算法的字符串匹配工具.它可以用于快速查找多个短字符串在一个长字符串中的所有出现位置.Pyahocorasick可以在构建状态机 ...

  8. shell自动化脚本,启动、停止应用程序

    #!/usr/bin/env bash # 常量初始化 set_runtime_vars(){ # 日期时间 Now_Date=`date +"%Y-%m-%d %H:%M:%S" ...

  9. SVN添加新的用户

    1.首先确定svn的文件夹的位置 find / -name svn 2.通过find找到svn地址之后,cd进入 /var/svn/ 下 cd /var/svn/ 3.修改/var/svn/下面的au ...

  10. 2020-12-12:现场写代码,把CPU打满,java和go都行,并解释为什么。

    福哥答案2020-12-12: 现在的电脑一般是多核的,单个for循环cpu是不会打满的. 我的电脑是四核八线程的,不管是java还是go,6个for循环就能把cpu打满,4个和5个cpu打不满. 为 ...