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

rpc: use with_ prefix for AuthServerConfig setter methods #11882

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/rpc/rpc-builder/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ impl AuthServerConfigBuilder {
}

/// Set the socket address for the server.
pub const fn socket_addr(mut self, socket_addr: SocketAddr) -> Self {
pub const fn with_socket_addr(mut self, socket_addr: SocketAddr) -> Self {
self.socket_addr = Some(socket_addr);
self
}

/// Set the socket address for the server.
pub const fn maybe_socket_addr(mut self, socket_addr: Option<SocketAddr>) -> Self {
pub const fn with_maybe_socket_addr(mut self, socket_addr: Option<SocketAddr>) -> Self {
self.socket_addr = socket_addr;
self
}

/// Set the secret for the server.
pub const fn secret(mut self, secret: JwtSecret) -> Self {
pub const fn with_secret(mut self, secret: JwtSecret) -> Self {
self.secret = secret;
self
}
Expand All @@ -138,7 +138,7 @@ impl AuthServerConfigBuilder {
}

/// Set the ipc endpoint for the server.
pub fn ipc_endpoint(mut self, ipc_endpoint: String) -> Self {
pub fn with_ipc_endpoint(mut self, ipc_endpoint: String) -> Self {
self.ipc_endpoint = Some(ipc_endpoint);
self
}
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-builder/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ impl RethRpcServerConfig for RpcServerArgs {
fn auth_server_config(&self, jwt_secret: JwtSecret) -> Result<AuthServerConfig, RpcError> {
let address = SocketAddr::new(self.auth_addr, self.auth_port);

let mut builder = AuthServerConfig::builder(jwt_secret).socket_addr(address);
let mut builder = AuthServerConfig::builder(jwt_secret).with_socket_addr(address);
if self.auth_ipc {
builder = builder
.ipc_endpoint(self.auth_ipc_path.clone())
.with_ipc_endpoint(self.auth_ipc_path.clone())
.with_ipc_config(self.ipc_server_builder());
}
Ok(builder.build())
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-builder/tests/it/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub const fn test_address() -> SocketAddr {

/// Launches a new server for the auth module
pub async fn launch_auth(secret: JwtSecret) -> AuthServerHandle {
let config = AuthServerConfig::builder(secret).socket_addr(test_address()).build();
let config = AuthServerConfig::builder(secret).with_socket_addr(test_address()).build();
let (tx, _rx) = unbounded_channel();
let beacon_engine_handle =
BeaconConsensusEngineHandle::<EthEngineTypes>::new(tx, Default::default());
Expand Down
Loading