@@ -88,7 +88,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
8888 " ,
8989 )
9090 . bind ( account_id. to_string ( ) )
91- . bind ( bigdecimal :: BigDecimal :: from ( block_height) )
91+ . bind ( block_height as i64 ) // Convert to i64 for database compatibility
9292 . bind ( page_state. last_data_key . clone ( ) )
9393 . bind ( page_state. page_size )
9494 . fetch ( shard_id_pool. pool ) ;
@@ -141,7 +141,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
141141 )
142142 . bind ( account_id. to_string ( ) )
143143 . bind ( format ! ( "{}%" , hex:: encode( prefix) ) )
144- . bind ( bigdecimal :: BigDecimal :: from ( block_height) )
144+ . bind ( block_height as i64 ) // Convert to i64 for database compatibility
145145 . fetch ( shard_id_pool. pool ) ;
146146 while let Some ( row) = stream. next ( ) . await {
147147 let ( key, value) : ( String , Vec < u8 > ) = row?;
@@ -177,7 +177,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
177177 " ,
178178 )
179179 . bind ( account_id. to_string ( ) )
180- . bind ( bigdecimal :: BigDecimal :: from ( block_height) )
180+ . bind ( block_height as i64 ) // Convert to i64 for database compatibility
181181 . fetch ( shard_id_pool. pool ) ;
182182 while let Some ( row) = stream. next ( ) . await {
183183 let ( key, value) : ( String , Vec < u8 > ) = row?;
@@ -218,7 +218,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
218218 )
219219 . bind ( account_id. to_string ( ) )
220220 . bind ( hex:: encode ( & key_data) . to_string ( ) )
221- . bind ( bigdecimal :: BigDecimal :: from ( block_height) )
221+ . bind ( block_height as i64 ) // Convert to i64 for database compatibility
222222 . fetch_one ( shard_id_pool. pool )
223223 . await ?;
224224 Ok ( ( key_data, data_value) )
@@ -244,7 +244,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
244244 "state_changes_account" ,
245245 ] )
246246 . inc ( ) ;
247- let result: ( Vec < u8 > , bigdecimal :: BigDecimal ) = sqlx:: query_as (
247+ let result: ( Vec < u8 > , i64 ) = sqlx:: query_as (
248248 "
249249 SELECT data_value, block_height_from
250250 FROM state_changes_account_compact
@@ -256,7 +256,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
256256 " ,
257257 )
258258 . bind ( account_id. to_string ( ) )
259- . bind ( bigdecimal :: BigDecimal :: from ( request_block_height) )
259+ . bind ( request_block_height as i64 ) // Convert to i64 for database compatibility
260260 . fetch_one ( shard_id_pool. pool )
261261 . await ?;
262262 tracing:: debug!(
@@ -282,7 +282,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
282282 "state_changes_contract" ,
283283 ] )
284284 . inc ( ) ;
285- let result: ( Vec < u8 > , bigdecimal :: BigDecimal ) = sqlx:: query_as (
285+ let result: ( Vec < u8 > , i64 ) = sqlx:: query_as (
286286 "
287287 SELECT data_value, block_height_from
288288 FROM state_changes_contract_compact
@@ -294,7 +294,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
294294 " ,
295295 )
296296 . bind ( account_id. to_string ( ) )
297- . bind ( bigdecimal :: BigDecimal :: from ( request_block_height) )
297+ . bind ( request_block_height as i64 ) // Convert to i64 for database compatibility
298298 . fetch_one ( shard_id_pool. pool )
299299 . await ?;
300300
@@ -317,7 +317,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
317317 ] )
318318 . inc ( ) ;
319319 let key_data = borsh:: to_vec ( & public_key) ?;
320- let result: ( Vec < u8 > , bigdecimal :: BigDecimal ) = sqlx:: query_as (
320+ let result: ( Vec < u8 > , i64 ) = sqlx:: query_as (
321321 "
322322 SELECT data_value, block_height_from
323323 FROM state_changes_access_key_compact
@@ -331,7 +331,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
331331 )
332332 . bind ( account_id. to_string ( ) )
333333 . bind ( hex:: encode ( & key_data) . to_string ( ) )
334- . bind ( bigdecimal :: BigDecimal :: from ( request_block_height) )
334+ . bind ( request_block_height as i64 ) // Convert to i64 for database compatibility
335335 . fetch_one ( shard_id_pool. pool )
336336 . await ?;
337337 readnode_primitives:: QueryData :: < near_primitives:: account:: AccessKey > :: try_from ( result)
@@ -362,7 +362,7 @@ impl crate::ReaderDbManager for crate::PostgresDBManager {
362362 " ,
363363 )
364364 . bind ( account_id. to_string ( ) )
365- . bind ( bigdecimal :: BigDecimal :: from ( block_height) )
365+ . bind ( block_height as i64 ) // Convert to i64 for database compatibility
366366 . fetch ( shard_id_pool. pool ) ;
367367 while let Some ( row) = stream. next ( ) . await {
368368 let ( public_key_hex, access_key) : ( String , Vec < u8 > ) = row?;
0 commit comments