Skip to content

Commit

Permalink
Update docs (#2143)
Browse files Browse the repository at this point in the history
* TODOs

* fix messages pallet docs

* update code comments

---------

Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
  • Loading branch information
bkontur and svyatonik committed May 15, 2024
1 parent 3a20232 commit 0d3df54
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bridges/modules/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub mod pallet {
/// Pallet owner has the right to halt all pallet operations and then resume it. If it is
/// `None`, then there are no direct ways to halt/resume pallet operations, but other
/// runtime methods may still be used to do that (i.e. `democracy::referendum` to update halt
/// flag directly or calling `halt_operations`).
/// flag directly or calling `set_operating_mode`).
#[pallet::storage]
pub type PalletOwner<T: Config<I>, I: 'static = ()> =
StorageValue<_, T::AccountId, OptionQuery>;
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ pub mod pallet {
/// Pallet owner has a right to halt all pallet operations and then resume it. If it is
/// `None`, then there are no direct ways to halt/resume pallet operations, but other
/// runtime methods may still be used to do that (i.e. democracy::referendum to update halt
/// flag directly or call the `halt_operations`).
/// flag directly or call the `set_operating_mode`).
#[pallet::storage]
pub type PalletOwner<T: Config<I>, I: 'static = ()> =
StorageValue<_, T::AccountId, OptionQuery>;
Expand Down
12 changes: 7 additions & 5 deletions bridges/modules/messages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ There may be a special account in every runtime where the messages module is dep
owner', is like a module-level sudo account - he's able to halt and resume all module operations without requiring
runtime upgrade. Calls that are related to this account are:
- `fn set_owner()`: current module owner may call it to transfer "ownership" to another account;
- `fn halt_operations()`: the module owner (or sudo account) may call this function to stop all module operations. After
this call, all message-related transactions will be rejected until further `resume_operations` call'. This call may be
used when something extraordinary happens with the bridge;
- `fn resume_operations()`: module owner may call this function to resume bridge operations. The module will resume its
regular operations after this call.
- `fn set_operating_mode()`: the module owner (or sudo account) may call this function to pause/resume
pallet operations. Owner may halt the pallet by calling this method with
`MessagesOperatingMode::Basic(BasicOperatingMode::Halted)` argument - all message-related
transactions will be rejected. Owner may then resume pallet operations by passing the
`MessagesOperatingMode::Basic(BasicOperatingMode::Normal)` argument. There's also
`MessagesOperatingMode::RejectingOutboundMessages` pallet mode, where it still accepts all incoming
messages, but all outbound messages are rejected.

If pallet owner is not defined, the governance may be used to make those calls.

Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ pub mod pallet {
/// Pallet owner has a right to halt all pallet operations and then resume it. If it is
/// `None`, then there are no direct ways to halt/resume pallet operations, but other
/// runtime methods may still be used to do that (i.e. democracy::referendum to update halt
/// flag directly or call the `halt_operations`).
/// flag directly or call the `set_operating_mode`).
#[pallet::storage]
#[pallet::getter(fn module_owner)]
pub type PalletOwner<T: Config<I>, I: 'static = ()> = StorageValue<_, T::AccountId>;
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/parachains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pub mod pallet {
/// Pallet owner has a right to halt all pallet operations and then resume them. If it is
/// `None`, then there are no direct ways to halt/resume pallet operations, but other
/// runtime methods may still be used to do that (i.e. democracy::referendum to update halt
/// flag directly or call the `halt_operations`).
/// flag directly or call the `set_operating_mode`).
#[pallet::storage]
pub type PalletOwner<T: Config<I>, I: 'static = ()> =
StorageValue<_, T::AccountId, OptionQuery>;
Expand Down

0 comments on commit 0d3df54

Please sign in to comment.