Skip to content
Snippets Groups Projects
  • Hugo Trentesaux's avatar
    6b598084
    refac membership (!215) · 6b598084
    Hugo Trentesaux authored
    * delete notes.txt file
    
    * update notes with links to issues
    
    * update comment according to #159
    
    * doc idtystatus in readme
    
    * update weightinfo and benchmarks accordingly
    
    * add benchmark
    
    * remove remove_identity_consumers
    
    * remove force_remove_identity call
    
    * fix todo in test
    
    * update doc
    
    - remove request_membership
    - remove validate_identity
    
    * fix tests according to new MembershipRemovalReason
    
    * add membership removal reasons
    
    and clean up membership internal functions
    
    * remove check_remove_identity
    
    * build live tests
    
    (but no current network to check them against)
    
    * clippy :man_facepalming:
    
    * add wot tests related to issue #136
    
    * refac certification creation checks
    
    * refac identity creation checks
    
    * test benchmark ok
    
    * more precise error messages
    
    * check benchmarks ok
    
    * cargo cucumber ok
    
    * cargo test workspace ok
    
    * cargo test workspace quasi ok
    
    * cargo check all tests
    
    * cargo check all
    
    * remove IdtyEvent change owner key
    
    * remove removal other reason
    
    * refac revocation and removal reason
    
    * wip
    
    * refac
    
    * refac scheduling (tests ok)
    
    * add *Period
    
    * cargo test identity ok
    
    * remove IdtyEvent::Validated
    
    * cargo test wot ok
    
    * cargo test wot ok
    
    (one fails but fot the good reason)
    
    * cargo test membership ok
    
    * cargo check wot tests
    
    * cargo check identity tests
    
    * cargo check membership tests
    
    * also remove validate trait
    
    * remove validate_identity
    
    * refac identity status to allow more fine-grain control
    
    * remove unused trait
    
    * cargo check ok
    
    * remove indentity confirmation constraints
    
    * remove request from membership primitives
    
    * remove request_membership from lib.rs
    6b598084
    History
    refac membership (!215)
    Hugo Trentesaux authored
    * delete notes.txt file
    
    * update notes with links to issues
    
    * update comment according to #159
    
    * doc idtystatus in readme
    
    * update weightinfo and benchmarks accordingly
    
    * add benchmark
    
    * remove remove_identity_consumers
    
    * remove force_remove_identity call
    
    * fix todo in test
    
    * update doc
    
    - remove request_membership
    - remove validate_identity
    
    * fix tests according to new MembershipRemovalReason
    
    * add membership removal reasons
    
    and clean up membership internal functions
    
    * remove check_remove_identity
    
    * build live tests
    
    (but no current network to check them against)
    
    * clippy :man_facepalming:
    
    * add wot tests related to issue #136
    
    * refac certification creation checks
    
    * refac identity creation checks
    
    * test benchmark ok
    
    * more precise error messages
    
    * check benchmarks ok
    
    * cargo cucumber ok
    
    * cargo test workspace ok
    
    * cargo test workspace quasi ok
    
    * cargo check all tests
    
    * cargo check all
    
    * remove IdtyEvent change owner key
    
    * remove removal other reason
    
    * refac revocation and removal reason
    
    * wip
    
    * refac
    
    * refac scheduling (tests ok)
    
    * add *Period
    
    * cargo test identity ok
    
    * remove IdtyEvent::Validated
    
    * cargo test wot ok
    
    * cargo test wot ok
    
    (one fails but fot the good reason)
    
    * cargo test membership ok
    
    * cargo check wot tests
    
    * cargo check identity tests
    
    * cargo check membership tests
    
    * also remove validate trait
    
    * remove validate_identity
    
    * refac identity status to allow more fine-grain control
    
    * remove unused trait
    
    * cargo check ok
    
    * remove indentity confirmation constraints
    
    * remove request from membership primitives
    
    * remove request_membership from lib.rs

Duniter Pallet Conventions

Call

Custom Duniter pallet calls should adhere to the standard Substrate naming convention:

  • action_ for regular calls (e.g., create_identity).
  • force_action_ for calls with a privileged origin (e.g., force_set_distance_status).

Error

In the event of a call failure, it should trigger a pallet error with a self-explanatory name, for instance, IdtyNotFound.

Event

Successful calls should deposit a system event to notify external entities of the change. The event name should be self-explanatory and structured in the form of a Rust struct with named fields, ensuring clarity in autogenerated documentation. An example is:

IdtyRemoved {
    idty_index: T::IdtyIndex,
    reason: IdtyRemovalReason<T::IdtyRemovalOtherReason>,
}

Hook

Hooks are inherently infallible, and no errors should be emitted within them. To monitor progression from inside the hook, events can be employed to inform external entities about changes or no-changes.

Internal Function

Internal functions should adhere to the following naming convention:

  • do_action_ for regular functions executing the base logic of a call (e.g., do_remove_identity_). These functions should directly emit events and trigger errors as needed.
  • force_action_ for privileged functions that bypass any checks. This can be useful for specific benchmarking functions.
  • check_ for functions performing checks and triggering errors in case of failure.