Skip to content

Commit

Permalink
Add debug statement on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
pscott committed Sep 8, 2021
1 parent b6c697a commit 018cf80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/paraswap_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ static void handle_init_contract(void *parameters) {
ethPluginInitContract_t *msg = (ethPluginInitContract_t *) parameters;

if (msg->interfaceVersion != ETH_PLUGIN_INTERFACE_VERSION_LATEST) {
PRINTF("Wrong interface version: expected %d got %d\n",
ETH_PLUGIN_INTERFACE_VERSION_LATEST,
msg->interfaceVersion);
msg->result = ETH_PLUGIN_RESULT_UNAVAILABLE;
return;
}

if (msg->pluginContextLength < sizeof(paraswap_parameters_t)) {
PRINTF("Paraswap context size too big: expected %d got %d\n",
sizeof(paraswap_parameters_t),
msg->pluginContextLength);
msg->result = ETH_PLUGIN_RESULT_ERROR;
return;
}
Expand Down

0 comments on commit 018cf80

Please sign in to comment.