EVM-C: update capi.c to reflect the new error handling

This commit is contained in:
Alex Beregszaszi 2016-08-24 12:43:35 +01:00
parent 971033adda
commit 6d2b6efa90
1 changed files with 12 additions and 11 deletions

View File

@ -80,9 +80,9 @@ int main(int argc, char *argv[]) {
sizeof(input), value); sizeof(input), value);
printf("Execution result:\n"); printf("Execution result:\n");
if (result.outcome == EVM_EXCEPTION) { if (result.outcome != EVM_SUCCESS) {
printf(" EVM exception\n"); printf(" EVM execution failure: %d\n", result.outcome);
} } else {
printf(" Gas used: %ld\n", gas - result.gas_left); printf(" Gas used: %ld\n", gas - result.gas_left);
printf(" Gas left: %ld\n", result.gas_left); printf(" Gas left: %ld\n", result.gas_left);
printf(" Output size: %zd\n", result.output_size); printf(" Output size: %zd\n", result.output_size);
@ -93,6 +93,7 @@ int main(int argc, char *argv[]) {
printf("%02x ", result.output_data[i]); printf("%02x ", result.output_data[i]);
} }
printf("\n"); printf("\n");
}
intf.release_result(&result); intf.release_result(&result);
intf.destroy(jit); intf.destroy(jit);