Enum pallet_society::Call[][src]

pub enum Call<T: Config<I>, I: Instance = DefaultInstance> {
    bid(<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance),
    unbid(u32),
    vouch(T::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance),
    unvouch(u32),
    vote(<T::Lookup as StaticLookup>::Sourcebool),
    defender_vote(bool),
    payout(),
    found(T::AccountIdu32Vec<u8>),
    unfound(),
    judge_suspended_member(T::AccountIdbool),
    judge_suspended_candidate(T::AccountIdJudgement),
    set_max_members(u32),
    // some variants omitted
}
Expand description

Dispatchable calls.

Each variant of this enum maps to a dispatchable function from the associated module.

Variants

bid(<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance)

A user outside of the society can make a bid for entry.

Payment: CandidateDeposit will be reserved for making a bid. It is returned when the bid becomes a member, or if the bid calls unbid.

The dispatch origin for this call must be Signed.

Parameters:

Key: B (len of bids), C (len of candidates), M (len of members), X (balance reserve)

Total Complexity: O(M + B + C + logM + logB + X)

Tuple Fields of bid

0: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
unbid(u32)

A bidder can remove their bid for entry into society. By doing so, they will have their candidate deposit returned or they will unvouch their voucher.

Payment: The bid deposit is unreserved if the user made a bid.

The dispatch origin for this call must be Signed and a bidder.

Parameters:

Key: B (len of bids), X (balance unreserve)

Total Complexity: O(B + X)

Tuple Fields of unbid

0: u32
vouch(T::AccountId, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance, <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance)

As a member, vouch for someone to join society by placing a bid on their behalf.

There is no deposit required to vouch for a new bid, but a member can only vouch for one bid at a time. If the bid becomes a suspended candidate and ultimately rejected by the suspension judgement origin, the member will be banned from vouching again.

As a vouching member, you can claim a tip if the candidate is accepted. This tip will be paid as a portion of the reward the member will receive for joining the society.

The dispatch origin for this call must be Signed and a member.

Parameters:

Key: B (len of bids), C (len of candidates), M (len of members)

Total Complexity: O(M + B + C + logM + logB + X)

Tuple Fields of vouch

0: T::AccountId1: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance2: <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
unvouch(u32)

As a vouching member, unvouch a bid. This only works while vouched user is only a bidder (and not a candidate).

The dispatch origin for this call must be Signed and a vouching member.

Parameters:

Key: B (len of bids)

Total Complexity: O(B)

Tuple Fields of unvouch

0: u32
vote(<T::Lookup as StaticLookup>::Sourcebool)

As a member, vote on a candidate.

The dispatch origin for this call must be Signed and a member.

Parameters:

Key: C (len of candidates), M (len of members)

Total Complexity: O(M + logM + C)

Tuple Fields of vote

0: <T::Lookup as StaticLookup>::Source1: bool
defender_vote(bool)

As a member, vote on the defender.

The dispatch origin for this call must be Signed and a member.

Parameters:

Total Complexity: O(M + logM)

Tuple Fields of defender_vote

0: bool
payout()

Transfer the first matured payout for the sender and remove it from the records.

NOTE: This extrinsic needs to be called multiple times to claim multiple matured payouts.

Payment: The member will receive a payment equal to their first matured payout to their free balance.

The dispatch origin for this call must be Signed and a member with payouts remaining.

Key: M (len of members), P (number of payouts for a particular member)

Total Complexity: O(M + logM + P + X)

Tuple Fields of payout

found(T::AccountIdu32Vec<u8>)

Found the society.

This is done as a discrete action in order to allow for the module to be included into a running chain and can only be done once.

The dispatch origin for this call must be from the FounderSetOrigin.

Parameters:

Total Complexity: O(1)

Tuple Fields of found

0: T::AccountId1: u322: Vec<u8>
unfound()

Annul the founding of the society.

The dispatch origin for this call must be Signed, and the signing account must be both the Founder and the Head. This implies that it may only be done when there is one member.

Total Complexity: O(1)

Tuple Fields of unfound

judge_suspended_member(T::AccountIdbool)

Allow suspension judgement origin to make judgement on a suspended member.

If a suspended member is forgiven, we simply add them back as a member, not affecting any of the existing storage items for that member.

If a suspended member is rejected, remove all associated storage items, including their payouts, and remove any vouched bids they currently have.

The dispatch origin for this call must be from the SuspensionJudgementOrigin.

Parameters:

Key: B (len of bids), M (len of members)

Total Complexity: O(M + logM + B)

Tuple Fields of judge_suspended_member

0: T::AccountId1: bool
judge_suspended_candidate(T::AccountIdJudgement)

Allow suspended judgement origin to make judgement on a suspended candidate.

If the judgement is Approve, we add them to society as a member with the appropriate payment for joining society.

If the judgement is Reject, we either slash the deposit of the bid, giving it back to the society treasury, or we ban the voucher from vouching again.

If the judgement is Rebid, we put the candidate back in the bid pool and let them go through the induction process again.

The dispatch origin for this call must be from the SuspensionJudgementOrigin.

Parameters:

Key: B (len of bids), M (len of members), X (balance action)

Total Complexity: O(M + logM + B + X)

Tuple Fields of judge_suspended_candidate

0: T::AccountId1: Judgement
set_max_members(u32)

Allows root origin to change the maximum number of members in society. Max membership count must be greater than 1.

The dispatch origin for this call must be from ROOT.

Parameters:

Total Complexity: O(1)

Tuple Fields of set_max_members

0: u32

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Attempt to deserialise the value from input.

Attempt to skip the encoded value from input. Read more

Returns the fixed encoded size of the type. Read more

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

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

Convert self to an owned vector.

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

Calculates the encoded size. Read more

Return the function name of the Call.

Return all function names.

Return a DispatchInfo, containing relevant information of this dispatch. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The origin type of the runtime, (i.e. frame_system::Config::Origin).

Dispatch this call but do not check the filter in origin.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Decode Self and consume all of the given input data. Read more

Decode Self and consume all of the given input data. Read more

Decode Self with the given maximum recursion depth. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Cast reference.

Cast reference.

Cast mutable reference.

Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Return an encoding of Self prepended by given slice.

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.