pub trait TracksInfo<Balance, Moment> {
    type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen;
    type RuntimeOrigin;

    // Required methods
    fn tracks() -> &'static [(Self::Id, TrackInfo<Balance, Moment>)];
    fn track_for(origin: &Self::RuntimeOrigin) -> Result<Self::Id, ()>;

    // Provided methods
    fn info(id: Self::Id) -> Option<&'static TrackInfo<Balance, Moment>> { ... }
    fn check_integrity() -> Result<(), &'static str>
       where Balance: 'static,
             Moment: 'static { ... }
}
Expand description

Information on the voting tracks.

Required Associated Types§

source

type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen

The identifier for a track.

source

type RuntimeOrigin

The origin type from which a track is implied.

Required Methods§

source

fn tracks() -> &'static [(Self::Id, TrackInfo<Balance, Moment>)]

Sorted array of known tracks and their information.

The array MUST be sorted by Id. Consumers of this trait are advised to assert Self::check_integrity prior to any use.

source

fn track_for(origin: &Self::RuntimeOrigin) -> Result<Self::Id, ()>

Determine the voting track for the given origin.

Provided Methods§

source

fn info(id: Self::Id) -> Option<&'static TrackInfo<Balance, Moment>>

Return the track info for track id, by default this just looks it up in Self::tracks().

source

fn check_integrity() -> Result<(), &'static str>
where Balance: 'static, Moment: 'static,

Check assumptions about the static data that this trait provides.

Object Safety§

This trait is not object safe.

Implementors§