3

In substrate ranked-collective pallet, we can see the function call.

let min_rank = T::MinRankOfClass::convert(class);

Check the code here.

In the polkadot repo, I can only find the configuration for type MinRankOfClass.

type MinRankOfClass = sp_runtime::traits::Identity;

Check the code here.

The problem is I still can not find where is the convert function implementation which works for fellowship collective(ranked-collective pallet). Could anybody help me out of this? Many thanks.

The reason I need to understand this code is I have to judge whether the rank of a fellowship member is enough to vote a fellowship referendum.

1 Answer 1

0

Here you go.

https://paritytech.github.io/substrate/master/src/sp_runtime/traits.rs.html#729-733

Just like its name said, identity.

/// A structure that performs identity conversion.
pub struct Identity;
impl<T> Convert<T, T> for Identity {
    fn convert(a: T) -> T {
        a
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.