Skip to content

Commit 9ea232c

Browse files
authored
Ensure own identities are in Nostr contacts (#744)
1 parent 27c9e8a commit 9ea232c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

crates/bcr-ebill-api/src/service/company_service.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,10 @@ impl CompanyServiceApi for CompanyService {
10101010
.contact_transport()
10111011
.publish_contact(&company.id, &contact_data)
10121012
.await?;
1013+
self.transport_service
1014+
.contact_transport()
1015+
.ensure_nostr_contact(&company.id)
1016+
.await;
10131017
Ok(())
10141018
}
10151019
}
@@ -1378,6 +1382,7 @@ pub mod tests {
13781382
transport.expect_on_contact_transport(|t| {
13791383
// publishes contact info to nostr
13801384
t.expect_publish_contact().returning(|_, _| Ok(())).once();
1385+
t.expect_ensure_nostr_contact().returning(|_| ()).once();
13811386
});
13821387

13831388
company_chain_store
@@ -1518,6 +1523,7 @@ pub mod tests {
15181523
transport.expect_on_contact_transport(|t| {
15191524
// publishes contact info to nostr
15201525
t.expect_publish_contact().returning(|_, _| Ok(())).once();
1526+
t.expect_ensure_nostr_contact().returning(|_| ()).once();
15211527
});
15221528

15231529
let node_id_clone = node_id.clone();

crates/bcr-ebill-api/src/service/identity_service.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,10 @@ impl IdentityServiceApi for IdentityService {
751751
.contact_transport()
752752
.publish_contact(&identity.node_id, &contact_data)
753753
.await?;
754+
self.block_transport
755+
.contact_transport()
756+
.ensure_nostr_contact(&identity.node_id)
757+
.await;
754758
Ok(())
755759
}
756760
}
@@ -816,6 +820,7 @@ mod tests {
816820
transport.expect_on_contact_transport(|t| {
817821
// publishes contact info to nostr
818822
t.expect_publish_contact().returning(|_, _| Ok(())).once();
823+
t.expect_ensure_nostr_contact().returning(|_| ()).once();
819824
});
820825

821826
let service = get_service_with_chain_storage(storage, chain_storage, transport);
@@ -860,6 +865,7 @@ mod tests {
860865
});
861866
transport.expect_on_contact_transport(|t| {
862867
t.expect_publish_contact().returning(|_, _| Ok(())).once();
868+
t.expect_ensure_nostr_contact().returning(|_| ()).once();
863869
});
864870

865871
// publishes contact info to nostr
@@ -924,6 +930,7 @@ mod tests {
924930
// publishes contact info to nostr
925931
transport.expect_on_contact_transport(|t| {
926932
t.expect_publish_contact().returning(|_, _| Ok(())).once();
933+
t.expect_ensure_nostr_contact().returning(|_| ()).once();
927934
});
928935

929936
let service = get_service_with_chain_storage(storage, chain_storage, transport);
@@ -1079,6 +1086,7 @@ mod tests {
10791086
transport.expect_on_contact_transport(|t| {
10801087
// publishes contact info to nostr
10811088
t.expect_publish_contact().returning(|_, _| Ok(())).once();
1089+
t.expect_ensure_nostr_contact().returning(|_| ()).once();
10821090
});
10831091

10841092
let service = get_service_with_chain_storage(storage, chain_storage, transport);

0 commit comments

Comments
 (0)