mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
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:
committed by
Bastian Köcher
parent
8f38593def
commit
2492931944
@@ -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()`
|
||||
|
||||
Reference in New Issue
Block a user