-
Notifications
You must be signed in to change notification settings - Fork 5
Chain event handler #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chain event handler #444
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||||||||
|
The Qodo Merge tool is amazing, it Pointe to exactly the things I would too. |
mtbitcr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
crates/bcr-ebill-transport/src/handler/bill_chain_event_handler.rs
Outdated
Show resolved
Hide resolved
| BillEventType::BillAcceptanceRequested => "Bill should be accepted".to_string(), | ||
| BillEventType::BillAcceptanceRejected => "Bill acceptance has been rejected".to_string(), | ||
| BillEventType::BillAcceptanceTimeout => "Bill acceptance has taken too long".to_string(), | ||
| BillEventType::BillAcceptanceRecourse => "Bill in recourse should be accepted".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in recourse (both not accept and not paid) we always ask recoursee to pay. Not to accept
crates/bcr-ebill-transport/src/handler/bill_chain_event_handler.rs
Outdated
Show resolved
Hide resolved
| BillEventType::BillRecoursePaid => "Bill recourse has been paid".to_string(), | ||
| BillEventType::BillEndorsed => "Bill has been endorsed".to_string(), | ||
| BillEventType::BillSold => "Bill has been sold".to_string(), | ||
| BillEventType::BillMintingRequested => "Bill should be minted".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will see mint admin. SO text can be New request to mint or smth similar
| BillEventType::BillSold => "Bill has been sold".to_string(), | ||
| BillEventType::BillMintingRequested => "Bill should be minted".to_string(), | ||
| BillEventType::BillNewQuote => "New quote has been added".to_string(), | ||
| BillEventType::BillQuoteApproved => "Quote has been approved".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also will be quote expired and quote rejected
zupzup
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very, very nice! 🙌 Looking forward to full block propagation with Nostr!
User description
📝 Description
Replaces all Nostr notification sending that need to have bill block data attached with new BillChainEvent on call site. The only missing one is BillAction::Mint (which was not implemented before). The Nostr event processor has been replaced with a version that can handle BlockEvent data and keys in addition to Notifictations. Chains, blocks and keys are validated and persisted in the according stores.
Relates to #424
✅ 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, Tests
Description
Replaced
BillActionEventPayloadwithBillChainEventfor enhanced event handling.Introduced
BillChainEventHandlerto process blockchain-related notifications.Refactored notification service to support
BillChainEventand new event types.Updated tests to validate
BillChainEventintegration and event propagation.Changes walkthrough 📝
15 files
Refactored notification service to use `BillChainEvent`Added `BillChainEventHandler` for blockchain event processingIntegrated `BillChainEventHandler` into notification handlersAdded `BillEventType` for detailed event categorizationAdjusted Nostr notification handling for `BillChainEvent`Integrated `BillChainEventHandler` into notification serviceAdded `EventType` and updated event structureEnhanced `BillChainEvent` for participant-specific event generationRefactored event payloads for blockchain notificationsRefactored block action notifications to use `BillChainEvent`Updated bill signing to use `BillChainEvent`Updated notification service API for `BillChainEvent`Updated service context to include blockchain storesUpdated WASM context to support blockchain storesExported `BillChainEvent` and related types4 files
Updated tests to align with `BillChainEvent` changesUpdated mock implementations for `BillChainEvent`Enhanced test utilities for `BillChainEvent`Added utility for generating `BillKeys`1 files
Removed unused imports in notification API2 files