Adds support for storage parameter types (#6296)

* Adds support for storage parameter types

This pr adds a new parameter types type, the storage parameter types.
This parameter type supports loading the value from the storage or
returning the given default value.

* Use twox_128

* Update docs

* Update frame/support/src/lib.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
This commit is contained in:
Bastian Köcher
2020-06-12 00:46:30 +02:00
committed by GitHub
parent b0a4456988
commit 5b3242643b
2 changed files with 105 additions and 20 deletions
+4 -2
View File
@@ -450,9 +450,11 @@ impl<T: IntoIterator + Clone,> Len for T where <T as IntoIterator>::IntoIter: Ex
}
}
/// A trait for querying a single fixed value from a type.
/// A trait for querying a single value from a type.
///
/// It is not required that the value is constant.
pub trait Get<T> {
/// Return a constant value.
/// Return the current value.
fn get() -> T;
}