This commit is contained in:
Al Liu 2023-11-08 17:39:38 +08:00
parent e8799a24e4
commit 227533dded
No known key found for this signature in database
GPG Key ID: C8AE9A6E0166923E
1 changed files with 9 additions and 11 deletions

View File

@ -7,14 +7,11 @@ use nomos_core::{da::DaProtocol, wire};
use nomos_da::network::{adapters::libp2p::Libp2pAdapter, NetworkAdapter};
use nomos_network::{backends::libp2p::Libp2p, NetworkService};
use overwatch_derive::*;
use overwatch_rs::{
services::{
handle::{ServiceHandle, ServiceStateHandle},
relay::NoMessage,
state::*,
ServiceCore, ServiceData, ServiceId,
},
DynError,
use overwatch_rs::services::{
handle::{ServiceHandle, ServiceStateHandle},
relay::NoMessage,
state::*,
ServiceCore, ServiceData, ServiceId, ServiceError,
};
use reqwest::Url;
use serde::Serialize;
@ -139,11 +136,11 @@ impl ServiceData for DisseminateService {
#[async_trait::async_trait]
impl ServiceCore for DisseminateService {
fn init(service_state: ServiceStateHandle<Self>) -> Result<Self, DynError> {
fn init(service_state: ServiceStateHandle<Self>) -> Result<Self, ServiceError> {
Ok(Self { service_state })
}
async fn run(self) -> Result<(), DynError> {
async fn run(self) -> Result<(), ServiceError> {
let Self { service_state } = self;
let Settings {
payload,
@ -154,7 +151,8 @@ impl ServiceCore for DisseminateService {
output,
} = service_state.settings_reader.get_updated_settings();
let da_protocol: FullReplication<_> = da_protocol.try_into()?;
let da_protocol: Result<FullReplication<_>, _> = da_protocol.try_into();
let da_protocol = da_protocol.map_err(ServiceError::custom(e))?;
let network_relay = service_state
.overwatch_handle