mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Expose block number in seal_random (#8329)
* Allow contract callable functions to specify the module * Add new version of `seal_random` * Fix overlong lines * Fix benchmarking code * Update README.md * Replace Module by Pallet
This commit is contained in:
committed by
GitHub
parent
f9b6c869a3
commit
1f911ddb61
@@ -243,7 +243,7 @@ pub trait Ext: sealing::Sealed {
|
||||
fn tombstone_deposit(&self) -> BalanceOf<Self::T>;
|
||||
|
||||
/// Returns a random number for the current block with the given subject.
|
||||
fn random(&self, subject: &[u8]) -> SeedOf<Self::T>;
|
||||
fn random(&self, subject: &[u8]) -> (SeedOf<Self::T>, BlockNumberOf<Self::T>);
|
||||
|
||||
/// Deposit an event with the given topics.
|
||||
///
|
||||
@@ -845,10 +845,8 @@ where
|
||||
self.value_transferred
|
||||
}
|
||||
|
||||
fn random(&self, subject: &[u8]) -> SeedOf<T> {
|
||||
// TODO: change API to expose randomness freshness
|
||||
// https://github.com/paritytech/substrate/issues/8297
|
||||
T::Randomness::random(subject).0
|
||||
fn random(&self, subject: &[u8]) -> (SeedOf<T>, BlockNumberOf<T>) {
|
||||
T::Randomness::random(subject)
|
||||
}
|
||||
|
||||
fn now(&self) -> &MomentOf<T> {
|
||||
|
||||
Reference in New Issue
Block a user