diff --git a/include/evmc/evmc.h b/include/evmc/evmc.h index 370e1ec..1f6bfe8 100644 --- a/include/evmc/evmc.h +++ b/include/evmc/evmc.h @@ -789,7 +789,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; /** diff --git a/test/vmtester/tests.cpp b/test/vmtester/tests.cpp index cf01963..8887a12 100644 --- a/test/vmtester/tests.cpp +++ b/test/vmtester/tests.cpp @@ -66,6 +66,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); }