Harmonize and document events errors and calls
-
Review changes -
-
Download -
Patches
-
Plain diff
Refactoring pallets to adhere to the following guidelines:
Call
Custom Duniter pallet calls should adhere to the standard Substrate naming convention:
-
action_
for regular calls (e.g.,create_identity
). -
force_
for calls with a privileged origin (e.g.,force_remove_identity
).
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.
Merge request reports
- version 364a07ce01
- version 35f4ee2da0
- version 34e93d7bb6
- version 33d1546036
- version 32b8793414
- version 31e3062e39
- version 3091c24620
- version 292e6fa77d
- version 282b7cdefc
- version 2730de45a3
- version 268671c861
- version 25de534f42
- version 240e36dedd
- version 231311d350
- version 222e9f888c
- version 2196a1d6f0
- version 20afcbe192
- version 199957abf1
- version 18010c1bf2
- version 17f443567d
- version 16e2f99760
- version 1585c5c6fe
- version 14a662a4cb
- version 13759661ad
- version 12ea0eb97c
- version 11b5e5e89d
- version 10b5986aaf
- version 9bc72ebee
- version 8a1a14331
- version 7fff2bc79
- version 6f33a327e
- version 5f76c9fe2
- version 4053ce7e8
- version 39c27231c
- version 2a2e13377
- version 119c90538
- master (base)
- latest versiond6f026b332 commits,
- version 364a07ce0132 commits,
- version 35f4ee2da031 commits,
- version 34e93d7bb631 commits,
- version 33d154603630 commits,
- version 32b879341430 commits,
- version 31e3062e3929 commits,
- version 3091c2462028 commits,
- version 292e6fa77d27 commits,
- version 282b7cdefc26 commits,
- version 2730de45a326 commits,
- version 268671c86126 commits,
- version 25de534f4225 commits,
- version 240e36dedd24 commits,
- version 231311d35023 commits,
- version 222e9f888c23 commits,
- version 2196a1d6f023 commits,
- version 20afcbe19222 commits,
- version 199957abf121 commits,
- version 18010c1bf221 commits,
- version 17f443567d20 commits,
- version 16e2f9976019 commits,
- version 1585c5c6fe19 commits,
- version 14a662a4cb18 commits,
- version 13759661ad17 commits,
- version 12ea0eb97c16 commits,
- version 11b5e5e89d15 commits,
- version 10b5986aaf12 commits,
- version 9bc72ebee6 commits,
- version 8a1a143315 commits,
- version 7fff2bc792 commits,
- version 6f33a327e2 commits,
- version 5f76c9fe21 commit,
- version 4053ce7e81 commit,
- version 39c27231c1 commit,
- version 2a2e133771 commit,
- version 119c905381 commit,
- Side-by-side
- Inline