1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-14 12:12:21 +00:00

fix getAccountStateByTransaction (#623)

Co-authored-by: ms <dungeon666master@protonmail.com>
This commit is contained in:
EmelyanenkoK 2023-02-26 11:38:25 +03:00 committed by GitHub
parent c369127ae0
commit f118afab84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -20,7 +20,7 @@ class TransactionEmulator {
public:
TransactionEmulator(block::Config&& config, int vm_log_verbosity = 0) :
config_(std::move(config)), libraries_(256), vm_log_verbosity_(vm_log_verbosity),
unixtime_(0), lt_(0), rand_seed_(0), ignore_chksig_(false) {
unixtime_(0), lt_(0), rand_seed_(td::BitArray<256>::zero()), ignore_chksig_(false) {
}
struct EmulationResult {

View file

@ -436,7 +436,11 @@ class AccountState {
}
td::Result<td::Ref<vm::CellSlice>> to_shardAccountCellSlice() const {
return vm::CellBuilder().store_ref(raw_.info.root).store_bits(raw_.info.last_trans_hash.as_bitslice()).store_long(raw_.info.last_trans_lt).as_cellslice_ref();
auto account_root = raw_.info.root;
if (account_root.is_null()) {
block::gen::Account().cell_pack_account_none(account_root);
}
return vm::CellBuilder().store_ref(account_root).store_bits(raw_.info.last_trans_hash.as_bitslice()).store_long(raw_.info.last_trans_lt).as_cellslice_ref();
}
//NB: Order is important! Used during guessAccountRevision
@ -1311,7 +1315,7 @@ class GetRawAccountState : public td::actor::Actor {
ton::lite_api::liteServer_getAccountState(
ton::create_tl_lite_block_id(block_id_.value()),
ton::create_tl_object<ton::lite_api::liteServer_accountId>(address_.workchain, address_.addr)),
[self = this](auto r_state) { self->with_account_state(std::move(r_state)); }, block_id_.value().id.seqno);
[self = this](auto r_state) { self->with_account_state(std::move(r_state)); });
}
td::Status do_with_last_block(td::Result<LastBlockState> r_last_block) {