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 method
    fn info(id: Self::Id) -> Option<&'static TrackInfo<Balance, Moment>> { ... }
}
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>)]

Return the array of known tracks and their information.

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().

Implementors§