Skip to content

Commit

Permalink
contracts: add panik call to callcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Leegwater Simões committed Nov 21, 2023
1 parent 01446fb commit f2709cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contracts/callcenter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ impl Callcenter {
call_with_limit(contract, "spend", &(), points_limit)?;
Ok(())
}

/// Just panic.
pub fn panik(&self) {
panic!("panik");
}
}

/// Expose `Callcenter::query_counter()` to the host
Expand Down Expand Up @@ -159,3 +164,9 @@ unsafe fn delegate_transaction(arg_len: u32) -> u32 {
STATE.delegate_transaction(mod_id, rt)
})
}

/// Expose `Callcenter::panik()` to the host
#[no_mangle]
unsafe fn panik(arg_len: u32) -> u32 {
wrap_call(arg_len, |()| STATE.panik())
}

0 comments on commit f2709cc

Please sign in to comment.