【发布时间】:2021-03-20 14:53:01
【问题描述】:
在substrate 2.0.1中,其代码如下:
mod simple_event {
pub use crate::Event;
}
impl_outer_event! {
pub enum TestEvent for TestRuntime {
simple_event,
frame_system<T>,
}
}
https://github.com/substrate-developer-hub/recipes/blob/master/pallets/simple-event/src/tests.rs
但添加 impl_outer_event 会导致基板 3.0.0 出现错误:
/ frame_support::construct_runtime!(
14 | | pub enum Test where
15 | | Block = Block,
16 | | NodeBlock = Block,
... |
21 | | }
22 | | );
| |__^ duplicate definitions for `outer_event_metadata`
...
58 | / impl_outer_event! {
59 | | pub enum TestEvent for Test {
60 | | simple_event<T>,
61 | | frame_system<T>,
62 | | }
63 | | }
| |_- other definition for `outer_event_metadata`
如何解决?
【问题讨论】:
-
你能提供一个stackoverflow.com/help/minimal-reproducible-example 吗?可能就像不在
use语句中添加正确的依赖项一样简单,所以一个完整的工作示例可以帮助你找到根。