Skip to content

Commit

Permalink
🐛 fix inputData missing from call
Browse files Browse the repository at this point in the history
  • Loading branch information
no2chem committed Mar 11, 2019
1 parent 319d555 commit ca9f104
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
16 changes: 7 additions & 9 deletions src/evmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ca9f104

Please sign in to comment.