@@ -302,7 +302,7 @@ impl HistoricalAccountsState {
302302 async move {
303303 let Message :: StateQuery ( StateQuery :: Accounts ( query) ) = message. as_ref ( ) else {
304304 return Arc :: new ( Message :: StateQueryResponse ( StateQueryResponse :: Accounts (
305- AccountsStateQueryResponse :: Error ( QueryError :: invalid_request (
305+ AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
306306 "Invalid message for accounts-state" ,
307307 ) ) ,
308308 ) ) ) ;
@@ -317,13 +317,11 @@ impl HistoricalAccountsState {
317317 )
318318 }
319319 Ok ( None ) => AccountsStateQueryResponse :: Error ( QueryError :: not_found (
320- format ! ( "Account {}" , account) ,
320+ format ! ( "Account {} not found " , account) ,
321321 ) ) ,
322- Err ( e) => {
323- AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
324- format ! ( "Failed to get registration history: {}" , e) ,
325- ) )
326- }
322+ Err ( e) => AccountsStateQueryResponse :: Error (
323+ QueryError :: internal_error ( e. to_string ( ) ) ,
324+ ) ,
327325 }
328326 }
329327 AccountsStateQuery :: GetAccountDelegationHistory { account } => {
@@ -334,11 +332,9 @@ impl HistoricalAccountsState {
334332 Ok ( None ) => AccountsStateQueryResponse :: Error ( QueryError :: not_found (
335333 format ! ( "Account {}" , account) ,
336334 ) ) ,
337- Err ( e) => {
338- AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
339- format ! ( "Failed to get delegation history: {}" , e) ,
340- ) )
341- }
335+ Err ( e) => AccountsStateQueryResponse :: Error (
336+ QueryError :: internal_error ( e. to_string ( ) ) ,
337+ ) ,
342338 }
343339 }
344340 AccountsStateQuery :: GetAccountMIRHistory { account } => {
@@ -347,11 +343,9 @@ impl HistoricalAccountsState {
347343 Ok ( None ) => AccountsStateQueryResponse :: Error ( QueryError :: not_found (
348344 format ! ( "Account {}" , account) ,
349345 ) ) ,
350- Err ( e) => {
351- AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
352- format ! ( "Failed to get MIR history: {}" , e) ,
353- ) )
354- }
346+ Err ( e) => AccountsStateQueryResponse :: Error (
347+ QueryError :: internal_error ( e. to_string ( ) ) ,
348+ ) ,
355349 }
356350 }
357351 AccountsStateQuery :: GetAccountWithdrawalHistory { account } => {
@@ -362,11 +356,9 @@ impl HistoricalAccountsState {
362356 Ok ( None ) => AccountsStateQueryResponse :: Error ( QueryError :: not_found (
363357 format ! ( "Account {}" , account) ,
364358 ) ) ,
365- Err ( e) => {
366- AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
367- format ! ( "Failed to get withdrawal history: {}" , e) ,
368- ) )
369- }
359+ Err ( e) => AccountsStateQueryResponse :: Error (
360+ QueryError :: internal_error ( e. to_string ( ) ) ,
361+ ) ,
370362 }
371363 }
372364 AccountsStateQuery :: GetAccountRewardHistory { account } => {
@@ -377,11 +369,9 @@ impl HistoricalAccountsState {
377369 Ok ( None ) => AccountsStateQueryResponse :: Error ( QueryError :: not_found (
378370 format ! ( "Account {}" , account) ,
379371 ) ) ,
380- Err ( e) => {
381- AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
382- format ! ( "Failed to get reward history: {}" , e) ,
383- ) )
384- }
372+ Err ( e) => AccountsStateQueryResponse :: Error (
373+ QueryError :: internal_error ( e. to_string ( ) ) ,
374+ ) ,
385375 }
386376 }
387377 AccountsStateQuery :: GetAccountAssociatedAddresses { account } => {
@@ -392,11 +382,9 @@ impl HistoricalAccountsState {
392382 Ok ( None ) => AccountsStateQueryResponse :: Error ( QueryError :: not_found (
393383 format ! ( "Account {}" , account) ,
394384 ) ) ,
395- Err ( e) => {
396- AccountsStateQueryResponse :: Error ( QueryError :: internal_error (
397- format ! ( "Failed to get associated addresses: {}" , e) ,
398- ) )
399- }
385+ Err ( e) => AccountsStateQueryResponse :: Error (
386+ QueryError :: internal_error ( e. to_string ( ) ) ,
387+ ) ,
400388 }
401389 }
402390 _ => AccountsStateQueryResponse :: Error ( QueryError :: not_implemented ( format ! (
0 commit comments