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. mongodb图片上传 初识vue

    1.回顾 1.1 node node 服务器 url querystring express express 项目生成器 ejs 1.2 mongodb mongod --dbpath d:\data ...

  2. InnoDB Buffer Pool改进LRU页面置换

    由于硬盘和内存的造价差异,一台主机实例的硬盘容量通常会远超于内存容量.对于数据库等应用而言,为了保证更快的查询效率,通常会将使用过的数据放在内存中进行加速读取. 数据页与索引页的LRU 数据页和索引页 ...

  3. 异步注解@Async使用及其部分调优

    对于spring异步注解@Async的使用: 对于异步方法调用,从Spring3开始提供了@Async注解,该注解可以被标注在方法上,以便异步地调用该方法.调用者将在调用时立即返回,方法的实际执行将提 ...

  4. 1.UML之类图

    前言 在实际软件开发中,很多人都忽视了先设计后编码的理念,特别是像我这样的新手菜鸟:但在我亲戚的指导下,我便开启了一个简单项目的先设计关卡. 今天的重中之重---UML,学习了它,我们在编写项目代码时 ...

  5. Redis(四)主从复制

    主从复制 简介 主机数据更新之后根据配置和策略,自动同步数据到备机的Master/Slaver机制,Master以写为主,Slaver以读为主. 这样的机制能够实现: 读写分离:Master以写为主, ...

  6. Redis 报”OutOfDirectMemoryError“(堆外内存溢出)

    Redis 报错"OutOfDirectMemoryError(堆外内存溢出) "问题如下: 一.报错信息: 使用 Redis 的业务接口 ,产生 OutOfDirectMemor ...

  7. P7603 [THUPC2021] 鬼街(减半警报器模板)

    P7603 [THUPC2021] 鬼街(减半警报器模板) 前言 这是一个由 lxl 大佬提出的神奇 trick,第一次省选集训的时候有点颓,听完了没写.刚好明天又要讲这个不如写篇题解. 还是,我太弱 ...

  8. Linux(centos7.9)搭建ldap服务器

    一.LDAP是什么 后期更新,目前只搭建了服务器 二.linux搭建LDAP服务器 以下服务器信息为该文档安装Radius服务环境 服务器信息:CentOS7  内核版本:3.10.0-1160.el ...

  9. 2.OS-Virtualization|抽象:进程

    进程:运行中的程序. 没有运行前,就是一个代码,他是静态的. 通过一系列抽象,有了状态. 通过进程抽象,我们需要明白计算机设计的一些思考点:如何分离?如何管理?如何抽象? 运行 就绪 阻塞 它就是一个 ...

  10. 用tk.mybaits实现指定字段更新

    ​ 去年年底的因为业务需要需要在使用tk.mybaits框架的系统中实现指定字段的更新,可是tk.mybaits框架本身并不支持这个功能,我翻遍了CSDN和其他相关的技术相关的网站都没有找到相关的解决 ...