Skip to content
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

162 move the repository module of the mediator coordination crate to a separate crate #170

2 changes: 1 addition & 1 deletion crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use thiserror::Error;
use mongodb::error::Error as MongoError;
/// A trait representing an abstract resource.
/// Any type implementing this trait should also implement `Serialize`.
pub trait Entity: Sized + Serialize {}
pub trait Entity: Sized + Serialize {}
ndefokou marked this conversation as resolved.
Show resolved Hide resolved

/// Definition of custom errors for repository operations
#[derive(Debug, Serialize, Deserialize, Error)]
Expand Down
2 changes: 1 addition & 1 deletion crates/plugins/mediator-coordination/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use mongodb::{ options::ClientOptions, Client, Database};
use std::sync::Arc;

use crate::{
repository::stateful::{MongoConnectionRepository, MongoSecretsRepository},
repository::stateful::{MongoConnectionRepository, MongoMessagesRepository, MongoSecretsRepository},
util,
web::{self, AppState, AppStateRepository},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use mongodb::{
};

use crate::{
model::stateful::entity::{Connection, Secrets},
model::stateful::entity::{Connection, RoutedMessage, Secrets},
};
ndefokou marked this conversation as resolved.
Show resolved Hide resolved

impl Entity for Connection {}
Expand Down
7 changes: 5 additions & 2 deletions crates/plugins/mediator-coordination/src/web/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ pub mod tests {

use crate::{
didcomm::bridge::LocalSecretsResolver,
repository::stateful::tests::{MockConnectionRepository, MockSecretsRepository},
repository::stateful::tests::{
MockConnectionRepository, MockMessagesRepository, MockSecretsRepository,
},
util::{self, MockFileSystem},
web::{self, AppStateRepository},
};
Expand All @@ -102,7 +104,7 @@ pub mod tests {
let repository = AppStateRepository {
connection_repository: Arc::new(MockConnectionRepository::from(vec![])),
secret_repository: Arc::new(MockSecretsRepository::from(vec![])),
message_repository: Arc::new(MockMessagesRepository::from(vec![])),
message_repository: Arc::new(MockMessagesRepository::from(vec![])), // Merged from origin
ndefokou marked this conversation as resolved.
Show resolved Hide resolved
};

let state = Arc::new(AppState::from(
Expand Down Expand Up @@ -191,6 +193,7 @@ pub mod tests {
}
}


#[cfg(test)]
mod tests2 {
use super::{tests as global, *};
Expand Down
3 changes: 1 addition & 2 deletions crates/plugins/mediator-coordination/src/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

use crate::{
didcomm::bridge::{LocalDIDResolver, LocalSecretsResolver},
model::stateful::entity::Connection,
model::stateful::entity::Secrets,
model::stateful::entity::{Connection, RoutedMessage, Secrets},
util,
};

Expand Down Expand Up @@ -49,7 +48,7 @@
pub struct AppStateRepository {
pub connection_repository: Arc<dyn Repository<Connection>>,
pub secret_repository: Arc<dyn Repository<Secrets>>,
pub message_repository: Arc<dyn Repository<RoutedMessage>>,

Check warning on line 51 in crates/plugins/mediator-coordination/src/web/mod.rs

View workflow job for this annotation

GitHub Actions / Build and Test

field `message_repository` is never read

Check warning on line 51 in crates/plugins/mediator-coordination/src/web/mod.rs

View workflow job for this annotation

GitHub Actions / Build and Test

field `message_repository` is never read
}

impl AppState {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.