Skip to content

Implement TypeInfo for Duration #183

@nazar-pc

Description

@nazar-pc

Something in Substrate was merged recently, probably paritytech/substrate#13302, which made our code no longer compile with this error:

error[E0277]: the trait bound `std::time::Duration: scale_info::TypeInfo` is not satisfied
   --> crates/sp-consensus-subspace/src/lib.rs:479:1
    |
479 | / sp_api::decl_runtime_apis! {
480 | |     /// API necessary for block authorship with Subspace.
481 | |     pub trait SubspaceApi<RewardAddress: Encode + Decode> {
482 | |         /// The slot duration in milliseconds for Subspace.
...   |
534 | |     }
535 | | }
    | |_^ the trait `scale_info::TypeInfo` is not implemented for `std::time::Duration`

Encoding and decoding is supported for Duration, so TypeInfo should be too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions