Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for u8 to be used as hold/freeze reason #5348

Merged
merged 7 commits into from
Aug 15, 2024
Merged
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
4 changes: 4 additions & 0 deletions substrate/frame/support/src/traits/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ impl VariantCount for () {
const VARIANT_COUNT: u32 = 0;
}

impl VariantCount for u8 {
const VARIANT_COUNT: u32 = 256;
}
kianenigma marked this conversation as resolved.
Show resolved Hide resolved

/// Adapter for `Get<u32>` to access `VARIANT_COUNT` from `trait pub trait VariantCount {`.
pub struct VariantCountOf<T: VariantCount>(core::marker::PhantomData<T>);
impl<T: VariantCount> Get<u32> for VariantCountOf<T> {
Expand Down
Loading