Skip to content

Commit

Permalink
Reduce mutability
Browse files Browse the repository at this point in the history
* [skip ci] - because #353 not yet merged
  • Loading branch information
FabijanC committed Mar 4, 2024
1 parent 5a84633 commit 1999c72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl JsonRpcHandler {

/// starknet_getStorageAt
pub async fn get_storage_at(
&mut self,
&self,
contract_address: ContractAddress,
key: PatriciaKey,
block_id: BlockId,
Expand Down
4 changes: 2 additions & 2 deletions crates/starknet-devnet-server/src/api/json_rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ pub struct JsonRpcHandler {
impl RpcHandler for JsonRpcHandler {
type Request = StarknetRequest;

async fn on_request(&mut self, request: Self::Request) -> ResponseResult {
async fn on_request(&self, request: Self::Request) -> ResponseResult {
info!(target: "rpc", "received method in on_request {}", request);
self.execute(request).await
}
}

impl JsonRpcHandler {
/// The method matches the request to the corresponding enum variant and executes the request
async fn execute(&mut self, request: StarknetRequest) -> ResponseResult {
async fn execute(&self, request: StarknetRequest) -> ResponseResult {
trace!(target: "JsonRpcHandler::execute", "executing starknet request");

match request {
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet-devnet-server/src/rpc_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub trait RpcHandler: Clone + Send + Sync + 'static {
type Request: DeserializeOwned + Send + Sync + fmt::Debug;

/// Invoked when the request was received
async fn on_request(&mut self, request: Self::Request) -> ResponseResult;
async fn on_request(&self, request: Self::Request) -> ResponseResult;

/// Invoked for every incoming `RpcMethodCall`
///
Expand Down

0 comments on commit 1999c72

Please sign in to comment.