Skip to content

Commit 41cad09

Browse files
authored
Merge pull request #40 from ewasm/abort-fn
Introduce "abort" function
2 parents 736af88 + 66c5347 commit 41cad09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,12 @@ pub fn returndata_size() -> usize {
565565
unsafe { native::ethereum_getReturnDataSize() as usize }
566566
}
567567

568+
/// Halts execution, reverts all changes to the state and consumes all gas.
569+
pub fn abort() -> ! {
570+
/// TODO: use assembly block with `unreachable`
571+
panic!()
572+
}
573+
568574
/// Halts execution and reverts all changes to the state.
569575
pub fn revert() -> ! {
570576
unsafe {

0 commit comments

Comments
 (0)