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 ...
随机推荐
- 基于OpenAI的代码编辑器,有点酷有点强!
最近随着OpenAI的一系列大动作,把软件领域搅的天翻地覆.各行各业各领域,都出现了大量新产品. 开发工具领域首当其冲,各种新工具层出不穷,今天TJ就给大家推荐一个全新的开发工具:Cursor 从官网 ...
- 比memcpy还要快的内存拷贝,老哥了解一下?
本文来自博客园,作者:T-BARBARIANS,转载请注明原文链接:https://www.cnblogs.com/t-bar/p/17262147.html 谢谢! 前言 朋友们有想过居然还有比me ...
- 每日复习------main()方法以及对象的初始化顺序
由于 Java 虚拟机需要调用类的 main()方法,所以该方法的访问权限必须是 public,又因为 Java 虚拟机在执行 main()方法时不必创建对象,所以该方法必须是 static 的,该方 ...
- [MYSQL/JDBC]mysql-connector-java与MySQL、JDK对应的兼容版本[转载]
1 文由 MYSQL 数据库版本 与 驱动版本之间的兼容性,可能会涉及到 部分数据库特性(函数.语法)等是否能够正常使用的问题. 2 兼容性: mysql-connector-java VS Mysq ...
- Semantic Kernel 入门系列:🛸LLM降临的时代
不论你是否关心,不可否认,AGI的时代即将到来了. 在这个突如其来的时代中,OpenAI的ChatGPT无疑处于浪潮之巅.而在ChatGPT背后,我们不能忽视的是LLM(Large Language ...
- 【FINALE】NOIP2022 退役记 || THE END.
我的停课生活相册 - password:1007 目录 Day -4 Day -2 Day -1 Day 1 2022/11/26 NOIP 2022 OI 浅忆录 Day -4 好冷啊.有了那么点冬 ...
- Golang 常用库之jwt-go
本文地址 https://www.cnblogs.com/zichliang/p/17303759.html github地址:https://github.com/dgrijalva/jwt-go ...
- sql求每家店铺销量前三的sku, 附python解法
背景 有一张表: date store_id sku sales 2023-01-01 CK005 03045 50 date 代表交易日期,store_id代表门店编号,sku代表商品,sales代 ...
- MyBatisPlus解决逻辑删除与唯一索引的兼容问题
需求背景 比如有张用户表,在插入或者更新数据的时候,我们需要 用户名称(username),不能重复. 我们首先考虑的是给该字段创建唯一索引 create unique index uni_usern ...
- Java学习笔记06
1. 类和对象 1.1 类和对象 客观存在的事物皆为对象,所以我们也常常说万物皆对象. 类 类的理解 类是对现实生活中一类具有共同属性和行为的事物的抽象 类是对象的数据类型,类是具有相同属性和行为 ...