【发布时间】:2021-10-14 10:02:22
【问题描述】:
我正在尝试在外部参数声明中使用以下结构:
pub struct PriceUpdate {
pub source_currency: Vec<u8>,
pub target_currency: Vec<u8>,
pub provider: Vec<u8>,
pub price: i64,
}
这是外部声明:
pub fn new_price(origin: OriginFor<T>, price_update: PriceUpdate) -> DispatchResult {
这会导致编译错误:
^^^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `PriceUpdate`
有人可以解释对于复杂类型(例如结构/vecs/vecs 等)的外部参数有什么要求吗?我看过 WrapperTypeEncode 文档https://docs.rs/parity-scale-codec/2.2.0/parity_scale_codec/trait.WrapperTypeEncode.html,但他们没有说明这些信息。
非常感谢!
【问题讨论】:
标签: substrate extrinsic-parameters