@@ -73,14 +73,10 @@ impl From<TransactionDb> for TransactionDataResponse {
7373 let sender = if let ( Some ( sender_hex) , Some ( sender_workchain_id) ) =
7474 ( c. sender_hex , c. sender_workchain_id )
7575 {
76- let sender = StdAddr :: from_str ( & format ! ( "{}:{}" , sender_workchain_id, sender_hex) )
77- . unwrap_or_default ( ) ;
78- let sender_base64url = Address ( sender. display_base64_url ( true ) . to_string ( ) ) ;
79- Some ( Account {
80- workchain_id : sender_workchain_id,
81- hex : Address ( sender_hex) ,
82- base64url : sender_base64url,
83- } )
76+ Some ( Account :: from_wc_and_address (
77+ sender_workchain_id,
78+ sender_hex,
79+ ) )
8480 } else {
8581 None
8682 } ;
@@ -112,21 +108,13 @@ impl From<TransactionDb> for TransactionDataResponse {
112108 None
113109 } ;
114110
115- let account =
116- StdAddr :: from_str ( & format ! ( "{}:{}" , c. account_workchain_id, c. account_hex) ) . unwrap ( ) ;
117- let base64url = Address ( account. display_base64_url ( true ) . to_string ( ) ) ;
118-
119111 TransactionDataResponse {
120112 id : c. id ,
121113 message_hash : c. message_hash ,
122114 transaction_hash : c. transaction_hash ,
123115 transaction_lt : c. transaction_lt . map ( |v| v. to_string ( ) ) ,
124116 transaction_timeout : c. transaction_timeout ,
125- account : Account {
126- workchain_id : c. account_workchain_id ,
127- hex : Address ( c. account_hex ) ,
128- base64url,
129- } ,
117+ account : Account :: from_wc_and_address ( c. account_workchain_id , c. account_hex ) ,
130118 sender,
131119 value : c. value ,
132120 original_value : c. original_value ,
@@ -248,9 +236,6 @@ pub struct TokenTransactionDataResponse {
248236
249237impl From < TokenTransactionFromDb > for TokenTransactionDataResponse {
250238 fn from ( c : TokenTransactionFromDb ) -> Self {
251- let account =
252- StdAddr :: from_str ( & format ! ( "{}:{}" , c. account_workchain_id, c. account_hex) ) . unwrap ( ) ;
253- let base64url = Address ( account. display_base64_url ( true ) . to_string ( ) ) ;
254239 let payload = c
255240 . payload
256241 . map ( |value| general_purpose:: STANDARD . encode ( value) ) ;
@@ -259,11 +244,7 @@ impl From<TokenTransactionFromDb> for TokenTransactionDataResponse {
259244 id : c. id ,
260245 message_hash : c. message_hash ,
261246 transaction_hash : c. transaction_hash ,
262- account : Account {
263- workchain_id : c. account_workchain_id ,
264- hex : Address ( c. account_hex ) ,
265- base64url,
266- } ,
247+ account : Account :: from_wc_and_address ( c. account_workchain_id , c. account_hex ) ,
267248 value : c. value ,
268249 root_address : c. root_address ,
269250 error : c. error ,
0 commit comments