Skip to content

Commit

Permalink
Make tracing feature optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored and axic committed Jul 13, 2018
1 parent 3c737a5 commit fad5203
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,11 @@ struct evmc_instance
/** Pointer to function executing a code by the EVM instance. */
evmc_execute_fn execute;

/** Pointer to function setting the EVM instruction tracer. */
/**
* Optional pointer to function setting the EVM instruction tracer.
*
* If the EVM does not support this feature the pointer can be NULL.
*/
evmc_set_tracer_fn set_tracer;

/**
Expand Down
4 changes: 2 additions & 2 deletions test/vmtester/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ TEST_F(evmc_vm_test, set_tracer)
static constexpr auto tracer_callback = [](evmc_tracer_context*, int, size_t, evmc_status_code,
int64_t, size_t, const evmc_uint256be*, size_t,
size_t, size_t, const uint8_t*) noexcept {};
ASSERT_NE(vm->set_tracer, nullptr);
vm->set_tracer(vm, tracer_callback, nullptr);
if (vm->set_tracer)
vm->set_tracer(vm, tracer_callback, nullptr);
}

0 comments on commit fad5203

Please sign in to comment.