mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Make decl_module not require a return type for functions (#1230)
If no return type is specified, `Result` is added and `Ok(())` is returned by default. Closes: #1182
This commit is contained in:
@@ -93,17 +93,15 @@ decl_module! {
|
||||
|
||||
/// Sets the session key of `_validator` to `_key`. This doesn't take effect until the next
|
||||
/// session.
|
||||
fn set_key(origin, key: T::SessionKey) -> Result {
|
||||
fn set_key(origin, key: T::SessionKey) {
|
||||
let who = ensure_signed(origin)?;
|
||||
// set new value for next session
|
||||
<NextKeyFor<T>>::insert(who, key);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Set a new session length. Won't kick in until the next session change (at current length).
|
||||
fn set_length(new: <T::BlockNumber as HasCompact>::Type) -> Result {
|
||||
fn set_length(new: <T::BlockNumber as HasCompact>::Type) {
|
||||
<NextSessionLength<T>>::put(new.into());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Forces a new session.
|
||||
|
||||
Reference in New Issue
Block a user