Skip to content

Commit

Permalink
add cddl to notificationdata struct
Browse files Browse the repository at this point in the history
  • Loading branch information
darwinzer0 committed Oct 10, 2024
1 parent 746147b commit 8aed92d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/notification/src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ impl<T: NotificationData> Notification<T> {

pub trait NotificationData {
const CHANNEL_ID: &'static str;
const CDDL_SCHEMA: &'static str;
fn to_cbor(&self, api: &dyn Api) -> StdResult<Vec<u8>>;
fn channel_id(&self) -> String {
Self::CHANNEL_ID.to_string()
}
fn cddl_schema(&self) -> String {
Self::CDDL_SCHEMA.to_string()
}
}

#[derive(Serialize, Debug, Deserialize, Clone)]
Expand Down

0 comments on commit 8aed92d

Please sign in to comment.