Identity chains#580
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for publishing public block events and invites for identity and company chains over Nostr, alongside extending the notification service API.
- Injects
notification_serviceintoContext,IdentityService, andCompanyService. - Defines new event types/modules (
identity_events,company_events,blockchain_event). - Extends
NotificationServiceApiwithadd_company_transport,send_identity_chain_events, andsend_company_chain_eventsand implements them inDefaultNotificationService.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/bcr-ebill-wasm/src/context.rs | Added notification_service clone to service constructors. |
| crates/bcr-ebill-transport/src/notification_service.rs | Extended NotificationServiceApi trait with company/identity chain methods. |
| crates/bcr-ebill-transport/src/event/blockchain_event.rs | Consolidated all block event types into a single module. |
| crates/bcr-ebill-transport/src/event/identity_events.rs | Added IdentityChainEvent definition. |
| crates/bcr-ebill-transport/src/event/company_events.rs | Added CompanyChainEvent definition. |
| crates/bcr-ebill-transport/src/event/mod.rs | Exposed new event modules/types. |
| crates/bcr-ebill-transport/src/handler/* | Updated handlers to use renamed event constructors. |
| crates/bcr-ebill-api/src/service/notification_service/default_service.rs | Implemented new chain event methods and refactored transport map. |
| crates/bcr-ebill-api/src/service/{identity,company}_service.rs | Populating and sending chain events after blocks. |
| crates/bcr-ebill-api/src/tests/mod.rs | Updated mocks for new methods on NotificationServiceApi. |
Comments suppressed due to low confidence (1)
crates/bcr-ebill-api/src/tests/mod.rs:376
- In this
impl NotificationServiceApi for NotificationServicein tests, the async function signatures end with semicolons and lack bodies. This will not compile; you need to provide function bodies or remove the incorrectimplblock.
async fn add_company_transport(&self, company: &Company, keys: &BcrKeys) -> bcr_ebill_transport::Result<()>;
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
User description
📝 Description
Publish public block messages for identity and company chains. Also publishes company chain invites in case a signatory has been added to a company.
Relates to #511 #513
✅ Checklist
Please ensure the following tasks are completed before requesting a review:
cargo fmt.cargo clippy.🚀 Changes Made
💡 How to Test
Please provide clear instructions on how reviewers can test your changes:
🤝 Related Issues
List any related issues, pull requests, or discussions:
📋 Review Guidelines
Please focus on the following while reviewing:
PR Type
Enhancement
Description
Publish public chain events for identity and company blockchains
Add dynamic Nostr transport creation for companies
Send company invite events to new signatories
Integrate notification service into identity and company services
Changes diagram
Changes walkthrough 📝
10 files
Integrate notification service for company chain eventsAdd identity chain event publishingImplement identity and company chain event handlersUpdate event creation method names for consistencyAdd identity and company blockchain event structuresCreate company chain event generatorCreate identity chain event generatorAdd new event types and creation methodsAdd notification service API for chain eventsInject notification service into identity and company services3 files
Reduce logging verbosity for metadata eventsUpdate import path for blockchain eventUpdate import path and event creation calls1 files
Add mock methods for new notification service APIs