Skip to content

Commit

Permalink
Changed trait
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Jan 3, 2024
1 parent 0da2b11 commit 79a8a25
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 167 deletions.
24 changes: 5 additions & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

holochain-flake.url = "github:holochain/holochain";
holochain-flake.inputs.versions.follows = "versions";
holochain-flake.inputs.scaffolding.url = "github:holochain/scaffolding/develop";
# holochain-flake.inputs.scaffolding.url = "github:holochain/scaffolding/develop";

nixpkgs.follows = "holochain-flake/nixpkgs";
flake-parts.follows = "holochain-flake/flake-parts";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ edition = "2021"
[dependencies]
hdk = { workspace = true }
serde = "1"

hc_zome_traits = { git = "https://github.com/holochain-open-dev/zome-traits", branch = "main" }
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ pub struct HrlWithContext {
}

#[derive(Serialize, Deserialize, Debug)]
pub struct PendingNotification {
pub id: AnyDhtHash,
pub struct Notification {
pub title: String,
pub body: String,
// pub hrl_to_navigate_to_on_click: HrlWithContext,
pub hrl_to_navigate_to_on_click: HrlWithContext,
pub pending: bool,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GetNotificationInput {
notification_hash: AnyDhtHash,
locale: String,
}

#[zome_trait]
pub trait PendingNotifications {
fn get_pending_notifications(_: ()) -> ExternResult<Vec<PendingNotification>>;
fn get_notification(input: GetNotificationInput) -> ExternResult<Option<Notification>>;

fn emit_new_pending_notification(
pending_notification: PendingNotification,
Expand Down
19 changes: 0 additions & 19 deletions oldtests/Cargo.toml

This file was deleted.

117 changes: 0 additions & 117 deletions oldtests/tests/complex_flow.rs

This file was deleted.

8 changes: 1 addition & 7 deletions tests/src/complex-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ test('setup provider and recipient, and send a notification to it', async t => {
await Promise.race([
new Promise((_, reject) => setTimeout(() => reject(), 2000)),
new Promise(async resolve => {
// FCM provider zome sends signal
(provider.appAgentWs as AppAgentWebsocket).on('signal', signal => {
console.log(signal);
resolve(undefined);
Expand All @@ -112,13 +113,6 @@ test('setup provider and recipient, and send a notification to it', async t => {
});
}),
]);

// FCM provider zome sends signal
// Turn on recipient again
// assert.deepEqual(
// contentUpdate,
// cleanNodeDecoding(readUpdatedOutput1.entry)
// );
},
true,
{ timeout: 30000 }
Expand Down

0 comments on commit 79a8a25

Please sign in to comment.