From ca9f104275383d359339d0212bd69ab35000235e Mon Sep 17 00:00:00 2001 From: Michael Wei Date: Mon, 11 Mar 2019 15:44:41 -0700 Subject: [PATCH] :bug: fix inputData missing from call --- package.json | 2 +- src/evmc.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 8ea8c6b..bee1cfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evmc", - "version": "1.0.5", + "version": "1.0.6", "description": "Ethereum EVMC bindings for node.js", "main": "dist/evmc.js", "types": "dist/evmc.d.ts", diff --git a/src/evmc.c b/src/evmc.c index 6a07a7c..6870387 100644 --- a/src/evmc.c +++ b/src/evmc.c @@ -957,14 +957,12 @@ void call_js(napi_env env, napi_value js_callback, struct evmc_js_context* ctx, status = napi_set_named_property(env, values[0], "sender", node_sender); assert(status == napi_ok); - if (data->msg->input_size != 0) { - napi_value node_input; - void* input_node_buf; - status = napi_create_buffer_copy(env, data->msg->input_size, data->msg->input_data, &input_node_buf, &node_input); - assert(status == napi_ok); - status = napi_set_named_property(env, values[0], "inputData", node_input); - assert(status == napi_ok); - } + napi_value node_input; + void* input_node_buf; + status = napi_create_buffer_copy(env, data->msg->input_size, data->msg->input_data, &input_node_buf, &node_input); + assert(status == napi_ok); + status = napi_set_named_property(env, values[0], "inputData", node_input); + assert(status == napi_ok); napi_value node_value; create_bigint_from_evmc_bytes32(env, &data->msg->value, &node_value); @@ -1008,7 +1006,7 @@ void call_js(napi_env env, napi_value js_callback, struct evmc_js_context* ctx, data->result->output_data = (uint8_t*) malloc(outputData_size); memcpy((void*)data->result->output_data, outputData, outputData_size); data->result->release = call_free_result; - } + } napi_value node_create_address; status = napi_get_named_property(env, result, "createAddress", &node_create_address);