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. Spark基础实验七

    今天在做实验七,最开始有许许多多多的错误,最后通过查找.问同学才知道是数据集的格式和存放位置的原因. 就在好不容易解决了上一个错误,下一个错误就立马而来,错误如下: 目前还未找到解决办法,spark实 ...

  2. ACM-学习记录-数据结构-1

    AOJ-ALDS1_1_D Maximum Profit 本题主要考虑要将复杂度降到O(n),否则过不了最后五组数据 #include<iostream> #include<bits ...

  3. 免费注册 Redhat 开发者并且进行订阅和激活

    注册 一.进入 https://www.redhat.com/wapps/ugc/register.html 进行注册 二.然后通过这个网址进入开发者平台 https://developers.red ...

  4. JS引擎(2):Java平台上JavaScript引擎—Rhino/Nashorn概述

    可以后端开发的 javascript引擎有 Chrome V8 基于C++ java的Rhino引擎(JDK6被植入),Java8 被替换为Nashorn Rhino和Nashorn都是用Java实现 ...

  5. Get Your Wish

    Get Your Wish (https://www.luogu.com.cn/problem/P7262) 一个模拟题 解读一下题目:简单来说就是在现在重力的方向上,如果有水滴和电子元件就GG,否则 ...

  6. Golang一日一库之logrus

    前言 之前一篇文章介绍了 日志库zap https://www.cnblogs.com/zichliang/p/17311480.html 毋庸置疑,zap库无论是Golang在项目中 还是生产中都极 ...

  7. 【Python毕业设计】基于Python+Flask+MySQL的学生信息管理系统(附完整源码)

    1.项目说明基于python+Flask+mysql的学生信息管理系统项目实战 项目需要安装pycharm专业版,mysql数据库以及项目所需的所有模块创建数据库名称db_online_notes,然 ...

  8. R-SVM-plot踩坑记录

    并非所有的 svm 类型都支持plot.svm- 只有分类方法支持,而回归不支持. 所以代码应该svm_fit <- svm(factor(y)~x1+x2,data = df, kernel ...

  9. MAPPO学习笔记(1):从PPO算法开始

    由于这段时间的学习内容涉及到MAPPO算法,并且我对MAPPO算法这种多智能体算法的信息交互机制不甚了解,于是写了这个系列的笔记,目的是巩固知识,并且进行一些粗浅又滑稽的总结. 1.PPO算法的介绍 ...

  10. Python-tomorrow应用于UI自动化的简单使用

    一.简介 tomorrow属于第三方的一个模块,使用threads方法作为装饰器去修饰一个普通的函数,使其可以达到并发效果.使用起来非常简单. 二.安装 pip install tomorrow 使用 ...