diff --git a/piecrust-uplink/CHANGELOG.md b/piecrust-uplink/CHANGELOG.md index 3fae4cf4..d5bceb8a 100644 --- a/piecrust-uplink/CHANGELOG.md +++ b/piecrust-uplink/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `emit_raw` and `feed_raw` functions - Add `ContractError::DoesNotExist` variant +### Changed + +- Remove `'static` bound on `emit` topics + ## [0.16.0] - 2024-08-01 ### Added diff --git a/piecrust-uplink/src/abi/state.rs b/piecrust-uplink/src/abi/state.rs index 031c752f..5073587b 100644 --- a/piecrust-uplink/src/abi/state.rs +++ b/piecrust-uplink/src/abi/state.rs @@ -300,7 +300,7 @@ pub fn spent() -> u64 { } /// Emits an event with the given data, serializing it using [`rkyv`]. -pub fn emit(topic: &'static str, data: D) +pub fn emit(topic: &str, data: D) where for<'a> D: Serialize>, { @@ -322,7 +322,7 @@ where } /// Emits an event with the given data. -pub fn emit_raw(topic: &'static str, data: impl AsRef<[u8]>) { +pub fn emit_raw(topic: &str, data: impl AsRef<[u8]>) { with_arg_buf(|buf| { let data = data.as_ref();