substrate 编译出错unresolved import `sp_runtime::testing` failed to resolve: could not find `GenesisConfig` in `system`
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`的更多相关文章
- unresolved import 解决办法
安装paramiko 需要先安装另两个模块 安装时未注意32bit,安装了64的,本地python是32的所以出错,重装后报错unresolved import,环境是eclipse(pydev) 用 ...
- Weblogic jsp页面编译出错,Weblogic jsp编译异常
Weblogic jsp页面编译出错,Weblogic jsp编译异常 ======================== 蕃薯耀 2018年1月29日 http://www.cnblogs.com/f ...
- Android Studio2.1.2 Java8环境下引用Java Library编译出错
转载请注明出处:http://www.cnblogs.com/LT5505/p/5685242.html 问题:在Android Studio2.1.2+Java8的环境下,引用Java Librar ...
- protobuf编译出错的解决方案(iOS,OSX)
protobuf 最近使用protobuf,变编译工具时遇上一点问题.现在附上解决方案 编译过程 完全参照 https://github.com/alexeyxo/protobuf-objc 编译出错 ...
- Xamarin.iOS编译出错
Xamarin.iOS编译出错 错误信息:C:/Program Files(x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0 ...
- [Eclipse] - 解决导入flask模块出现的Unresolved Import flask问题
http://www.cnblogs.com/mizhon/p/4242073.html [Eclipse] - 解决导入flask模块出现的Unresolved Import flask问题 最近想 ...
- 运行 appium 自带实例报错:unresolved import:webdriver
python demo 中from appium import webdriver报错unresolved import:webdriver 之所以会报这样的error是因为没有装clientclie ...
- 解决Eclipse Pydev中import时报错:Unresolved import
在安装 图像处理工具包 mahotas 后,在eclipse中尝试import mahotas时,出现Unresolved import错误,按快捷无法自动生成代码提示 但是,程序运行时可以通过,在命 ...
- 解决eclipse下pydev的unresolved import的问题
有些模块,比如PIL,已经装入过,但是在pydev中无法自动提示,甚至有报 unresolved import的问题,虽然不会引起运行时问题,但是无法实现自动提示,还是一件很麻烦的事情. 下面有个 ...
- Cocos2d-x 3.0 编译出错 解决 error: expected ';' at end of member declaration
近期把项目移植到cocos2d-x 3.0,在整Android编译环境的时候,出现一大堆的编译出错,都是类似"error: expected ';' at end of member dec ...
随机推荐
- 南昌航空大学-软件学院-22206104-段清如-JAVA第一次Blog作业
南昌航空大学-软件学院-22206104-段清如-JAVA第一次Blog作业 前言: 这个学期才开始接触java,到现在一个多月的时间,已经差不多可以写出一些基本的简单的程序了.对比上个学期学习的C语 ...
- golang 中的 cronjob
引言 最近做了一个需求,是定时任务相关的.以前定时任务都是通过 linux crontab 去实现的,现在服务上云(k8s)了,尝试了 k8s 的 CronJob,由于公司提供的是界面化工具,使用.查 ...
- mumpy常用函数
numpy.array(list(1,2,3,4)) #将一个list类型/tupe类型数据转换为一个array数组对象 #默认所有的数据类型都是相同,若传进来的参数类型不同,则遵循以下优先级: st ...
- 系统建模之UML状态图[转载]
1 状态图的简介(Instrduction) 状态图(Statechart Diagram)主要用于描述一个对象在其生存期间的动态行为,表现为一个对象所经历的状态序列,引起状态转移的事件(Event) ...
- PRINCE2核心知识点整理
前言 PRINCE2,即 PRoject IN Controlled Environment(受控环境中的项目)是一种结构化的项目管理方法论,由英国政府内阁商务部(OGC)推出,是英国项目管理标准. ...
- 企业应用可观测性利器!华为云CodeArts APM发布
摘要:近日,华为云全链路应用性能管理服务CodeArts APM全新上线,提供端到端的全链路性能管理服务,涵盖前端监控.应用性能监控,全面拥抱开源生态. 本文分享自华为云社区<企业应用可观测性利 ...
- Python 使用列表一部分(切片)
使用列表的一部分(切片) 处理列表的部分元素 切片 指定第一个元素的索引和最后一个元素索引加1 列表名[索引:索引+1] 索引加1:列表中第索引个元素 (左包括右不包括) 未指定索引 列表名[:] 提 ...
- [Pytorch框架] 1.4 Autograd:自动求导
文章目录 Autograd: 自动求导机制 张量(Tensor) 梯度 Autograd: 自动求导机制 PyTorch 中所有神经网络的核心是 autograd 包. 我们先简单介绍一下这个包,然后 ...
- Protobuf编码规则
支持类型 该表显示了在 .proto 文件中指定的类型,以及自动生成的类中的相应类型: .proto Type Notes C++ Type Java/Kotlin Type[1] Java/Kotl ...
- 集线程池应用、多次HttpWebRequest请求,自动切换账号等等的移动信息查询软件
具体内容就不说了,只是自己留着未来好找而已 主窗体: using System; using System.Collections.Generic; using System.ComponentMod ...