Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Adds support for storage parameter types #6296

Merged
5 commits merged into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs
  • Loading branch information
bkchr committed Jun 11, 2020
commit 37c26c857be043b90590256ac1f7559a6569866a
5 changes: 4 additions & 1 deletion frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ pub enum Never {}
/// - Using `storage` to create a storage parameter type. This type is special as it tries to
/// load the value from the storage under a fixed key. If the value could not be found in the
/// storage, the given default value will be returned. It is required that the value implements
/// [`Encode`](codec::Encode) and [`Decode`](codec::Decode).
/// [`Encode`](codec::Encode) and [`Decode`](codec::Decode). The key for looking up the value
/// in the storage is build using the following formular:
bkchr marked this conversation as resolved.
Show resolved Hide resolved
///
/// `twox_128(":" ++ NAME ++ ":")` where `NAME` is the name that is passed as type name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have each module at twox_128(modulename) indeed having : prefixed and suffixed allow their name not to collide. looks fine but I wonder what is best.

///
/// # Examples
///
Expand Down
6 changes: 4 additions & 2 deletions frame/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down