Skip to content

Commit

Permalink
Remove asm block via function reuse (FuelLabs#2842)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfurfaro authored Sep 24, 2022
1 parent 3e00289 commit 93fd79d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sway-lib-std/src/block.sw
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ pub fn height() -> u64 {

/// Get the timestamp of the current block
pub fn timestamp() -> u64 {
let current_block_height = height();
asm(timestamp, height: current_block_height) {
time timestamp height;
timestamp: u64
}
timestamp_of_block(height())
}

/// Get the timestamp of block at height `block_height`
Expand Down

0 comments on commit 93fd79d

Please sign in to comment.