1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

New account storage stat

This commit is contained in:
SpyCheese 2025-02-28 18:00:36 +03:00
parent 44e7e091b2
commit 57d7c2a895
17 changed files with 479 additions and 177 deletions

View file

@ -338,10 +338,11 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
PDO(cb.store_long_rchk_bool(workchain_id, ctor == 2 ? 8 : 32) && cb.store_bits_bool(addr.cbits(), 256));
THRERR("Cannot serialize addr:MsgAddressInt of the new smart contract");
// storage_stat:StorageInfo -> storage_stat.used:StorageUsed
PDO(block::store_UInt7(cb, stats.cells) // cells:(VarUInteger 7)
&& block::store_UInt7(cb, stats.bits) // bits:(VarUInteger 7)
&& block::store_UInt7(cb, stats.public_cells)); // public_cells:(VarUInteger 7)
PDO(block::store_UInt7(cb, stats.cells) // cells:(VarUInteger 7)
&& block::store_UInt7(cb, stats.bits)) // bits:(VarUInteger 7)
THRERR("Cannot serialize used:StorageUsed of the new smart contract");
PDO(cb.store_zeroes_bool(3)); // extra:StorageExtraInfo
THRERR("Cannot serialize storage_extra:StorageExtraInfo of the new smart contract");
PDO(cb.store_long_bool(0, 33)); // last_paid:uint32 due_payment:(Maybe Grams)
PDO(cb.append_data_cell_bool(storage)); // storage:AccountStorage
THRERR("Cannot create Account of the new smart contract");