mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 11:12:16 +00:00
* account_state_by_transaction * Correct time calculation * Bug fixes * Refactor * namespace block::transaction * smc.forget * RunEmulator: remove wallet_id * Refactor & fixes * AccountStateByTransaction: use shardchain block instead of masterchain block * transaction emulator core * refactor * tx emulator major functionality * small format changes * readme * clean * return json, add support for init messages * tx emulator readme * refactor getConfigParam and getConfigAll * add shardchain_libs_boc parameter * option to change verbosity level of transaction emulator * fix deserializing ShardAccount with account_none * add mode needSpecialSmc when unpack config * emulator: block::Transaction -> block::transaction::Transaction * Refactor * emulator: Fix bug * emulator: Support for emulator-extern * emulator: Refactor * Return vm log and vm exit code. * fix build on macos, emulator_static added * adjust documentation * ignore_chksig for external messages * tvm emulator, run get method * Added more params for transaction emulator * Added setters for optional transaction emulator params, moved libs to a new setter * Added actions cell output to transaction emulator * fix tonlib build * refactoring, rand seed as hex size 64, tvm emulator send message * tvm send message, small refactoring * fix config decoding, rename * improve documentation * macos export symbols * Added run_get_method to transaction emulator emscipten wrapper * Fixed empty action list serialization * Changed actions list cell to serialize as json null instead of empty string in transaction emulator * stack as boc * log gas remaining * Fix prev_block_id * fix build errors * Refactor fetch_config_params * fix failing unwrap of optional rand_seed * lookup correct shard, choose prev_block based on account shard * fix tonlib android jni build --------- Co-authored-by: legaii <jgates.ardux@gmail.com> Co-authored-by: ms <dungeon666master@protonmail.com> Co-authored-by: krigga <krigga7@gmail.com>
46 lines
No EOL
1.3 KiB
C++
46 lines
No EOL
1.3 KiB
C++
#pragma once
|
|
#include "smc-envelope/SmartContract.h"
|
|
|
|
namespace emulator {
|
|
class TvmEmulator {
|
|
ton::SmartContract smc_;
|
|
ton::SmartContract::Args args_;
|
|
public:
|
|
using Answer = ton::SmartContract::Answer;
|
|
|
|
TvmEmulator(td::Ref<vm::Cell> code, td::Ref<vm::Cell> data): smc_({code, data}) {
|
|
}
|
|
|
|
void set_vm_verbosity_level(int vm_log_verbosity) {
|
|
args_.set_vm_verbosity_level(vm_log_verbosity);
|
|
}
|
|
|
|
void set_libraries(vm::Dictionary&& libraries) {
|
|
args_.set_libraries(libraries);
|
|
}
|
|
|
|
void set_gas_limit(int64_t limit) {
|
|
args_.set_limits(vm::GasLimits(limit));
|
|
}
|
|
|
|
void set_c7(block::StdAddress address, uint32_t unixtime, uint64_t balance, td::BitArray<256> rand_seed, std::shared_ptr<const block::Config> config) {
|
|
args_.set_address(address);
|
|
args_.set_now(unixtime);
|
|
args_.set_balance(balance);
|
|
args_.set_rand_seed(rand_seed);
|
|
args_.set_config(config);
|
|
}
|
|
|
|
Answer run_get_method(int method_id, td::Ref<vm::Stack> stack) {
|
|
return smc_.run_get_method(args_.set_stack(stack).set_method_id(method_id));
|
|
}
|
|
|
|
Answer send_external_message(td::Ref<vm::Cell> message_body) {
|
|
return smc_.send_external_message(message_body, args_);
|
|
}
|
|
|
|
Answer send_internal_message(td::Ref<vm::Cell> message_body, uint64_t amount) {
|
|
return smc_.send_internal_message(message_body, args_.set_amount(amount));
|
|
}
|
|
};
|
|
} |