@@ -122,9 +122,8 @@ HttpAnswer& HttpAnswer::operator<<(MessageCell msg) {
122122 abort (" cannot unpack internal message" );
123123 return *this ;
124124 }
125- td::RefInt256 value;
126- td::Ref<vm::Cell> extra;
127- if (!block::unpack_CurrencyCollection (info.value , value, extra)) {
125+ block::CurrencyCollection currency_collection;
126+ if (!currency_collection.unpack (info.value )) {
128127 abort (" cannot unpack message value" );
129128 return *this ;
130129 }
@@ -133,7 +132,7 @@ HttpAnswer& HttpAnswer::operator<<(MessageCell msg) {
133132 << " <tr><th>destination</th><td>" << AddressCell{info.dest } << " </td></tr>\n "
134133 << " <tr><th>lt</th><td>" << info.created_lt << " </td></tr>\n "
135134 << " <tr><th>time</th><td>" << info.created_at << " (" << time_to_human (info.created_at ) << " )</td></tr>\n "
136- << " <tr><th>value</th><td>" << value << " </td></tr>\n " ;
135+ << " <tr><th>value</th><td>" << currency_collection. to_str () << " </td></tr>\n " ;
137136 break ;
138137 }
139138 default :
@@ -365,6 +364,7 @@ HttpAnswer& HttpAnswer::operator<<(AccountCell acc_c) {
365364 ton::LogicalTime last_trans_lt = 0 ;
366365 ton::Bits256 last_trans_hash;
367366 last_trans_hash.set_zero ();
367+ block::CurrencyCollection balance = block::CurrencyCollection::zero ();
368368 try {
369369 auto state_root = vm::MerkleProof::virtualize (acc_c.q_roots [1 ], 1 );
370370 if (state_root.is_null ()) {
@@ -397,6 +397,20 @@ HttpAnswer& HttpAnswer::operator<<(AccountCell acc_c) {
397397 }
398398 last_trans_hash = acc_info.last_trans_hash ;
399399 last_trans_lt = acc_info.last_trans_lt ;
400+ block::gen::Account::Record_account acc;
401+ block::gen::AccountStorage::Record storage_rec;
402+ if (!tlb::unpack_cell (acc_c.root , acc)) {
403+ abort (" cannot unpack Account" );
404+ return *this ;
405+ }
406+ if (!tlb::csr_unpack (acc.storage , storage_rec)) {
407+ abort (" cannot unpack AccountStorage" );
408+ return *this ;
409+ }
410+ if (!balance.unpack (storage_rec.balance )) {
411+ abort (" cannot unpack account balance" );
412+ return *this ;
413+ }
400414 } else if (acc_c.root .not_null ()) {
401415 abort (PSTRING () << " account state proof shows that account state for " << acc_c.addr .workchain << " :"
402416 << acc_c.addr .addr .to_hex () << " must be empty, but it is not" );
@@ -434,6 +448,7 @@ HttpAnswer& HttpAnswer::operator<<(AccountCell acc_c) {
434448 *this << " <tr><th>workchain</th><td>" << acc_c.addr .workchain << " </td></tr>" ;
435449 *this << " <tr><th>account hex</th><td>" << acc_c.addr .addr .to_hex () << " </td></tr>" ;
436450 *this << " <tr><th>account</th><td>" << acc_c.addr .rserialize (true ) << " </td></tr>" ;
451+ *this << " <tr><th>balance</th><td>" << balance.to_str () << " </td></tr>" ;
437452 if (last_trans_lt > 0 ) {
438453 *this << " <tr><th>last transaction</th><td>"
439454 << " <a href=\" " << TransactionLink{acc_c.addr , last_trans_lt, last_trans_hash} << " \" >lt=" << last_trans_lt
0 commit comments