diff --git a/cli/src/action/circuit/api.rs b/cli/src/action/circuit/api.rs index 47d34ff05..41300920b 100644 --- a/cli/src/action/circuit/api.rs +++ b/cli/src/action/circuit/api.rs @@ -240,7 +240,7 @@ impl SplinterRestClient { } } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct CircuitSlice { pub id: String, pub members: Vec, @@ -321,7 +321,7 @@ impl fmt::Display for CircuitSlice { } } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct CircuitServiceSlice { pub service_id: String, pub service_type: String, @@ -329,13 +329,13 @@ pub struct CircuitServiceSlice { pub arguments: BTreeMap, } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct CircuitListSlice { pub data: Vec, pub paging: Paging, } -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)] pub struct ProposalSlice { pub proposal_type: String, pub circuit_id: String, @@ -433,7 +433,7 @@ impl fmt::Display for ProposalSlice { } } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct ProposalCircuitSlice { pub circuit_id: String, pub members: Vec, @@ -445,14 +445,14 @@ pub struct ProposalCircuitSlice { pub circuit_status: Option, } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct CircuitMembers { pub node_id: String, pub endpoints: Vec, pub public_key: Option, } -#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] +#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq)] pub struct CircuitService { pub service_id: String, pub service_type: String, @@ -460,7 +460,7 @@ pub struct CircuitService { pub arguments: Vec>, } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct ProposalListSlice { pub data: Vec, pub paging: Paging, @@ -473,7 +473,7 @@ pub struct VoteRecord { pub voter_node_id: String, } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct Paging { pub current: String, pub offset: usize, diff --git a/cli/src/action/database/stores.rs b/cli/src/action/database/stores.rs index 48bf42f90..928d59105 100644 --- a/cli/src/action/database/stores.rs +++ b/cli/src/action/database/stores.rs @@ -59,11 +59,11 @@ pub trait UpgradeStores { fn new_state_tree_store<'a>(&'a self) -> Box; } +type InTransactionHandle<'a> = + Box Result<(), InternalError> + 'a>; + pub trait TransactionalUpgradeStores: UpgradeStores { - fn in_transaction<'a>( - &self, - f: Box Result<(), InternalError> + 'a>, - ) -> Result<(), InternalError>; + fn in_transaction(&self, f: InTransactionHandle<'_>) -> Result<(), InternalError>; fn as_upgrade_stores(&self) -> &dyn UpgradeStores; } diff --git a/cli/src/action/database/upgrade/node_id.rs b/cli/src/action/database/upgrade/node_id.rs index 24b95c1f2..50fd32bfc 100644 --- a/cli/src/action/database/upgrade/node_id.rs +++ b/cli/src/action/database/upgrade/node_id.rs @@ -70,7 +70,7 @@ pub fn migrate_node_id_to_db( "Importing node_id from {} to database", filename.to_string_lossy() ); - let result = import_store(&*db_store, &file_store); + let result = import_store(db_store, &file_store); if let Ok(WarningEmitted::No) = result { info!( diff --git a/libsplinter/src/admin/client/event/error.rs b/libsplinter/src/admin/client/event/error.rs index eb1881342..42ed9d9f7 100644 --- a/libsplinter/src/admin/client/event/error.rs +++ b/libsplinter/src/admin/client/event/error.rs @@ -36,7 +36,7 @@ impl Error for NextEventError { fn source(&self) -> Option<&(dyn Error + 'static)> { match self { NextEventError::Disconnected => None, - NextEventError::InternalError(ref e) => Some(&*e), + NextEventError::InternalError(ref e) => Some(e), } } } @@ -60,7 +60,7 @@ impl Error for WaitForError { fn source(&self) -> Option<&(dyn Error + 'static)> { match self { WaitForError::TimeoutError => None, - WaitForError::NextEventError(ref e) => Some(&*e), + WaitForError::NextEventError(ref e) => Some(e), } } } diff --git a/libsplinter/src/admin/client/event/mod.rs b/libsplinter/src/admin/client/event/mod.rs index e48adb0d2..dab79fa46 100644 --- a/libsplinter/src/admin/client/event/mod.rs +++ b/libsplinter/src/admin/client/event/mod.rs @@ -31,7 +31,7 @@ pub use ws::actix_web_client::{ }; /// A public key for the private key that signed an admin proposal. -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Eq)] #[repr(transparent)] pub struct PublicKey(pub Vec); @@ -55,7 +55,7 @@ pub struct AdminServiceEvent { /// The event type. /// /// Some variants include a public key, that is associated with the particular event. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum EventType { ProposalSubmitted, ProposalVote { requester: PublicKey }, diff --git a/libsplinter/src/admin/client/mod.rs b/libsplinter/src/admin/client/mod.rs index 02590a8a3..0bdd80e22 100644 --- a/libsplinter/src/admin/client/mod.rs +++ b/libsplinter/src/admin/client/mod.rs @@ -29,7 +29,7 @@ use crate::error::InternalError; #[cfg(feature = "client-reqwest")] pub use self::reqwest::ReqwestAdminServiceClient; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Paging { pub current: String, pub offset: usize, @@ -41,7 +41,7 @@ pub struct Paging { pub last: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CircuitServiceSlice { pub service_id: String, pub service_type: String, @@ -49,7 +49,7 @@ pub struct CircuitServiceSlice { pub arguments: BTreeMap, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CircuitSlice { pub id: String, pub members: Vec, @@ -58,20 +58,20 @@ pub struct CircuitSlice { pub display_name: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CircuitListSlice { pub data: Vec, pub paging: Paging, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CircuitMembers { pub node_id: String, pub endpoints: Vec, pub public_key: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct CircuitService { pub service_id: String, pub service_type: String, @@ -79,7 +79,7 @@ pub struct CircuitService { pub arguments: Vec>, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ProposalCircuitSlice { pub circuit_id: String, pub members: Vec, @@ -89,14 +89,14 @@ pub struct ProposalCircuitSlice { pub display_name: Option, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct VoteRecord { pub public_key: String, pub vote: String, pub voter_node_id: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ProposalSlice { pub proposal_type: String, pub circuit_id: String, @@ -107,7 +107,7 @@ pub struct ProposalSlice { pub requester_node_id: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ProposalListSlice { pub data: Vec, pub paging: Paging, diff --git a/libsplinter/src/admin/service/shared.rs b/libsplinter/src/admin/service/shared.rs index 91e944326..3d55f10d0 100644 --- a/libsplinter/src/admin/service/shared.rs +++ b/libsplinter/src/admin/service/shared.rs @@ -63,7 +63,7 @@ pub enum PayloadType { Consensus(ProposalId, (Proposal, CircuitManagementPayload)), } -#[derive(PartialEq, Clone, Copy)] +#[derive(PartialEq, Eq, Clone, Copy)] pub enum AdminServiceStatus { NotRunning, Running, diff --git a/libsplinter/src/admin/store/diesel/models.rs b/libsplinter/src/admin/store/diesel/models.rs index 2a12421d5..bf59c7d8e 100644 --- a/libsplinter/src/admin/store/diesel/models.rs +++ b/libsplinter/src/admin/store/diesel/models.rs @@ -49,7 +49,9 @@ use crate::error::{InternalError, InvalidStateError}; use crate::public_key::PublicKey; /// Database model representation of a `CircuitProposal` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "circuit_proposal"] #[primary_key(circuit_id)] pub struct CircuitProposalModel { @@ -73,7 +75,9 @@ impl From<&CircuitProposal> for CircuitProposalModel { } /// Database model representation of a `ProposedCircuit` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "proposed_circuit"] #[belongs_to(CircuitProposalModel, foreign_key = "circuit_id")] #[primary_key(circuit_id)] @@ -110,7 +114,9 @@ impl From<&ProposedCircuit> for ProposedCircuitModel { } /// Database model representation of a `VoteRecord` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "vote_record"] #[belongs_to(CircuitProposalModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, voter_node_id)] @@ -160,7 +166,9 @@ impl TryFrom<&VoteRecordModel> for VoteRecord { } /// Database model representation of a `ProposedNode` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "proposed_node"] #[belongs_to(ProposedCircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, node_id)] @@ -199,7 +207,9 @@ impl TryFrom<&ProposedCircuit> for Vec { } /// Database model representation of the endpoint values associated with a `ProposedNode` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "proposed_node_endpoint"] #[belongs_to(ProposedCircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, node_id, endpoint)] @@ -240,7 +250,9 @@ impl TryFrom<&ProposedCircuit> for Vec { } /// Database model representation of a `ProposedService` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "proposed_service"] #[belongs_to(ProposedCircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, service_id)] @@ -278,7 +290,9 @@ impl TryFrom<&ProposedCircuit> for Vec { } /// Database model representation of the arguments associated with a `ProposedService` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "proposed_service_argument"] #[belongs_to(ProposedCircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, service_id, key)] @@ -323,7 +337,9 @@ impl TryFrom<&ProposedCircuit> for Vec { } /// Database model representation of `Service` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "service"] #[belongs_to(CircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, service_id)] @@ -361,7 +377,9 @@ impl TryFrom<&Circuit> for Vec { } /// Database model representation of the arguments in a `Service` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "service_argument"] #[belongs_to(CircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, service_id, key)] @@ -405,7 +423,9 @@ impl TryFrom<&Circuit> for Vec { } /// Database model representation of a `Circuit` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "circuit"] #[primary_key(circuit_id)] pub struct CircuitModel { @@ -437,7 +457,9 @@ impl From<&Circuit> for CircuitModel { } /// Database model representation of the `members` of a `Circuit` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "circuit_member"] #[belongs_to(CircuitModel, foreign_key = "circuit_id")] #[primary_key(circuit_id, node_id)] @@ -476,7 +498,9 @@ impl TryFrom<&Circuit> for Vec { } /// Database model representation of the endpoint values associated with a `Circuit` member `node_id` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "node_endpoint"] #[primary_key(node_id, endpoint)] pub struct NodeEndpointModel { @@ -485,7 +509,9 @@ pub struct NodeEndpointModel { } /// Database model representation of an `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_service_event"] #[primary_key(id)] pub struct AdminServiceEventModel { @@ -494,7 +520,7 @@ pub struct AdminServiceEventModel { pub data: Option>, } -#[derive(AsChangeset, Insertable, PartialEq, Debug)] +#[derive(AsChangeset, Insertable, PartialEq, Eq, Debug)] #[table_name = "admin_service_event"] pub struct NewAdminServiceEventModel<'a> { pub event_type: &'a str, @@ -502,7 +528,9 @@ pub struct NewAdminServiceEventModel<'a> { } /// Database model representation of a `CircuitProposal` from an `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_circuit_proposal"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id)] @@ -529,7 +557,9 @@ impl From<(i64, &messages::CircuitProposal)> for AdminEventCircuitProposalModel } /// Database model representation of a `CreateCircuit` from an `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_proposed_circuit"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id)] @@ -574,7 +604,9 @@ impl From<(i64, &CreateCircuit)> for AdminEventProposedCircuitModel { } /// Database model representation of a `VoteRecord` from an `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_vote_record"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id, voter_node_id)] @@ -634,7 +666,9 @@ impl TryFrom<&AdminEventVoteRecordModel> for VoteRecord { } /// Database model representation of a `AdminEventProposedNode` from an `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_proposed_node"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id, node_id)] @@ -673,7 +707,9 @@ impl AdminEventProposedNodeModel { /// Database model representation of the endpoint values associated with a `ProposedNode` from an /// `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_proposed_node_endpoint"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id, node_id, endpoint)] @@ -717,7 +753,9 @@ impl AdminEventProposedNodeEndpointModel { } /// Database model representation of a `ProposedService` from an `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_proposed_service"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id, service_id)] @@ -770,7 +808,9 @@ impl AdminEventProposedServiceModel { /// Database model representation of the arguments associated with a `ProposedService` from an /// `AdminServiceEvent` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "admin_event_proposed_service_argument"] #[belongs_to(AdminServiceEventModel, foreign_key = "event_id")] #[primary_key(event_id, service_id, key)] @@ -1100,7 +1140,7 @@ impl From<&messages::RouteType> for String { } #[repr(i16)] -#[derive(Debug, Copy, Clone, PartialEq, FromSqlRow)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, FromSqlRow)] pub enum CircuitStatusModel { Active = 1, Disbanded = 2, diff --git a/libsplinter/src/admin/token/mod.rs b/libsplinter/src/admin/token/mod.rs index d1a35f463..37d873182 100644 --- a/libsplinter/src/admin/token/mod.rs +++ b/libsplinter/src/admin/token/mod.rs @@ -23,7 +23,7 @@ use crate::error::InvalidStateError; use crate::peer::{PeerAuthorizationToken, PeerTokenPair}; /// Struct used to correlate a `PeerAuthorizationToken` with node information -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct PeerNode { pub token: PeerAuthorizationToken, pub node_id: String, diff --git a/libsplinter/src/biome/credentials/store/diesel/models.rs b/libsplinter/src/biome/credentials/store/diesel/models.rs index d71cb6bdf..9ea79cac7 100644 --- a/libsplinter/src/biome/credentials/store/diesel/models.rs +++ b/libsplinter/src/biome/credentials/store/diesel/models.rs @@ -14,7 +14,7 @@ use super::schema::user_credentials; -#[derive(Queryable, Identifiable, Associations, PartialEq, Debug)] +#[derive(Queryable, Identifiable, Associations, PartialEq, Eq, Debug)] #[table_name = "user_credentials"] pub struct CredentialsModel { pub id: i64, @@ -23,7 +23,7 @@ pub struct CredentialsModel { pub password: String, } -#[derive(Insertable, PartialEq, Debug)] +#[derive(Insertable, PartialEq, Eq, Debug)] #[table_name = "user_credentials"] pub struct NewCredentialsModel { pub user_id: String, diff --git a/libsplinter/src/biome/credentials/store/mod.rs b/libsplinter/src/biome/credentials/store/mod.rs index 076f79a3a..6baf202f0 100644 --- a/libsplinter/src/biome/credentials/store/mod.rs +++ b/libsplinter/src/biome/credentials/store/mod.rs @@ -33,7 +33,7 @@ const MEDIUM_COST: u32 = 8; const LOW_COST: u32 = 4; /// Represents crendentials used to authenticate a user -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Credentials { pub user_id: String, pub username: String, @@ -53,7 +53,7 @@ impl Credentials { } /// Represents a user's username -#[derive(Debug, PartialEq, Deserialize, Serialize)] +#[derive(Debug, PartialEq, Eq, Deserialize, Serialize)] pub struct UsernameId { pub username: String, pub user_id: String, diff --git a/libsplinter/src/biome/key_management/mod.rs b/libsplinter/src/biome/key_management/mod.rs index 0e8b9cd36..7e15c6d0f 100644 --- a/libsplinter/src/biome/key_management/mod.rs +++ b/libsplinter/src/biome/key_management/mod.rs @@ -20,7 +20,7 @@ pub mod store; use store::diesel::models::KeyModel; /// Represents a public and private key pair -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Key { pub public_key: String, pub encrypted_private_key: String, diff --git a/libsplinter/src/biome/key_management/store/diesel/models.rs b/libsplinter/src/biome/key_management/store/diesel/models.rs index 14b5e5209..711bce6f0 100644 --- a/libsplinter/src/biome/key_management/store/diesel/models.rs +++ b/libsplinter/src/biome/key_management/store/diesel/models.rs @@ -14,7 +14,7 @@ use super::schema::keys; -#[derive(Insertable, Queryable, Identifiable, PartialEq, Debug)] +#[derive(Insertable, Queryable, Identifiable, PartialEq, Eq, Debug)] #[table_name = "keys"] #[primary_key(public_key, user_id)] pub struct KeyModel { diff --git a/libsplinter/src/biome/oauth/store/diesel/models.rs b/libsplinter/src/biome/oauth/store/diesel/models.rs index 1a35fa29b..a235d9818 100644 --- a/libsplinter/src/biome/oauth/store/diesel/models.rs +++ b/libsplinter/src/biome/oauth/store/diesel/models.rs @@ -16,7 +16,7 @@ use crate::biome::oauth::store::{InsertableOAuthUserSession, OAuthUser}; use super::schema::{oauth_user_sessions, oauth_users}; -#[derive(Debug, PartialEq, Identifiable, Insertable, Queryable)] +#[derive(Debug, PartialEq, Eq, Identifiable, Insertable, Queryable)] #[table_name = "oauth_users"] #[primary_key(subject)] pub struct OAuthUserModel { @@ -24,7 +24,7 @@ pub struct OAuthUserModel { pub user_id: String, } -#[derive(Debug, PartialEq, Associations, Identifiable, Queryable)] +#[derive(Debug, PartialEq, Eq, Associations, Identifiable, Queryable)] #[table_name = "oauth_user_sessions"] #[belongs_to(OAuthUserModel, foreign_key = "subject")] #[primary_key(splinter_access_token)] @@ -36,7 +36,7 @@ pub struct OAuthUserSessionModel { pub last_authenticated: i64, } -#[derive(Debug, PartialEq, Insertable)] +#[derive(Debug, PartialEq, Eq, Insertable)] #[table_name = "oauth_user_sessions"] pub struct InsertableOAuthUserSessionModel { pub splinter_access_token: String, diff --git a/libsplinter/src/biome/profile/store/diesel/models.rs b/libsplinter/src/biome/profile/store/diesel/models.rs index 172f75770..f3e0d3593 100644 --- a/libsplinter/src/biome/profile/store/diesel/models.rs +++ b/libsplinter/src/biome/profile/store/diesel/models.rs @@ -16,7 +16,7 @@ use crate::biome::profile::store::Profile; use super::schema::user_profile; -#[derive(Insertable, Queryable, Identifiable, Associations, PartialEq, Debug)] +#[derive(Insertable, Queryable, Identifiable, Associations, PartialEq, Eq, Debug)] #[table_name = "user_profile"] #[primary_key(user_id)] pub struct ProfileModel { diff --git a/libsplinter/src/biome/refresh_tokens/store/diesel/models.rs b/libsplinter/src/biome/refresh_tokens/store/diesel/models.rs index b7e04672c..1af034d3f 100644 --- a/libsplinter/src/biome/refresh_tokens/store/diesel/models.rs +++ b/libsplinter/src/biome/refresh_tokens/store/diesel/models.rs @@ -14,7 +14,7 @@ use super::schema::refresh_tokens; -#[derive(Queryable, Identifiable, PartialEq, Debug)] +#[derive(Queryable, Identifiable, PartialEq, Eq, Debug)] #[table_name = "refresh_tokens"] #[primary_key(id)] pub struct RefreshToken { @@ -23,7 +23,7 @@ pub struct RefreshToken { pub token: String, } -#[derive(AsChangeset, Insertable, PartialEq, Debug)] +#[derive(AsChangeset, Insertable, PartialEq, Eq, Debug)] #[table_name = "refresh_tokens"] pub struct NewRefreshToken<'a> { pub user_id: &'a str, diff --git a/libsplinter/src/channel/error.rs b/libsplinter/src/channel/error.rs index ee871b2f0..95b97a8fa 100644 --- a/libsplinter/src/channel/error.rs +++ b/libsplinter/src/channel/error.rs @@ -15,7 +15,7 @@ use std::error::Error; use std::fmt; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct RecvError { pub error: String, } @@ -28,7 +28,7 @@ impl fmt::Display for RecvError { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum TryRecvError { Empty, Disconnected, @@ -47,7 +47,7 @@ impl fmt::Display for TryRecvError { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum RecvTimeoutError { Timeout, Disconnected, @@ -66,7 +66,7 @@ impl fmt::Display for RecvTimeoutError { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct SendError { pub error: String, } diff --git a/libsplinter/src/circuit/template/yaml_parser/v1.rs b/libsplinter/src/circuit/template/yaml_parser/v1.rs index 0071a70e0..8819341ad 100644 --- a/libsplinter/src/circuit/template/yaml_parser/v1.rs +++ b/libsplinter/src/circuit/template/yaml_parser/v1.rs @@ -197,7 +197,7 @@ impl JsonMetadata { } /// Struct to represent single and list values within the `JsonMetadata`. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(untagged)] pub enum Value { Single(String), diff --git a/libsplinter/src/collections/bi_hash_map.rs b/libsplinter/src/collections/bi_hash_map.rs index fbc13d608..0f8462ae9 100644 --- a/libsplinter/src/collections/bi_hash_map.rs +++ b/libsplinter/src/collections/bi_hash_map.rs @@ -17,7 +17,7 @@ use std::collections::hash_map::Keys; use std::collections::HashMap; use std::hash::Hash; -#[derive(Clone, Debug, PartialEq, Default)] +#[derive(Clone, Debug, PartialEq, Eq, Default)] pub struct BiHashMap { kv_hash_map: HashMap, vk_hash_map: HashMap, diff --git a/libsplinter/src/collections/error.rs b/libsplinter/src/collections/error.rs index 2c7a8546e..46642ca55 100644 --- a/libsplinter/src/collections/error.rs +++ b/libsplinter/src/collections/error.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct RefMapRemoveError(pub String); impl std::error::Error for RefMapRemoveError {} diff --git a/libsplinter/src/error/constraint_violation.rs b/libsplinter/src/error/constraint_violation.rs index 10d529fb7..fe615f24b 100644 --- a/libsplinter/src/error/constraint_violation.rs +++ b/libsplinter/src/error/constraint_violation.rs @@ -24,7 +24,7 @@ use std::fmt::Write as _; /// violated. For example, if an operation tries to insert an entry that would /// cause a duplicate in a unique column, the ConstraintViolationType::Unique /// should be used. -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum ConstraintViolationType { Unique, ForeignKey, diff --git a/libsplinter/src/events/ws/web_socket_client.rs b/libsplinter/src/events/ws/web_socket_client.rs index 6737331b2..6320ceac4 100644 --- a/libsplinter/src/events/ws/web_socket_client.rs +++ b/libsplinter/src/events/ws/web_socket_client.rs @@ -44,6 +44,8 @@ const DEFAULT_TIMEOUT: u64 = 300; // default timeout if no message is received f type OnErrorHandle = dyn Fn(WebSocketError, Context) -> Result<(), WebSocketError> + Send + Sync + 'static; +type OnReconnectHandle = dyn Fn(&mut WebSocketClient) + Send + Sync + 'static; + /// WebSocket client. Configures Websocket connection and produces `Listen` future. pub struct WebSocketClient + 'static = Vec> { url: String, @@ -51,7 +53,7 @@ pub struct WebSocketClient + 'static = Vec> { on_message: Arc, T) -> WsResponse + Send + Sync + 'static>, on_open: Option) -> WsResponse + Send + Sync + 'static>>, on_error: Option>>, - on_reconnect: Option) + Send + Sync + 'static>>, + on_reconnect: Option>>, reconnect: bool, reconnect_limit: u64, timeout: u64, @@ -176,9 +178,7 @@ impl + 'static> WebSocketClient { self.on_reconnect = Some(Arc::new(on_reconnect)); } - pub fn get_on_reconnect( - &self, - ) -> Option) + Send + Sync + 'static>> { + pub fn get_on_reconnect(&self) -> Option>> { match &self.on_reconnect { Some(arc) => Some(Arc::clone(arc)), None => None, diff --git a/libsplinter/src/network/auth/mod.rs b/libsplinter/src/network/auth/mod.rs index dbb1e42e2..c0a0fbd6e 100644 --- a/libsplinter/src/network/auth/mod.rs +++ b/libsplinter/src/network/auth/mod.rs @@ -485,7 +485,7 @@ impl ManagedAuthorizations { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum ConnectionAuthorizationType { Trust { identity: String }, Challenge { public_key: PublicKey }, diff --git a/libsplinter/src/network/auth/state_machine/mod.rs b/libsplinter/src/network/auth/state_machine/mod.rs index 9af619ab5..85949dfd5 100644 --- a/libsplinter/src/network/auth/state_machine/mod.rs +++ b/libsplinter/src/network/auth/state_machine/mod.rs @@ -37,7 +37,7 @@ use self::trust_v1::{ use super::{ManagedAuthorizationState, ManagedAuthorizations}; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum Identity { Trust { identity: String, diff --git a/libsplinter/src/network/connection_manager/builder.rs b/libsplinter/src/network/connection_manager/builder.rs index 0fb71d172..c92b1d013 100644 --- a/libsplinter/src/network/connection_manager/builder.rs +++ b/libsplinter/src/network/connection_manager/builder.rs @@ -398,7 +398,7 @@ fn send_heartbeats( metadata.endpoint(), metadata.connection_id(), subscribers, - &*authorizer, + authorizer, internal_sender.clone(), ) { error!( diff --git a/libsplinter/src/network/connection_manager/error.rs b/libsplinter/src/network/connection_manager/error.rs index 027a5885a..9344270f7 100644 --- a/libsplinter/src/network/connection_manager/error.rs +++ b/libsplinter/src/network/connection_manager/error.rs @@ -14,7 +14,7 @@ use std::{error, fmt, io}; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum ConnectionManagerError { StartUpError(String), HeartbeatError(String), diff --git a/libsplinter/src/network/connection_manager/notification.rs b/libsplinter/src/network/connection_manager/notification.rs index 0a2637090..e723bf8ff 100644 --- a/libsplinter/src/network/connection_manager/notification.rs +++ b/libsplinter/src/network/connection_manager/notification.rs @@ -17,7 +17,7 @@ use crate::network::auth::ConnectionAuthorizationType; use super::error::ConnectionManagerError; /// Messages that will be dispatched to all subscription handlers -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum ConnectionManagerNotification { Connected { endpoint: String, diff --git a/libsplinter/src/network/dispatch/mod.rs b/libsplinter/src/network/dispatch/mod.rs index ae140880b..502b09f3b 100644 --- a/libsplinter/src/network/dispatch/mod.rs +++ b/libsplinter/src/network/dispatch/mod.rs @@ -37,7 +37,7 @@ use crate::peer::PeerTokenPair; /// A wrapper for a PeerId. /// /// This type constrains a dispatcher to peer-specific messages -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct PeerId(PeerTokenPair); impl std::ops::Deref for PeerId { @@ -75,7 +75,7 @@ impl fmt::Display for PeerId { /// A wrapper for Connection Id /// /// The type constrains a dispatcher to connection-specific messages -#[derive(Debug, Clone, Default, PartialEq)] +#[derive(Debug, Clone, Default, PartialEq, Eq)] pub struct ConnectionId(String); impl std::ops::Deref for ConnectionId { diff --git a/libsplinter/src/oauth/mod.rs b/libsplinter/src/oauth/mod.rs index a560767a6..dbf9acb9a 100644 --- a/libsplinter/src/oauth/mod.rs +++ b/libsplinter/src/oauth/mod.rs @@ -238,7 +238,7 @@ fn new_basic_client( /// Information pertaining to pending authorization requests, including the PKCE verifier, and /// client's redirect URL -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct PendingAuthorization { pkce_verifier: String, client_redirect_url: String, diff --git a/libsplinter/src/oauth/store/diesel/models.rs b/libsplinter/src/oauth/store/diesel/models.rs index bd811957b..e0123b2ae 100644 --- a/libsplinter/src/oauth/store/diesel/models.rs +++ b/libsplinter/src/oauth/store/diesel/models.rs @@ -14,7 +14,7 @@ use super::schema::oauth_inflight_request; -#[derive(Insertable, Queryable, Identifiable, PartialEq, Debug)] +#[derive(Insertable, Queryable, Identifiable, PartialEq, Eq, Debug)] #[table_name = "oauth_inflight_request"] pub struct OAuthInflightRequest { pub id: String, diff --git a/libsplinter/src/peer/error.rs b/libsplinter/src/peer/error.rs index 269bbfa28..81356cc7c 100644 --- a/libsplinter/src/peer/error.rs +++ b/libsplinter/src/peer/error.rs @@ -18,7 +18,7 @@ use std::{error, fmt}; /// Errors that could be raised by the `PeerManager` #[allow(clippy::enum_variant_names)] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerManagerError { /// `PeerManager` start up failed StartUpError(String), @@ -39,7 +39,7 @@ impl fmt::Display for PeerManagerError { /// Errors that could be raised when requesting a peer is added #[allow(clippy::enum_variant_names)] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerRefAddError { /// Internal `PeerManager` error InternalError(String), @@ -65,7 +65,7 @@ impl fmt::Display for PeerRefAddError { /// Errors that could be raised when requesting a peer is added without a peer ID #[allow(clippy::enum_variant_names)] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerUnknownAddError { /// Internal `PeerManager` error InternalError(String), @@ -94,7 +94,7 @@ impl fmt::Display for PeerUnknownAddError { } /// Errors that could be raised when requesting a peer is removed -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerRefRemoveError { /// Internal `PeerManager` error Internal(String), @@ -119,7 +119,7 @@ impl fmt::Display for PeerRefRemoveError { } /// Errors that could be raised when requesting a list of peers -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerListError { /// Internal `PeerManager`error Internal(String), @@ -145,7 +145,7 @@ impl fmt::Display for PeerListError { /// Errors that could be raised when requesting a peer's connection ID #[allow(clippy::enum_variant_names)] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerConnectionIdError { /// Internal `PeerManager` error InternalError(String), diff --git a/libsplinter/src/peer/interconnect/error.rs b/libsplinter/src/peer/interconnect/error.rs index 4060bfe68..53742ad2a 100644 --- a/libsplinter/src/peer/interconnect/error.rs +++ b/libsplinter/src/peer/interconnect/error.rs @@ -15,7 +15,7 @@ use std::{error, fmt}; /// Errors that could be raised by `PeerInterconnect` -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum PeerInterconnectError { /// `PeerInterconnect` start up failed StartUpError(String), diff --git a/libsplinter/src/peer/notification.rs b/libsplinter/src/peer/notification.rs index fed4a934f..d620828e4 100644 --- a/libsplinter/src/peer/notification.rs +++ b/libsplinter/src/peer/notification.rs @@ -23,7 +23,7 @@ use super::error::PeerManagerError; use super::PeerTokenPair; /// Messages that will be dispatched to all subscription handlers -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum PeerManagerNotification { /// Notifies subscribers that a peer is connected. Includes the peer ID of the connected peer. Connected { peer: PeerTokenPair }, diff --git a/libsplinter/src/peer/peer_map.rs b/libsplinter/src/peer/peer_map.rs index cce1cb922..fef74b5a7 100644 --- a/libsplinter/src/peer/peer_map.rs +++ b/libsplinter/src/peer/peer_map.rs @@ -24,7 +24,7 @@ use super::error::PeerUpdateError; use super::{PeerAuthorizationToken, PeerTokenPair}; /// Enum for the current status of a peer -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub enum PeerStatus { /// Peer is connected and is reachable Connected, @@ -35,7 +35,7 @@ pub enum PeerStatus { } /// The representation of a peer in the `PeerMap` -#[derive(Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug)] pub struct PeerMetadata { /// The unique PeerAuthorizationToken ID for the peer pub id: PeerAuthorizationToken, diff --git a/libsplinter/src/rbac/store/identity.rs b/libsplinter/src/rbac/store/identity.rs index 36648c226..63159d15e 100644 --- a/libsplinter/src/rbac/store/identity.rs +++ b/libsplinter/src/rbac/store/identity.rs @@ -13,7 +13,7 @@ // limitations under the License. /// An identity that may be assigned roles. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Identity { /// A public key-based identity. Key(String), diff --git a/libsplinter/src/registry/client/mod.rs b/libsplinter/src/registry/client/mod.rs index f530df871..561862d2c 100644 --- a/libsplinter/src/registry/client/mod.rs +++ b/libsplinter/src/registry/client/mod.rs @@ -65,7 +65,7 @@ pub trait RegistryClient { fn delete_node(&self, identity: &str) -> Result<(), InternalError>; } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct RegistryNode { pub identity: String, pub endpoints: Vec, @@ -96,13 +96,13 @@ impl fmt::Display for RegistryNode { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct RegistryNodeListSlice { pub data: Vec, pub paging: Paging, } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct Paging { pub current: String, pub offset: usize, diff --git a/libsplinter/src/registry/diesel/models.rs b/libsplinter/src/registry/diesel/models.rs index 136201b27..69dd0a608 100644 --- a/libsplinter/src/registry/diesel/models.rs +++ b/libsplinter/src/registry/diesel/models.rs @@ -20,7 +20,9 @@ use super::schema::{ splinter_nodes, splinter_nodes_endpoints, splinter_nodes_keys, splinter_nodes_metadata, }; -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "splinter_nodes"] #[primary_key(identity)] pub struct NodesModel { @@ -28,7 +30,9 @@ pub struct NodesModel { pub display_name: String, } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "splinter_nodes_endpoints"] #[belongs_to(NodesModel, foreign_key = "identity")] #[primary_key(identity, endpoint)] @@ -37,7 +41,7 @@ pub struct NodeEndpointsModel { pub endpoint: String, } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable)] +#[derive(Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable)] #[table_name = "splinter_nodes_keys"] #[belongs_to(NodesModel, foreign_key = "identity")] #[primary_key(identity, key)] @@ -46,7 +50,7 @@ pub struct NodeKeysModel { pub key: String, } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable)] +#[derive(Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable)] #[table_name = "splinter_nodes_metadata"] #[belongs_to(NodesModel, foreign_key = "identity")] #[primary_key(identity, key)] diff --git a/libsplinter/src/registry/mod.rs b/libsplinter/src/registry/mod.rs index ea33d51a0..deb97e25c 100644 --- a/libsplinter/src/registry/mod.rs +++ b/libsplinter/src/registry/mod.rs @@ -44,7 +44,7 @@ pub use yaml::{LocalYamlRegistry, YamlNode}; pub use yaml::{RemoteYamlRegistry, RemoteYamlShutdownHandle}; /// Native representation of a node in a registry. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Node { /// The Splinter identity of the node; must be non-empty and unique in the registry. identity: String, diff --git a/libsplinter/src/registry/yaml/mod.rs b/libsplinter/src/registry/yaml/mod.rs index ca80e3a0d..6534cf8b3 100644 --- a/libsplinter/src/registry/yaml/mod.rs +++ b/libsplinter/src/registry/yaml/mod.rs @@ -30,7 +30,7 @@ pub use local::LocalYamlRegistry; pub use remote::{RemoteYamlRegistry, RemoteYamlShutdownHandle}; /// Yaml representation of a node in a registry. -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct YamlNode { /// The Splinter identity of the node; must be non-empty and unique in the registry. identity: String, diff --git a/libsplinter/src/rest_api/actix_web_1/resource.rs b/libsplinter/src/rest_api/actix_web_1/resource.rs index b7914782e..ce10fb59b 100644 --- a/libsplinter/src/rest_api/actix_web_1/resource.rs +++ b/libsplinter/src/rest_api/actix_web_1/resource.rs @@ -29,7 +29,7 @@ use crate::rest_api::auth::authorization::{Permission, PermissionMap}; use super::{Continuation, RequestGuard}; /// Rest methods compatible with `RestApi`. -#[derive(Copy, Clone, PartialEq)] +#[derive(Copy, Clone, PartialEq, Eq)] pub enum Method { Get, Post, diff --git a/libsplinter/src/rest_api/auth/authorization/permission.rs b/libsplinter/src/rest_api/auth/authorization/permission.rs index d9a3ae597..2bd38f2a8 100644 --- a/libsplinter/src/rest_api/auth/authorization/permission.rs +++ b/libsplinter/src/rest_api/auth/authorization/permission.rs @@ -13,7 +13,7 @@ // limitations under the License. /// A permission assigned to an endpoint -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Permission { /// Check that the authenticated client has the specified permission. Check { diff --git a/libsplinter/src/rest_api/auth/authorization/permission_map/path_component.rs b/libsplinter/src/rest_api/auth/authorization/permission_map/path_component.rs index 911a14976..9ce46543c 100644 --- a/libsplinter/src/rest_api/auth/authorization/permission_map/path_component.rs +++ b/libsplinter/src/rest_api/auth/authorization/permission_map/path_component.rs @@ -13,7 +13,7 @@ // limitations under the License. /// A component of an endpoint path -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum PathComponent { /// A standard path component where matching is done on the internal string Text(String), diff --git a/libsplinter/src/rest_api/auth/authorization_header.rs b/libsplinter/src/rest_api/auth/authorization_header.rs index a78aad320..73675745d 100644 --- a/libsplinter/src/rest_api/auth/authorization_header.rs +++ b/libsplinter/src/rest_api/auth/authorization_header.rs @@ -19,7 +19,7 @@ use crate::rest_api::auth::{BearerToken, InvalidArgumentError}; /// The possible outcomes of attempting to authorize a client /// A parsed authorization header -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum AuthorizationHeader { Bearer(BearerToken), Custom(String), diff --git a/libsplinter/src/rest_api/auth/bearer_token.rs b/libsplinter/src/rest_api/auth/bearer_token.rs index 3e86abfbf..a497682ae 100644 --- a/libsplinter/src/rest_api/auth/bearer_token.rs +++ b/libsplinter/src/rest_api/auth/bearer_token.rs @@ -17,7 +17,7 @@ use core::str::FromStr; use crate::rest_api::auth::InvalidArgumentError; /// A bearer token of a specific type -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub enum BearerToken { #[cfg(feature = "biome-credentials")] /// Contains a Biome JWT diff --git a/libsplinter/src/rest_api/auth/identity/mod.rs b/libsplinter/src/rest_api/auth/identity/mod.rs index 7c2ddea91..b28bd020c 100644 --- a/libsplinter/src/rest_api/auth/identity/mod.rs +++ b/libsplinter/src/rest_api/auth/identity/mod.rs @@ -26,7 +26,7 @@ use crate::error::InternalError; use super::AuthorizationHeader; /// A REST API client's identity as determined by an [IdentityProvider] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum Identity { /// A custom identity Custom(String), diff --git a/libsplinter/src/rest_api/paging.rs b/libsplinter/src/rest_api/paging.rs index 2eb286aca..2458d6919 100644 --- a/libsplinter/src/rest_api/paging.rs +++ b/libsplinter/src/rest_api/paging.rs @@ -16,7 +16,7 @@ pub const DEFAULT_LIMIT: usize = 100; pub const DEFAULT_OFFSET: usize = 0; -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct Paging { pub current: String, pub offset: usize, diff --git a/libsplinter/src/runtime/service/lifecycle_executor/commands/mod.rs b/libsplinter/src/runtime/service/lifecycle_executor/commands/mod.rs index 4678a8c33..55fe114ac 100644 --- a/libsplinter/src/runtime/service/lifecycle_executor/commands/mod.rs +++ b/libsplinter/src/runtime/service/lifecycle_executor/commands/mod.rs @@ -33,7 +33,7 @@ impl StoreCommand for LifecycleCompleteCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .update_service(self.service.clone()) .map_err(|e| InternalError::from_source(Box::new(e))) } @@ -49,7 +49,7 @@ impl StoreCommand for LifecycleRemoveCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .remove_service(self.service.service_id()) .map_err(|e| InternalError::from_source(Box::new(e))) } diff --git a/libsplinter/src/runtime/service/lifecycle_executor/store/diesel/models.rs b/libsplinter/src/runtime/service/lifecycle_executor/store/diesel/models.rs index 9677e25d9..1db910ab8 100644 --- a/libsplinter/src/runtime/service/lifecycle_executor/store/diesel/models.rs +++ b/libsplinter/src/runtime/service/lifecycle_executor/store/diesel/models.rs @@ -43,7 +43,7 @@ use crate::runtime::service::{ use super::schema::{service_lifecycle_argument, service_lifecycle_status}; /// Database model representation of `LifecycleService` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable)] +#[derive(Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable)] #[table_name = "service_lifecycle_status"] #[primary_key(circuit_id, service_id)] pub struct ServiceLifecycleStatusModel { @@ -67,7 +67,9 @@ impl From<&LifecycleService> for ServiceLifecycleStatusModel { } /// Database model representation of the arguments in a `LifecycleService` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "service_lifecycle_argument"] #[primary_key(circuit_id, service_id, key)] pub struct ServiceLifecycleArgumentModel { @@ -197,7 +199,7 @@ impl From<&LifecycleStatus> for StatusTypeModel { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum StatusTypeModel { New, Complete, @@ -348,7 +350,7 @@ impl HasSqlType for Sqlite { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum CommandTypeModel { Prepare, Finalize, diff --git a/libsplinter/src/service/instance/error.rs b/libsplinter/src/service/instance/error.rs index 13339d8d2..5b4397b10 100644 --- a/libsplinter/src/service/instance/error.rs +++ b/libsplinter/src/service/instance/error.rs @@ -282,7 +282,7 @@ impl Error for FactoryCreateError { FactoryCreateError::CreationFailed(err) => Some(&**err), FactoryCreateError::InvalidArguments(_) => None, FactoryCreateError::Internal(_) => None, - FactoryCreateError::InvalidState(ref err) => Some(&*err), + FactoryCreateError::InvalidState(ref err) => Some(err), } } } diff --git a/libsplinter/src/threading/error.rs b/libsplinter/src/threading/error.rs index f589e7d16..b120110b3 100644 --- a/libsplinter/src/threading/error.rs +++ b/libsplinter/src/threading/error.rs @@ -14,7 +14,7 @@ use std::{error, fmt}; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct PacemakerStartError(pub String); impl error::Error for PacemakerStartError {} diff --git a/libsplinter/src/transport/matrix.rs b/libsplinter/src/transport/matrix.rs index c826f89ea..40c064d60 100644 --- a/libsplinter/src/transport/matrix.rs +++ b/libsplinter/src/transport/matrix.rs @@ -40,7 +40,7 @@ pub use super::error::{ }; /// Contains a payload and the identifier for the connection on which the payload was received -#[derive(Debug, Default, PartialEq)] +#[derive(Debug, Default, PartialEq, Eq)] pub struct ConnectionMatrixEnvelope { /// The connection identifier id: String, diff --git a/libsplinter/src/transport/socket/frame.rs b/libsplinter/src/transport/socket/frame.rs index 5fd555780..21222b5c4 100644 --- a/libsplinter/src/transport/socket/frame.rs +++ b/libsplinter/src/transport/socket/frame.rs @@ -49,7 +49,7 @@ impl std::fmt::Display for FrameError { impl std::error::Error for FrameError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { - FrameError::IoError(err) => Some(&*err), + FrameError::IoError(err) => Some(err), FrameError::InvalidChecksum => None, FrameError::InvalidHeaderLength(_) => None, FrameError::UnsupportedVersion => None, @@ -68,7 +68,7 @@ impl From for FrameError { /// /// This specifies the version of the frame, based on what value is sent during frame transmission. /// It indicates header style and data requirements. -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum FrameVersion { V1 = 1, } diff --git a/rest_api/actix_web_1/src/registry/resources/nodes.rs b/rest_api/actix_web_1/src/registry/resources/nodes.rs index 0148c4b9d..df1b26dee 100644 --- a/rest_api/actix_web_1/src/registry/resources/nodes.rs +++ b/rest_api/actix_web_1/src/registry/resources/nodes.rs @@ -19,13 +19,13 @@ use serde::{Deserialize, Serialize}; use splinter::registry::{InvalidNodeError, Node}; use splinter::rest_api::paging::Paging; -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct ListNodesResponse<'a> { pub data: Vec>, pub paging: Paging, } -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct NodeResponse<'a> { pub identity: &'a str, pub endpoints: &'a [String], @@ -47,7 +47,7 @@ impl<'a> From<&'a Node> for NodeResponse<'a> { } /// Used to deserialize add and update requests -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct NewNode { /// The Splinter identity of the node; must be non-empty and unique in the registry. pub identity: String, diff --git a/rest_api/actix_web_1/src/registry/resources/nodes_identity.rs b/rest_api/actix_web_1/src/registry/resources/nodes_identity.rs index efbf35b7e..983dd92b4 100644 --- a/rest_api/actix_web_1/src/registry/resources/nodes_identity.rs +++ b/rest_api/actix_web_1/src/registry/resources/nodes_identity.rs @@ -18,7 +18,7 @@ use std::convert::TryFrom; use serde::{Deserialize, Serialize}; use splinter::registry::{InvalidNodeError, Node}; -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct NodeResponse<'a> { pub identity: &'a str, pub endpoints: &'a [String], @@ -40,7 +40,7 @@ impl<'a> From<&'a Node> for NodeResponse<'a> { } /// Used to deserialize add and update requests -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct NewNode { /// The Splinter identity of the node; must be non-empty and unique in the registry. pub identity: String, diff --git a/rest_api/common/src/paging/v1/mod.rs b/rest_api/common/src/paging/v1/mod.rs index f30e2eecc..c94a9c6ad 100644 --- a/rest_api/common/src/paging/v1/mod.rs +++ b/rest_api/common/src/paging/v1/mod.rs @@ -21,7 +21,7 @@ pub use builder::PagingBuilder; pub const DEFAULT_LIMIT: usize = 100; pub const DEFAULT_OFFSET: usize = 0; -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct Paging { current: String, offset: usize, diff --git a/rest_api/common/src/scabbard/batch_statuses.rs b/rest_api/common/src/scabbard/batch_statuses.rs index 329c080dc..8bb1b62fe 100644 --- a/rest_api/common/src/scabbard/batch_statuses.rs +++ b/rest_api/common/src/scabbard/batch_statuses.rs @@ -18,7 +18,7 @@ use serde::{ser::SerializeSeq, Serialize, Serializer}; use scabbard::service::{BatchInfo, BatchStatus, InvalidTransaction, ValidTransaction}; -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct BatchInfoResponse<'a> { pub id: &'a str, pub status: BatchStatusResponse<'a>, @@ -35,7 +35,7 @@ impl<'a> From<&'a BatchInfo> for BatchInfoResponse<'a> { } } -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] #[serde(tag = "statusType", content = "message")] pub enum BatchStatusResponse<'a> { #[serde(serialize_with = "empty_array")] @@ -72,7 +72,7 @@ impl<'a> From<&'a BatchStatus> for BatchStatusResponse<'a> { } } -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct ValidTransactionResponse<'a> { pub transaction_id: &'a str, } @@ -85,7 +85,7 @@ impl<'a> From<&'a ValidTransaction> for ValidTransactionResponse<'a> { } } -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct InvalidTransactionResponse<'a> { pub transaction_id: &'a str, pub error_message: &'a str, diff --git a/rest_api/common/src/scabbard/batches.rs b/rest_api/common/src/scabbard/batches.rs index f2e705d1c..edadbfb4c 100644 --- a/rest_api/common/src/scabbard/batches.rs +++ b/rest_api/common/src/scabbard/batches.rs @@ -14,7 +14,7 @@ use serde::Serialize; -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct BatchLinkResponse<'a> { link: &'a str, } diff --git a/rest_api/common/src/scabbard/state.rs b/rest_api/common/src/scabbard/state.rs index 2da91c5e4..44f1ce758 100644 --- a/rest_api/common/src/scabbard/state.rs +++ b/rest_api/common/src/scabbard/state.rs @@ -14,7 +14,7 @@ use serde::Serialize; -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] pub struct StateEntryResponse<'a> { pub address: &'a str, pub value: &'a [u8], diff --git a/services/echo/libecho/src/store/diesel/models.rs b/services/echo/libecho/src/store/diesel/models.rs index 23a51c8a0..b910cb086 100644 --- a/services/echo/libecho/src/store/diesel/models.rs +++ b/services/echo/libecho/src/store/diesel/models.rs @@ -46,7 +46,7 @@ pub(crate) struct EchoService { } #[repr(i16)] -#[derive(Debug, Copy, Clone, PartialEq, FromSqlRow)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, FromSqlRow)] pub enum EchoServiceStatusModel { Prepared = 1, Finalized = 2, @@ -104,7 +104,7 @@ where } } -#[derive(Insertable, Queryable, Identifiable, PartialEq, Debug)] +#[derive(Insertable, Queryable, Identifiable, PartialEq, Eq, Debug)] #[table_name = "echo_peers"] #[primary_key(service_id, peer_service_id)] pub(crate) struct EchoPeer { @@ -112,7 +112,7 @@ pub(crate) struct EchoPeer { pub peer_service_id: Option, } -#[derive(Insertable, Queryable, Identifiable, PartialEq, Debug)] +#[derive(Insertable, Queryable, Identifiable, PartialEq, Eq, Debug)] #[table_name = "echo_request_errors"] #[primary_key(service_id, correlation_id)] pub(crate) struct EchoRequestError { @@ -122,7 +122,9 @@ pub(crate) struct EchoRequestError { pub error_at: i64, } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "echo_requests"] #[primary_key(sender_service_id, correlation_id)] pub(crate) struct EchoRequest { @@ -157,7 +159,7 @@ impl TryFrom for ServiceEchoRequest { } #[repr(i16)] -#[derive(Debug, Copy, Clone, PartialEq, FromSqlRow)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, FromSqlRow)] pub(crate) enum Status { NotSent = 0, Sent = 1, diff --git a/services/scabbard/libscabbard/src/client/mod.rs b/services/scabbard/libscabbard/src/client/mod.rs index 1d1831cf0..cb7489564 100644 --- a/services/scabbard/libscabbard/src/client/mod.rs +++ b/services/scabbard/libscabbard/src/client/mod.rs @@ -49,7 +49,7 @@ impl ServiceId { let ids = full_id.splitn(2, "::").collect::>(); let circuit = (*ids - .get(0) + .first() .ok_or_else(|| ScabbardClientError::new("service ID invalid: cannot be empty"))?) .to_string(); if circuit.is_empty() { @@ -96,7 +96,7 @@ impl FromStr for ServiceId { } /// Represents an entry in a Scabbard service's state. -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct StateEntry { address: String, value: Vec, diff --git a/services/scabbard/libscabbard/src/service/factory/mod.rs b/services/scabbard/libscabbard/src/service/factory/mod.rs index 0b43a9579..32cd5697b 100644 --- a/services/scabbard/libscabbard/src/service/factory/mod.rs +++ b/services/scabbard/libscabbard/src/service/factory/mod.rs @@ -894,18 +894,18 @@ fn get_postgres_pool( fn get_sqlite_pool( conn_str: &str, ) -> Result>, InvalidStateError> { - if (&*conn_str != ":memory:") && !Path::new(&*conn_str).exists() { + if (conn_str != ":memory:") && !Path::new(conn_str).exists() { return Err(InvalidStateError::with_message(format!( "Database file '{}' does not exist", conn_str ))); } - let connection_manager = ConnectionManager::::new(&*conn_str); + let connection_manager = ConnectionManager::::new(conn_str); let mut pool_builder = Pool::builder(); // A new database is created for each connection to the in-memory SQLite // implementation; to ensure that the resulting stores will operate on the same // database, only one connection is allowed. - if &*conn_str == ":memory:" { + if conn_str == ":memory:" { pool_builder = pool_builder.max_size(1); } pool_builder.build(connection_manager).map_err(|err| { diff --git a/services/scabbard/libscabbard/src/service/mod.rs b/services/scabbard/libscabbard/src/service/mod.rs index e663081d1..47f4cd054 100644 --- a/services/scabbard/libscabbard/src/service/mod.rs +++ b/services/scabbard/libscabbard/src/service/mod.rs @@ -69,7 +69,7 @@ pub const SERVICE_TYPE: &str = "scabbard"; const DEFAULT_COORDINATOR_TIMEOUT: u64 = 30; // 30 seconds /// Specifies the version of scabbard to use. -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq, Eq)] pub enum ScabbardVersion { V1, V2, diff --git a/services/scabbard/libscabbard/src/service/state/mod.rs b/services/scabbard/libscabbard/src/service/state/mod.rs index ce3ab6ae3..83919d4df 100644 --- a/services/scabbard/libscabbard/src/service/state/mod.rs +++ b/services/scabbard/libscabbard/src/service/state/mod.rs @@ -533,12 +533,10 @@ impl Events { .take(ITER_CACHE_SIZE) .map(|res| match res { Ok(receipt) => StateChangeEvent::try_from(receipt), - Err(err) => { - return Err(ScabbardStateError(format!( - "failed to get transaction receipt: {}", - err - ))) - } + Err(err) => Err(ScabbardStateError(format!( + "failed to get transaction receipt: {}", + err + ))), }) .collect::, _>>()?; @@ -568,7 +566,7 @@ impl Iterator for Events { } } -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(tag = "statusType", content = "message")] pub enum BatchStatus { #[serde(deserialize_with = "empty_array")] @@ -638,7 +636,7 @@ impl From for BatchStatus { } } -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct ValidTransaction { pub transaction_id: String, } @@ -649,7 +647,7 @@ impl ValidTransaction { } } -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct InvalidTransaction { pub transaction_id: String, pub error_message: String, diff --git a/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/actions.rs b/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/actions.rs index 56277cdb5..ca65e8219 100644 --- a/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/actions.rs +++ b/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/actions.rs @@ -48,7 +48,7 @@ impl StoreCommand for ExecuteActionCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .update_consensus_action(&self.service_id, self.action_id, SystemTime::now()) .map_err(|e| InternalError::from_source(Box::new(e))) } diff --git a/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/context.rs b/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/context.rs index 17e549512..fdea36d3a 100644 --- a/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/context.rs +++ b/services/scabbard/libscabbard/src/service/v3/consensus/consensus_action_runner/commands/context.rs @@ -52,7 +52,7 @@ impl StoreCommand for UpdateContextCommand { type Context = C; fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { - let store = self.store_factory.new_store(&*conn); + let store = self.store_factory.new_store(conn); if let Some(alarm) = self.alarm { store diff --git a/services/scabbard/libscabbard/src/service/v3/supervisor/commands.rs b/services/scabbard/libscabbard/src/service/v3/supervisor/commands.rs index b2ac4a600..ddfbeb299 100644 --- a/services/scabbard/libscabbard/src/service/v3/supervisor/commands.rs +++ b/services/scabbard/libscabbard/src/service/v3/supervisor/commands.rs @@ -51,7 +51,7 @@ impl StoreCommand for AddEventCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .add_consensus_event(&self.service_id, self.event.clone()) .map_err(|e| InternalError::from_source(Box::new(e)))?; @@ -78,7 +78,7 @@ impl StoreCommand for AddCommitEntryCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .add_commit_entry(self.commit_entry.clone()) .map_err(|e| InternalError::from_source(Box::new(e))) } @@ -103,7 +103,7 @@ impl StoreCommand for UpdateCommitEntryCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .update_commit_entry(self.commit_entry.clone()) .map_err(|e| InternalError::from_source(Box::new(e))) } @@ -134,7 +134,7 @@ impl StoreCommand for ExecuteSupervisorCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .update_supervisor_notification( &self.service_id, self.notification_id, @@ -166,7 +166,7 @@ impl StoreCommand for AddSupervisorNotificationCommand { fn execute(&self, conn: &Self::Context) -> Result<(), InternalError> { self.store_factory - .new_store(&*conn) + .new_store(conn) .add_supervisor_notification(self.notification.clone()) .map_err(|e| InternalError::from_source(Box::new(e))) } diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/action.rs b/services/scabbard/libscabbard/src/store/scabbard_store/action.rs index 0dedb83cb..d8ff92203 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/action.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/action.rs @@ -24,7 +24,7 @@ use augrim::{error::InternalError, two_phase_commit::TwoPhaseCommitAction}; use crate::service::v3::{ScabbardProcess, ScabbardValue}; use crate::store::scabbard_store::Action; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum ConsensusAction { TwoPhaseCommit(Action), } diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/alarm.rs b/services/scabbard/libscabbard/src/store/scabbard_store/alarm.rs index a9a52239d..20e839eaa 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/alarm.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/alarm.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum AlarmType { TwoPhaseCommit, } diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/context.rs b/services/scabbard/libscabbard/src/store/scabbard_store/context.rs index 7861f8d47..86fc29a15 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/context.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/context.rs @@ -24,7 +24,7 @@ use augrim::{error::InternalError, two_phase_commit::TwoPhaseCommitContext}; use crate::service::v3::ScabbardProcess; use crate::store::scabbard_store::two_phase_commit::Context; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum ConsensusContext { TwoPhaseCommit(Context), } diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/alarm.rs b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/alarm.rs index ba2b19b2b..fb8438581 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/alarm.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/alarm.rs @@ -37,7 +37,9 @@ use diesel::sqlite::Sqlite; use crate::store::scabbard_store::alarm::AlarmType; use crate::store::scabbard_store::diesel::schema::scabbard_alarm; -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "scabbard_alarm"] #[primary_key(circuit_id, service_id, alarm_type)] pub struct ScabbardAlarmModel { diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/commit_entry.rs b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/commit_entry.rs index 1f993cdff..f2fb5e84a 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/commit_entry.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/commit_entry.rs @@ -43,7 +43,9 @@ use crate::store::scabbard_store::commit::{CommitEntry, CommitEntryBuilder, Cons use crate::store::scabbard_store::diesel::schema::scabbard_v3_commit_history; /// Database model representation of `ScabbardService` commit entry -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "scabbard_v3_commit_history"] #[primary_key(circuit_id, service_id, epoch)] pub struct CommitEntryModel { @@ -54,7 +56,7 @@ pub struct CommitEntryModel { pub decision: Option, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum DecisionTypeModel { Commit, Abort, diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/consensus.rs b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/consensus.rs index 9c2ee4ad5..c34c979c9 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/consensus.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/consensus.rs @@ -55,7 +55,9 @@ use crate::store::scabbard_store::diesel::schema::{ consensus_2pc_vote_event, }; -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_context"] #[primary_key(circuit_id, service_id)] pub struct Consensus2pcContextModel { @@ -71,7 +73,7 @@ pub struct Consensus2pcContextModel { pub ack_timeout_start: Option, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum ContextStateModel { Abort, Commit, @@ -440,7 +442,9 @@ impl TryFrom<(&Context, &FullyQualifiedServiceId)> for Consensus2pcContextModel } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_context_participant"] #[primary_key(circuit_id, service_id, process)] pub struct Consensus2pcContextParticipantModel { @@ -452,7 +456,7 @@ pub struct Consensus2pcContextParticipantModel { pub decision_ack: bool, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct ParticipantList { pub inner: Vec, } @@ -478,7 +482,7 @@ impl TryFrom> for ParticipantList { } } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct ContextParticipantList { pub inner: Vec, } @@ -508,7 +512,9 @@ impl TryFrom<(&Context, &FullyQualifiedServiceId)> for ContextParticipantList { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_update_context_action"] #[belongs_to(Consensus2pcActionModel, foreign_key = "action_id")] #[primary_key(action_id)] @@ -591,7 +597,9 @@ impl TryFrom<(&Context, &i64, &Option)> for Consensus2pcUpdateContextAction } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_update_context_action_participant"] #[belongs_to(Consensus2pcActionModel, foreign_key = "action_id")] #[belongs_to(Consensus2pcUpdateContextActionModel, foreign_key = "action_id")] @@ -603,7 +611,7 @@ pub struct Consensus2pcUpdateContextActionParticipantModel { pub decision_ack: bool, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct UpdateContextActionParticipantList { pub inner: Vec, } @@ -627,7 +635,9 @@ impl TryFrom<(&Context, &i64)> for UpdateContextActionParticipantList { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_send_message_action"] #[belongs_to(Consensus2pcActionModel, foreign_key = "action_id")] #[primary_key(action_id)] @@ -640,7 +650,7 @@ pub struct Consensus2pcSendMessageActionModel { pub vote_request: Option>, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum MessageTypeModel { VoteResponse, DecisionRequest, @@ -807,7 +817,9 @@ impl HasSqlType for Sqlite { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_notification_action"] #[belongs_to(Consensus2pcActionModel, foreign_key = "action_id")] #[primary_key(action_id)] @@ -818,7 +830,7 @@ pub struct Consensus2pcNotificationModel { pub request_for_vote_value: Option>, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum NotificationTypeModel { RequestForStart, CoordinatorRequestForVote, @@ -1029,7 +1041,9 @@ impl From<&State> for ContextStateModel { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_action"] #[belongs_to(Consensus2pcContextModel, foreign_key = "service_id")] #[primary_key(id)] @@ -1043,7 +1057,7 @@ pub struct Consensus2pcActionModel { pub event_id: i64, } -#[derive(Debug, PartialEq, Insertable)] +#[derive(Debug, PartialEq, Eq, Insertable)] #[table_name = "consensus_2pc_action"] pub struct InsertableConsensus2pcActionModel { pub circuit_id: String, @@ -1279,7 +1293,9 @@ impl From<&Message> for MessageTypeModel { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_event"] #[primary_key(id)] pub struct Consensus2pcEventModel { @@ -1293,7 +1309,7 @@ pub struct Consensus2pcEventModel { pub update_context_action_id: Option, } -#[derive(Debug, PartialEq, Insertable)] +#[derive(Debug, PartialEq, Eq, Insertable)] #[table_name = "consensus_2pc_event"] pub struct InsertableConsensus2pcEventModel { pub circuit_id: String, @@ -1474,7 +1490,9 @@ impl HasSqlType for Sqlite { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_deliver_event"] #[belongs_to(Consensus2pcEventModel, foreign_key = "event_id")] #[primary_key(event_id)] @@ -1487,7 +1505,7 @@ pub struct Consensus2pcDeliverEventModel { pub vote_request: Option>, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum DeliverMessageTypeModel { VoteResponse, DecisionRequest, @@ -1669,7 +1687,9 @@ impl From<&Message> for DeliverMessageTypeModel { } } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_start_event"] #[belongs_to(Consensus2pcEventModel, foreign_key = "event_id")] #[primary_key(event_id)] @@ -1678,7 +1698,9 @@ pub struct Consensus2pcStartEventModel { pub value: Vec, } -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "consensus_2pc_vote_event"] #[belongs_to(Consensus2pcEventModel, foreign_key = "event_id")] #[primary_key(event_id)] diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/service.rs b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/service.rs index 4feca9369..71d453c77 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/service.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/service.rs @@ -39,7 +39,9 @@ use crate::store::scabbard_store::diesel::schema::{scabbard_peer, scabbard_servi use crate::store::scabbard_store::service::{ConsensusType, ScabbardService, ServiceStatus}; /// Database model representation of `ScabbardService` -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "scabbard_service"] #[primary_key(circuit_id, service_id)] pub struct ScabbardServiceModel { @@ -49,7 +51,7 @@ pub struct ScabbardServiceModel { pub status: ServiceStatusTypeModel, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum ConsensusTypeModel { Consensus2pc, } @@ -197,7 +199,7 @@ impl HasSqlType for Sqlite { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum ServiceStatusTypeModel { Prepared, Finalized, @@ -367,7 +369,9 @@ impl From<&ScabbardService> for ScabbardServiceModel { } /// Database model representation of `ScabbardService` peer -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "scabbard_peer"] #[primary_key(circuit_id, service_id, peer_service_id)] pub struct ScabbardPeerModel { diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/supervisor.rs b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/supervisor.rs index 7442476d6..04cf12be9 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/supervisor.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/diesel/models/supervisor.rs @@ -42,7 +42,9 @@ use crate::store::scabbard_store::{SupervisorNotification, SupervisorNotificatio use crate::store::scabbard_store::diesel::schema::supervisor_notification; -#[derive(Debug, PartialEq, Associations, Identifiable, Insertable, Queryable, QueryableByName)] +#[derive( + Debug, PartialEq, Eq, Associations, Identifiable, Insertable, Queryable, QueryableByName, +)] #[table_name = "supervisor_notification"] #[primary_key(id)] pub struct SupervisorNotificationModel { @@ -56,7 +58,7 @@ pub struct SupervisorNotificationModel { pub executed_at: Option, } -#[derive(Debug, PartialEq, Insertable)] +#[derive(Debug, PartialEq, Eq, Insertable)] #[table_name = "supervisor_notification"] pub struct InsertableSupervisorNotificationModel { pub circuit_id: String, @@ -136,7 +138,7 @@ impl From<&SupervisorNotificationType> for SupervisorNotificationTypeModel { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum SupervisorNotificationTypeModel { RequestForStart, CoordinatorRequestForVote, diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/event.rs b/services/scabbard/libscabbard/src/store/scabbard_store/event.rs index ebe28329d..16b37022c 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/event.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/event.rs @@ -22,7 +22,7 @@ use augrim::{error::InternalError, two_phase_commit::TwoPhaseCommitEvent}; use crate::service::v3::{ScabbardProcess, ScabbardValue}; use crate::store::scabbard_store::two_phase_commit::Event; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum ConsensusEvent { TwoPhaseCommit(Event), } diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/identified.rs b/services/scabbard/libscabbard/src/store/scabbard_store/identified.rs index c7023a54a..faeef84a1 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/identified.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/identified.rs @@ -13,7 +13,7 @@ // limitations under the License. /// A struct used to pair a type to an ID -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub struct Identified { pub id: i64, pub record: T, diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/action.rs b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/action.rs index 9c9fcc211..f142650ab 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/action.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/action.rs @@ -29,14 +29,14 @@ use crate::store::scabbard_store::context::ConsensusContext; use super::message::Message; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] pub enum Action { Update(ConsensusContext, Option), SendMessage(ServiceId, Message), Notify(Notification), } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum Notification { Abort(), Commit(), diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/context.rs b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/context.rs index 60a360e94..cfbc01678 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/context.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/context.rs @@ -33,7 +33,7 @@ use crate::store::scabbard_store::two_phase_commit::State; #[cfg(feature = "scabbardv3-consensus")] use crate::service::v3::ScabbardProcess; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Context { coordinator: ServiceId, epoch: u64, @@ -167,7 +167,7 @@ impl ContextBuilder { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Participant { pub process: ServiceId, pub vote: Option, diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/event.rs b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/event.rs index 2e58344e1..c29bfb5f7 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/event.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/event.rs @@ -24,7 +24,7 @@ use crate::service::v3::{ScabbardProcess, ScabbardValue}; use super::message::Message; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { Alarm(), Deliver(ServiceId, Message), diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/message.rs b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/message.rs index 5a0272d20..0d592c284 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/message.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/message.rs @@ -30,7 +30,7 @@ use crate::protos::{scabbard_v3, IntoBytes, ProtoConversionError}; #[cfg(feature = "scabbardv3-consensus")] use crate::service::v3::ScabbardValue; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum Message { VoteRequest(u64, Vec), Commit(u64), diff --git a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/state.rs b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/state.rs index 924138883..27e3a30a6 100644 --- a/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/state.rs +++ b/services/scabbard/libscabbard/src/store/scabbard_store/two_phase_commit/state.rs @@ -19,7 +19,7 @@ use std::time::SystemTime; #[cfg(feature = "scabbardv3-consensus")] use augrim::{error::InternalError, two_phase_commit::TwoPhaseCommitState}; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub enum State { Abort, Commit, diff --git a/splinterd/src/config/mod.rs b/splinterd/src/config/mod.rs index 605f60cd4..339ea90ce 100644 --- a/splinterd/src/config/mod.rs +++ b/splinterd/src/config/mod.rs @@ -951,7 +951,7 @@ impl Config { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum ScabbardState { Database, Lmdb, diff --git a/splinterd/src/config/partial.rs b/splinterd/src/config/partial.rs index d02bac8dd..83d2b969f 100644 --- a/splinterd/src/config/partial.rs +++ b/splinterd/src/config/partial.rs @@ -23,7 +23,7 @@ use super::ScabbardState; /// `ConfigSource` displays the source of configuration values, used to identify which of the various /// config modules were used to create a particular `PartialConfig` object. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub enum ConfigSource { Toml { file: String }, Default, diff --git a/splinterd/tests/admin/payload.rs b/splinterd/tests/admin/payload.rs index d08d4a080..1428498f2 100644 --- a/splinterd/tests/admin/payload.rs +++ b/splinterd/tests/admin/payload.rs @@ -48,7 +48,7 @@ pub(in crate::admin) fn make_create_circuit_payload( complete_create_payload(requester, signer, circuit_request) } -pub(in crate) fn complete_create_payload( +pub(crate) fn complete_create_payload( requester: &str, signer: &dyn Signer, circuit_request: CircuitCreateRequest, @@ -116,7 +116,7 @@ pub(in crate) fn complete_create_payload( /// Makes the `CircuitProposalVote` payload to either accept or reject the proposal (based on /// the `accept` argument) and returns the bytes of this payload -pub(in crate) fn make_circuit_proposal_vote_payload( +pub(crate) fn make_circuit_proposal_vote_payload( proposal: ProposalSlice, requester: &str, signer: &dyn Signer,