Skip to content

Commit

Permalink
refactor: used block info from call_result
Browse files Browse the repository at this point in the history
This triggered cargo clippy warning messages, so I decided to use `call_result.block...` instead of `block.block...`
  • Loading branch information
frolvanya committed Aug 12, 2024
1 parent 035d3d4 commit 8965580
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rpc-server/src/modules/queries/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,18 @@ async fn function_call(
maybe_optimistic_data,
data.prefetch_state_size_limit,
)
.await;
.await
.map_err(|err| err.to_rpc_query_error(block.block_height, block.block_hash))?;

let call_results =
call_results.map_err(|err| err.to_rpc_query_error(block.block_height, block.block_hash))?;
Ok(near_jsonrpc::primitives::types::query::RpcQueryResponse {
kind: near_jsonrpc::primitives::types::query::QueryResponseKind::CallResult(
near_primitives::views::CallResult {
result: call_results.result,
logs: call_results.logs,
},
),
block_height: block.block_height,
block_hash: block.block_hash,
block_height: call_results.block_height,
block_hash: call_results.block_hash,
})
}

Expand Down

0 comments on commit 8965580

Please sign in to comment.