Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: separate interface and service in
bls_aggr
(#363)
### What Changed? This PR refactors the BLS Aggregator by separating its interface from the internal service logic. - Add new struct `ServiceHandle` to serve as the interface for communicating with the BLS Aggregator service. This interface provides two new methods - `initialize_task`: Sends a message to the BLS Aggregator Service to initialize a new task. - `process_signature`: Sends a message to the BLS Aggregator Service to process a signature. - Add new struct `AggregateReceiver` to receive the aggregated responses from the BLS Aggregator Service. - Remove channels from `BlsAggregatorService` - Add new methods to `BlsAggregatorService`: - `start`: Starts the BLS Aggregator Service running the main loop in background. This method return a tuple with `ServiceHandle` and `AggregateReceiver`. User can use these methods to interact with the service. - `run`: Runs the main loop of the BLS Aggregator Service. - Remove `initialize_new_task` and `process_new_signature` functions since their logic is now integrated in `run()`. Close #257 ### Reviewer Checklist - [ ] New features are tested and documented - [ ] PR updates the changelog with a description of changes - [ ] PR has one of the `changelog-X` labels (if applies) - [ ] Code deprecates any old functionality before removing it --------- Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
- Loading branch information