renamed 'shared_state' to 'common_state'

This commit is contained in:
Jędrzej Stuczyński
2024-03-05 08:59:48 +00:00
parent a53ae5b6b5
commit 67467ca76d
5 changed files with 10 additions and 10 deletions
@@ -8,7 +8,7 @@ use std::sync::Arc;
// I can see this being possible expanded with say storage or client store
#[derive(Clone)]
pub(crate) struct SharedHandlerState {
pub(crate) struct CommonHandlerState {
pub(crate) coconut_verifier: Arc<CoconutVerifier>,
pub(crate) local_identity: Arc<identity::KeyPair>,
pub(crate) only_coconut_credentials: bool,
@@ -25,8 +25,8 @@ use thiserror::Error;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio_tungstenite::tungstenite::{protocol::Message, Error as WsError};
use crate::node::client_handling::websocket::common_state::CommonHandlerState;
use crate::node::client_handling::websocket::connection_handler::AvailableBandwidth;
use crate::node::client_handling::websocket::shared_state::SharedHandlerState;
use crate::node::{
client_handling::{
active_clients::ActiveClientsStore,
@@ -89,7 +89,7 @@ impl InitialAuthenticationError {
pub(crate) struct FreshHandler<R, S, St> {
rng: R,
pub(crate) shared_state: SharedHandlerState,
pub(crate) shared_state: CommonHandlerState,
pub(crate) active_clients_store: ActiveClientsStore,
pub(crate) outbound_mix_sender: MixForwardingSender,
pub(crate) socket_connection: SocketStream<S>,
@@ -115,7 +115,7 @@ where
outbound_mix_sender: MixForwardingSender,
storage: St,
active_clients_store: ActiveClientsStore,
shared_state: SharedHandlerState,
shared_state: CommonHandlerState,
) -> Self {
FreshHandler {
rng,
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only
use crate::node::client_handling::active_clients::ActiveClientsStore;
use crate::node::client_handling::websocket::common_state::CommonHandlerState;
use crate::node::client_handling::websocket::connection_handler::FreshHandler;
use crate::node::client_handling::websocket::shared_state::SharedHandlerState;
use crate::node::storage::Storage;
use log::*;
use nym_mixnet_client::forwarder::MixForwardingSender;
@@ -14,11 +14,11 @@ use tokio::task::JoinHandle;
pub(crate) struct Listener {
address: SocketAddr,
shared_state: SharedHandlerState,
shared_state: CommonHandlerState,
}
impl Listener {
pub(crate) fn new(address: SocketAddr, shared_state: SharedHandlerState) -> Self {
pub(crate) fn new(address: SocketAddr, shared_state: CommonHandlerState) -> Self {
Listener {
address,
shared_state,
@@ -3,9 +3,9 @@
pub(crate) use listener::Listener;
pub(crate) mod common_state;
pub(crate) mod connection_handler;
pub(crate) mod listener;
pub(crate) mod message_receiver;
pub(crate) mod shared_state;
pub(crate) use shared_state::SharedHandlerState;
pub(crate) use common_state::CommonHandlerState;
+1 -1
View File
@@ -254,7 +254,7 @@ impl<St> Gateway<St> {
self.config.gateway.clients_port,
);
let shared_state = websocket::SharedHandlerState {
let shared_state = websocket::CommonHandlerState {
coconut_verifier,
local_identity: Arc::clone(&self.identity_keypair),
only_coconut_credentials: self.config.gateway.only_coconut_credentials,