diff --git a/gcore/src/exec.rs b/gcore/src/exec.rs index b214be27f1e..84e1c65d7f1 100644 --- a/gcore/src/exec.rs +++ b/gcore/src/exec.rs @@ -452,7 +452,7 @@ pub fn pay_program_rent(program_id: ActorId, value: u128) -> Result<(u128, u32)> pub fn random(subject: [u8; 32]) -> Result<([u8; 32], u32)> { let mut res: BlockNumberWithHash = Default::default(); - unsafe { gsys::gr_random(subject.as_ptr(), res.as_mut_ptr()) }; + unsafe { gsys::gr_random(&subject, res.as_mut_ptr()) }; Ok((res.hash, res.bn)) } diff --git a/gsys/src/lib.rs b/gsys/src/lib.rs index e3165248b78..1ed2e672116 100644 --- a/gsys/src/lib.rs +++ b/gsys/src/lib.rs @@ -467,9 +467,9 @@ extern "C" { /// Infallible `gr_random` calculate syscall. /// /// Arguments type: - /// - `subject`: `const ptr` for the begging of the payload buffer. + /// - `subject`: `const ptr` for the subject. /// - `bn_random`: `mut ptr` for concatenated block number with hash. - pub fn gr_random(subject: *const BufferStart, bn_random: *mut BlockNumberWithHash); + pub fn gr_random(subject: *const Hash, bn_random: *mut BlockNumberWithHash); // TODO: issue #1859 /// Fallible `gr_read` get syscall.