Skip to content

Commit

Permalink
fix: gh actions tests should work again
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob committed Sep 28, 2023
1 parent 755e813 commit f7f394f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ rustdoc-args = ["--cfg", "docsrs"]

[workspace]
members = [".", "macros", "workspaces-tests", "workspaces-tests-utils"]

[profile.release]
codegen-units = 1
debug = false
lto = true
opt-level = "z"
overflow-checks = true
panic = "abort"
12 changes: 11 additions & 1 deletion src/standard/nep297.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,17 @@ where
fn to_event_string(&self) -> String {
format!(
"EVENT_JSON:{}",
serde_json::to_string(&self.to_event_log()).unwrap_or_else(|_| near_sdk::env::abort()),
serde_json::to_string(&self.to_event_log()).unwrap_or_else(|e| {
#[cfg(not(target_arch = "wasm32"))]
{
panic!("Failed to serialize event: {e}")
}

#[cfg(target_arch = "wasm32")]
{
near_sdk::env::panic_str(&format!("Failed to serialize event: {e}"))
}
}),
)
}

Expand Down

0 comments on commit f7f394f

Please sign in to comment.