sunshine-protocol / sunshine

Governance + Bounty Platform
Other
43 stars 16 forks source link

doc pallet #165

Closed 4meta5 closed 4 years ago

4meta5 commented 4 years ago

a storage utility pallet designed for inheritance by other modules and not for direct use

motivation

  1. Generalize the global hashset in the bounty pallet; It encodes the issues metadata and stores the encoding on-chain in a hashset. This prevents future duplicates.

The idea behind the CodeSets map in this module is to allow inheriting modules to create code sets. Every code set has a CodeId which should be stored in the inheriting modules storage to append to any calls to add new items to the code set or check item membership.

In the future, I'd like to add requirements for each CodeSet like length. If I can bound the length, then I can emit events with the code as well.

One day, I'd like an inheriting module to be able to register CodeSets with all codes encrypted by some shared group key. A requirement for adding an element would be that the code is in a message with a valid signature.

  1. Take the constitution logic out of the Org module and replace with the Docs map here
4meta5 commented 4 years ago

too meta, might revisit later

At the moment, I prefer keeping the constitution logic in org. This ties it closely to the update permissions and does not add an additional get(DocId) lookup (and the code in this PR does).

I'd also rather just define each global hashset in each module (like in bounty) instead of creating a shared storage item for all of them. Interesting idea but I don't think calls to the shared storage item are ergonomic.