From b2621bd5da183e00ee8bc1886dc11f0f4c8d3a00 Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Wed, 22 May 2024 17:42:59 +0300 Subject: [PATCH] hook for poolv1.near --- rpc-server/src/modules/queries/methods.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpc-server/src/modules/queries/methods.rs b/rpc-server/src/modules/queries/methods.rs index da779eb7..5c5db3d6 100644 --- a/rpc-server/src/modules/queries/methods.rs +++ b/rpc-server/src/modules/queries/methods.rs @@ -109,7 +109,13 @@ async fn query_call( account_id, method_name, args, - } => function_call(data, block, account_id, method_name, args, is_optimistic).await, + } => { + if account_id.to_string().ends_with("poolv1.near") { + return Ok(data.near_rpc_client.call(query_request).await?); + } else { + function_call(data, block, account_id, method_name, args, is_optimistic).await + } + } #[allow(unused_variables)] // `account_id` is used in the `#[cfg(feature = "account_access_keys")]` branch. near_primitives::views::QueryRequest::ViewAccessKeyList { account_id } => {