8000 Delete tier1_network_info RPC endpoint by saketh-are · Pull Request #9403 · near/nearcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Delete tier1_network_info RPC endpoint #9403

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

Merged
merged 2 commits into from
Aug 9, 2023
Merged
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
29 changes: 0 additions & 29 deletions chain/jsonrpc/src/lib.rs
E053
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,6 @@ impl JsonRpcHandler {
process_method_call(request, |params| self.next_light_client_block(params)).await
}
"network_info" => process_method_call(request, |_params: ()| self.network_info()).await,
"tier1_network_info" => {
process_method_call(request, |_params: ()| self.tier1_network_info()).await
}
"query" => {
let params = RpcRequest::parse(request.params)?;
let query_response = self.query(params).await;
Expand Down Expand Up @@ -1024,16 +1021,6 @@ impl JsonRpcHandler {
Ok(network_info.rpc_into())
}

async fn tier1_network_info(
&self,
) -> Result<
near_jsonrpc_primitives::types::network_info::RpcNetworkInfoResponse,
near_jsonrpc_primitives::types::network_info::RpcNetworkInfoError,
> {
let network_info = self.client_send(GetNetworkInfo {}).await?;
Ok(network_info.rpc_into())
}

async fn gas_price(
&self,
request_data: near_jsonrpc_primitives::types::gas_price::RpcGasPriceRequest,
Expand Down Expand Up @@ -1423,18 +1410,6 @@ fn network_info_handler(
response.boxed()
}

fn tier1_network_info_handler(
handler: web::Data<JsonRpcHandler>,
) -> impl Future<Output = Result<HttpResponse, HttpError>> {
let response = async move {
match handler.tier1_network_info().await {
Ok(value) => Ok(HttpResponse::Ok().json(&value)),
Err(_) => Ok(HttpResponse::ServiceUnavailable().finish()),
}
};
response.boxed()
}

pub async fn prometheus_handler() -> Result<HttpResponse, HttpError> {
metrics::PROMETHEUS_REQUEST_COUNT.inc();

Expand Down Expand Up @@ -1576,10 +1551,6 @@ pub fn start_http(
.route(web::head().to(health_handler)),
)
.service(web::resource("/network_info").route(web::get().to(network_info_handler)))
.service(
web::resource("/tier1_network_info")
.route(web::get().to(tier1_network_info_handler)),
)
.service(web::resource("/metrics").route(web::get().to(prometheus_handler)))
.service(web::resource("/debug/api/entity").route(web::post().to(handle_entity_debug)))
.service(web::resource("/debug/api/{api}").route(web::get().to(debug_handler)))
Expand Down
0