mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +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:
@@ -49,7 +49,6 @@ extern crate parity_codec as codec;
|
||||
|
||||
use codec::HasCompact;
|
||||
use runtime_support::{StorageValue, Parameter};
|
||||
use runtime_support::dispatch::Result;
|
||||
use runtime_primitives::CheckInherentError;
|
||||
use runtime_primitives::traits::{
|
||||
As, SimpleArithmetic, Zero, ProvideInherent, Block as BlockT, Extrinsic
|
||||
@@ -75,7 +74,7 @@ decl_module! {
|
||||
/// if this call hasn't been invoked by that time.
|
||||
///
|
||||
/// The timestamp should be greater than the previous one by the amount specified by `block_period`.
|
||||
fn set(origin, now: <T::Moment as HasCompact>::Type) -> Result {
|
||||
fn set(origin, now: <T::Moment as HasCompact>::Type) {
|
||||
ensure_inherent(origin)?;
|
||||
let now = now.into();
|
||||
|
||||
@@ -91,7 +90,6 @@ decl_module! {
|
||||
);
|
||||
<Self as Store>::Now::put(now);
|
||||
<Self as Store>::DidUpdate::put(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn on_finalise() {
|
||||
|
||||
Reference in New Issue
Block a user