Struct noble_randomness_collective_flip::Module[][src]

pub struct Module<T: Config>(_);


impl<T: Config + 'static> Module<T>[src]

pub fn random_material() -> Vec<T::Hash>[src]

Series of block headers from the last 81 blocks that acts as random seed material. This is arranged as a ring buffer with block_number % 81 being the index into the Vec of the oldest hash.

Trait Implementations

impl<T: Config> Callable<T> for Module<T>[src]

type Call = Call<T>

impl<T: Clone + Config> Clone for Module<T>[src]

impl<T: Copy + Config> Copy for Module<T>[src]

impl<T: Config> Debug for Module<T> where
    T: Debug

impl<T: Eq + Config> Eq for Module<T>[src]

impl<T: Config> GetNobleVersion for Module<T>[src]

impl<T: Config> IntegrityTest for Module<T>[src]

impl<T: Config> ModuleErrorMetadata for Module<T>[src]

impl<T: Config> OffchainWorker<<T as Config>::BlockNumber> for Module<T>[src]

impl<T: Config> OnFinalize<<T as Config>::BlockNumber> for Module<T>[src]

impl<T: Config> OnGenesis for Module<T>[src]

impl<T: Config> OnInitialize<<T as Config>::BlockNumber> for Module<T>[src]

impl<T: Config> OnRuntimeUpgrade for Module<T>[src]

impl<T: PartialEq + Config> PartialEq<Module<T>> for Module<T>[src]

impl<T: Config> Randomness<<T as Config>::Hash> for Module<T>[src]

fn random(subject: &[u8]) -> T::Hash[src]

This randomness uses a low-influence function, drawing upon the block hashes from the previous 81 blocks. Its result for any given subject will be known far in advance by anyone observing the chain. Any block producer has significant influence over their block hashes bounded only by their computational resources. Our low-influence function reduces the actual block producer’s influence over the randomness, but increases the influence of small colluding groups of recent block producers.

WARNING: Hashing the result of this function will remove any low-influence properties it has and mean that all bits of the resulting value are entirely manipulatable by the author of the parent block, who can determine the value of parent_hash.

impl<T: Config> StructuralEq for Module<T>[src]

impl<T: Config> StructuralPartialEq for Module<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Module<T> where
    T: RefUnwindSafe

impl<T> Send for Module<T> where
    T: Send

impl<T> Sync for Module<T> where
    T: Sync

impl<T> Unpin for Module<T> where
    T: Unpin

impl<T> UnwindSafe for Module<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> CheckedConversion for T[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> DynClone for T where
    T: Clone

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> IsType<T> for T[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 

pub fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Member for T where
    T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,