Skip to content

Commit

Permalink
add skip_empty_output method to call intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Jul 5, 2024
1 parent aa26fb7 commit 4a8cb2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

- Add skip_empty_output intrinsic

## 0.5.20

- Accepts `-` character in expression's parsing expect at the beginning of the expression. (Ex: `-test` is failing, `test-8` is not)
Expand Down
1 change: 1 addition & 0 deletions substreams/src/externs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "env")]
extern "C" {
pub fn skip_empty_output();
pub fn output(ptr: *const u8, len: u32);
pub fn register_panic(
msg_ptr: *const u8,
Expand Down
8 changes: 8 additions & 0 deletions substreams/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ pub fn output<M: prost::Message>(msg: M) {
}
}

#[cfg_attr(not(target_arch = "wasm32"), allow(unused_variables))]
pub fn skip_empty_output() {
#[cfg(target_arch = "wasm32")]
unsafe {
externs::skip_empty_output()
}
}

#[cfg_attr(not(target_arch = "wasm32"), allow(unused_variables))]
pub fn output_raw(data: Vec<u8>) {
#[cfg(target_arch = "wasm32")]
Expand Down

0 comments on commit 4a8cb2d

Please sign in to comment.