mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 11:12:16 +00:00
* add github action for macOS 14 (arm64, M1) * add github action (portable) for macOS 14 (arm64, M1) * rename macOS arm64 output artifact * Update libsodium on windows * Compile libsodium * Update build-windows.bat * use upgraded libsodium 1.0.20; use compiled static libsodium for Windows instead of precompiled; * revert libsodium 1.0.20; use compiled static libsodium for Windows instead of precompiled; * use upgraded libsodium 1.0.20; use compiled static libsodium for Windows instead of precompiled; * fix libsodium version 1.0.19; use compiled static libsodium for Windows instead of precompiled; * try 1.0.20 libsodium precompiled on github * try 1.0.18 libsodium precompiled on github * try windows build on win server 2019 * and use PlatformToolset=v142 * use cmake -G "Visual Studio 16 2019" * fix path to msvc 2019 on github * separate github windows build on win server 2019 and build on win server 2022 * Update assembly/native/build-windows-2019.bat add retry mechanism Co-authored-by: Dr. Awesome Doge <doge@ton.org> * add test-emulator; disable test groovy pipeline * trigger all gh actions * fix win build * call test-emulator * fix test-emulator --------- Co-authored-by: neodiX <neodix42@ton.org> Co-authored-by: Dr. Awesome Doge <doge@ton.org> Co-authored-by: ms <dungeon666master@protonmail.com> |
||
---|---|---|
.. | ||
test | ||
CMakeLists.txt | ||
emulator-emscripten.cpp | ||
emulator-extern.cpp | ||
emulator-extern.h | ||
emulator_export_list | ||
README.md | ||
StringLog.h | ||
transaction-emulator.cpp | ||
transaction-emulator.h | ||
tvm-emulator.hpp |
Emulator
Emulator is a shared library containing the following functionality:
- Emulating blockchain transactions
- Emulating TVM - get methods and sending external and internal messages.
Transaction Emulator
To emulate transaction you need the following data:
- Account state of type ShardAccount.
- Global config of type (Hashmap 32 ^Cell).
- Inbound message of type MessageAny.
Optionally you can set emulation parameters:
- ignore_chksig - whether CHKSIG instructions are set to always succeed. Default: false
- lt - logical time of emulation. Default: next block's lt after the account's last transaction block.
- unixtime - unix time of emulation. Default: current system time
- rand_seed - random seed. Default: generated randomly
- libs - shared libraries. If your smart contract uses shared libraries (located in masterchain), you should set this parameter.
Emulator output contains:
- Transaction object (Transaction)
- New account state (ShardAccount)
- Actions cell (OutList n)
- TVM log
TVM Emulator
TVM emulator is intended to run get methods or emulate sending message on TVM level. It is initialized with smart contract code and data cells.
- To run get method you pass initial stack and method id (as integer).
- To emulate sending message you pass message body and in case of internal message amount in nanograms.