pub fn delegate<T: Config<I>, I: 'static>(
    class: <<T as Config<I>>::Polls as Polling<TallyOf<T, I>>>::Class,
    to: <<T as Config>::Lookup as StaticLookup>::Source,
    conviction: Conviction,
    balance: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
)
Expand description

Delegate the voting power (with some given conviction) of the sending account for a particular class of polls.

The balance delegated is locked for as long as it’s delegated, and thereafter for the time appropriate for the conviction’s lock period.

The dispatch origin of this call must be Signed, and the signing account must either:

  • be delegating already; or

  • have no voting activity (if there is, then it will need to be removed through remove_vote).

  • to: The account whose voting the target account’s voting power will follow.

  • class: The class of polls to delegate. To delegate multiple classes, multiple calls to this function are required.

  • conviction: The conviction that will be attached to the delegated votes. When the account is undelegated, the funds will be locked for the corresponding period.

  • balance: The amount of the account’s balance to be used in delegating. This must not be more than the account’s current balance.

Emits Delegated.

Weight: O(R) where R is the number of polls the voter delegating to has voted on. Weight is initially charged as if maximum votes, but is refunded later.

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::delegate.