compact param in calls (#1499)

* impl #[codec(compact)] for param

* update modules

* test all and build runtime

* Update srml/support/src/dispatch.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* Update srml/support/src/dispatch.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* delete wip comment

* update param to use #[compact] instead of Cmpact<>

* fmt

* impl metadata

* test metadata

* add compact attr test

* script buid

* update test
This commit is contained in:
thiolliere
2019-01-22 14:42:13 +01:00
committed by Bastian Köcher
parent 8f38593def
commit 2492931944
24 changed files with 576 additions and 541 deletions
+2 -3
View File
@@ -50,7 +50,6 @@ extern crate srml_system as system;
// might find it useful).
extern crate srml_balances as balances;
use codec::HasCompact;
use support::{StorageValue, dispatch::Result};
use system::ensure_signed;
@@ -178,9 +177,9 @@ decl_module! {
// without worrying about gameability or attack scenarios.
// If you not specify `Result` explicitly as return value, it will be added automatically
// for you and `Ok(())` will be returned.
fn set_dummy(new_value: <T::Balance as HasCompact>::Type) {
fn set_dummy(#[compact] new_value: T::Balance) {
// Put the new value into storage.
<Dummy<T>>::put(new_value.into());
<Dummy<T>>::put(new_value);
}
// The signature could also look like: `fn on_finalise()`