Skip to content

Commit

Permalink
refactor(gsys): fix signature of gr_random (#3376)
Browse files Browse the repository at this point in the history
  • Loading branch information
mertwole authored Sep 29, 2023
1 parent f9509f6 commit 1feb3d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gcore/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
4 changes: 2 additions & 2 deletions gsys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1feb3d2

Please sign in to comment.