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:
Bastian Köcher
2018-12-10 13:36:37 +01:00
committed by GitHub
parent 52ba9a5605
commit acf1b77bcd
17 changed files with 134 additions and 147 deletions
+1 -3
View File
@@ -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() {