mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 11:12:16 +00:00
Process VmVirtError in RunEmulator
This commit is contained in:
parent
b4f4aa3ca7
commit
34303ee8de
1 changed files with 64 additions and 58 deletions
|
@ -1879,6 +1879,7 @@ class RunEmulator : public td::actor::Actor {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
auto r_config = block::ConfigInfo::extract_config(mc_state_root_, 0b11'11111111);
|
||||
if (r_config.is_error()) {
|
||||
check(r_config.move_as_error());
|
||||
|
@ -1918,7 +1919,8 @@ class RunEmulator : public td::actor::Actor {
|
|||
trans_emulator.set_prev_blocks_info(prev_blocks_info.move_as_ok());
|
||||
trans_emulator.set_libs(std::move(libraries));
|
||||
trans_emulator.set_rand_seed(block_id_.rand_seed);
|
||||
td::Result<emulator::TransactionEmulator::EmulationChain> emulation_result = trans_emulator.emulate_transactions_chain(std::move(account), std::move(transactions_));
|
||||
td::Result<emulator::TransactionEmulator::EmulationChain> emulation_result =
|
||||
trans_emulator.emulate_transactions_chain(std::move(account), std::move(transactions_));
|
||||
|
||||
if (emulation_result.is_error()) {
|
||||
promise_.set_error(emulation_result.move_as_error());
|
||||
|
@ -1942,6 +1944,10 @@ class RunEmulator : public td::actor::Actor {
|
|||
|
||||
promise_.set_value(td::make_unique<AccountState>(address, std::move(raw), 0));
|
||||
}
|
||||
} catch (vm::VmVirtError& err) {
|
||||
check(td::Status::Error(PSLICE() << "virtualization error while emulating transaction: " << err.get_msg()));
|
||||
return;
|
||||
}
|
||||
stopped_ = true;
|
||||
try_stop();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue