MCPcopy Create free account
hub / github.com/category-labs/monad / get_intercode_nativecode

Method get_intercode_nativecode

test/vm/vm/test_vm.cpp:186–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186std::pair<
187 monad::vm::SharedIntercode const &, monad::vm::SharedNativecode const> const
188BlockchainTestVM::get_intercode_nativecode(
189 monad_eth_revision const rev, bytes32_t const &code_hash,
190 uint8_t const *code, size_t code_size)
191{
192 auto const &icode = get_intercode(code_hash, code, code_size);
193
194 monad::vm::SharedNativecode ncode;
195 if (debug_dir_) {
196 std::ostringstream file(std::ostringstream::ate);
197 file.str(debug_dir_);
198 file << '/';
199 file << to_hex(code_hash);
200 native::CompilerConfig config{base_config};
201 auto asm_log_path = file.str();
202 config.asm_log_path = asm_log_path.c_str();
203 ncode = [&] {
204 SWITCH_EVM_TRAITS(
205 monad_vm_.compiler().cached_compile, code_hash, icode, config);
206 MONAD_ABORT();
207 }();
208 }
209 else {
210 ncode = [&] {
211 SWITCH_EVM_TRAITS(
212 monad_vm_.compiler().cached_compile,
213 code_hash,
214 icode,
215 base_config);
216 MONAD_ABORT();
217 }();
218 }
219
220 return {icode, ncode};
221}
222
223evmc::Result BlockchainTestVM::execute_evmone(
224 evmc_host_interface const *host, evmc_host_context *context,

Callers 1

precompile_contractFunction · 0.80

Calls 1

to_hexFunction · 0.50

Tested by

no test coverage detected