Skip to content

Commit 0e160f5

Browse files
committed
test(rpcserver): Tests asserting rpc requests and results parsing and behavior.
1 parent 29220da commit 0e160f5

3 files changed

Lines changed: 590 additions & 3 deletions

File tree

crates/floresta-node/src/json_rpc/server.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ async fn handle_json_rpc_request(
269269
}
270270

271271
// Methods that require params
272-
let params = params.ok_or(JsonRpcError::MissingParameter("params".into()))?;
272+
//
273+
// We default here because theres some cases we have only optionals for a call, so even if omitted, is
274+
// nice for params to be Some(Value) even if this value is Null.
275+
let params = params.unwrap_or_default();
273276

274277
match method.as_str() {
275278
"getblock" => {

0 commit comments

Comments
 (0)