sunshine-protocol / sunshine

Governance + Bounty Platform
Other
42 stars 16 forks source link

set OrgId, ShareIds as types in Module's Trait #63

Closed 4meta5 closed 4 years ago

4meta5 commented 4 years ago

old decision

OrgId and ShareId are just type aliased to u32 in the newest modules/runtime/node. They are just counters and I don't expect to have more groups registered on-chain that u32::max so I consider this to be a reasonable decision. They don't need to config types.

Originally posted by @4meta5 in https://github.com/web3garden/sunshine-node/diffs/9

proposed new policy

make them configurable types for the module's Traits again because these are just indices and people might want to set them as smaller/larger...

but this is NOT an immediate priority. The client can just use u32 for these types until the change is made.

4meta5 commented 4 years ago

Trait bounds like this, but no AtLeast32Bit because that constrains the type assignment and defies the purpose of using type parameters.

    type _Id: Parameter
        + Member
        + Codec
        + Default
        + Copy
        + MaybeSerializeDeserialize
        + Debug
        + PartialOrd
        + CheckedSub
        + Zero
        + From<u32>
        + Into<u32>;
4meta5 commented 4 years ago

done