referrerpolicy=no-referrer-when-downgrade
pallet_referenda

Type Alias ReferendumInfoOf

Source
pub type ReferendumInfoOf<T, I> = ReferendumInfo<TrackIdOf<T, I>, PalletsOriginOf<T>, BlockNumberFor<T, I>, BoundedCallOf<T, I>, BalanceOf<T, I>, TallyOf<T, I>, <T as Config>::AccountId, ScheduleAddressOf<T, I>>;

Aliased Type§

enum ReferendumInfoOf<T, I> {
    Ongoing(ReferendumStatus<<<T as Config<I>>::Tracks as TracksInfo<<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, <<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber>>::Id, <<T as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin, <<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Bounded<<T as Config<I>>::RuntimeCall, <T as Config>::Hashing>, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, <T as Config<I>>::Tally, <T as Config>::AccountId, <<T as Config<I>>::Scheduler as Anon<<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, <T as Config<I>>::RuntimeCall, <<T as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin>>::Address>),
    Approved(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>),
    Rejected(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>),
    Cancelled(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>),
    TimedOut(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>),
    Killed(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber),
}

Variants§

§

Ongoing(ReferendumStatus<<<T as Config<I>>::Tracks as TracksInfo<<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, <<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber>>::Id, <<T as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin, <<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Bounded<<T as Config<I>>::RuntimeCall, <T as Config>::Hashing>, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, <T as Config<I>>::Tally, <T as Config>::AccountId, <<T as Config<I>>::Scheduler as Anon<<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, <T as Config<I>>::RuntimeCall, <<T as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin>>::Address>)

Referendum has been submitted and is being voted on.

§

Approved(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>)

Referendum finished with approval. Submission deposit is held.

§

Rejected(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>)

Referendum finished with rejection. Submission deposit is held.

§

Cancelled(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>)

Referendum finished with cancellation. Submission deposit is held.

§

TimedOut(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>, Option<Deposit<<T as Config>::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance>>)

Referendum finished and was never decided. Submission deposit is held.

§

Killed(<<T as Config<I>>::BlockNumberProvider as BlockNumberProvider>::BlockNumber)

Referendum finished with a kill.

Implementations

Source§

impl<TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>

Source

pub fn take_decision_deposit( &mut self, ) -> Result<Option<Deposit<AccountId, Balance>>, ()>

Take the Decision Deposit from self, if there is one. Returns an Err if self is not in a valid state for the Decision Deposit to be refunded.

Source

pub fn take_submission_deposit( &mut self, ) -> Result<Option<Deposit<AccountId, Balance>>, ()>

Take the Submission Deposit from self, if there is one and it’s in a valid state to be taken. Returns an Err if self is not in a valid state for the Submission Deposit to be refunded.

Trait Implementations

Source§

impl<TrackId: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Call: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Clone + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> Clone for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>

Source§

fn clone( &self, ) -> ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress> Debug for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>
where TrackId: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Call: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Debug + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone,

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> Decode for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>
where ReferendumStatus<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>: Decode, Moment: Decode + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Option<Deposit<AccountId, Balance>>: Decode,

Source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl<TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> Encode for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>
where ReferendumStatus<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>: Encode, Moment: Encode + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Option<Deposit<AccountId, Balance>>: Encode,

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )

Convert self to a slice and append it to the destination.
§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl<TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> MaxEncodedLen for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>
where ReferendumStatus<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>: MaxEncodedLen, Moment: MaxEncodedLen + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Option<Deposit<AccountId, Balance>>: MaxEncodedLen,

Source§

fn max_encoded_len() -> usize

Upper bound, in bytes, of the maximum encoded size of this item.
Source§

impl<TrackId: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Call: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: PartialEq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> PartialEq for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>

Source§

fn eq( &self, other: &ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress> TypeInfo for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>
where ReferendumStatus<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>: TypeInfo + 'static, Moment: TypeInfo + 'static + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Option<Deposit<AccountId, Balance>>: TypeInfo + 'static, TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + TypeInfo + 'static,

Source§

type Identity = ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

impl<TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> EncodeLike for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>
where ReferendumStatus<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>: Encode, Moment: Encode + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Option<Deposit<AccountId, Balance>>: Encode,

Source§

impl<TrackId: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Call: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> Eq for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>

Source§

impl<TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Moment: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone> StructuralPartialEq for ReferendumInfo<TrackId, RuntimeOrigin, Moment, Call, Balance, Tally, AccountId, ScheduleAddress>