1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 19:22:37 +00:00

fix null serialization in extern tvm emulator (#644)

This commit is contained in:
Andrei Kostylev 2023-03-10 14:17:17 +03:00 committed by GitHub
parent 865ebfce8d
commit c74c99774e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -398,7 +398,11 @@ const char *tvm_emulator_send_external_message(void *tvm_emulator, const char *m
} else { } else {
json_obj("missing_library", td::Bits256(result.missing_library).to_hex()); json_obj("missing_library", td::Bits256(result.missing_library).to_hex());
} }
if (result.actions.is_null()) {
json_obj("actions", td::JsonNull());
} else {
json_obj("actions", cell_to_boc_b64(result.actions).move_as_ok()); json_obj("actions", cell_to_boc_b64(result.actions).move_as_ok());
}
json_obj("new_code", cell_to_boc_b64(result.new_state.code).move_as_ok()); json_obj("new_code", cell_to_boc_b64(result.new_state.code).move_as_ok());
json_obj("new_data", cell_to_boc_b64(result.new_state.data).move_as_ok()); json_obj("new_data", cell_to_boc_b64(result.new_state.data).move_as_ok());
json_obj.leave(); json_obj.leave();
@ -427,7 +431,11 @@ const char *tvm_emulator_send_internal_message(void *tvm_emulator, const char *m
} else { } else {
json_obj("missing_library", td::Bits256(result.missing_library).to_hex()); json_obj("missing_library", td::Bits256(result.missing_library).to_hex());
} }
if (result.actions.is_null()) {
json_obj("actions", td::JsonNull());
} else {
json_obj("actions", cell_to_boc_b64(result.actions).move_as_ok()); json_obj("actions", cell_to_boc_b64(result.actions).move_as_ok());
}
json_obj("new_code", cell_to_boc_b64(result.new_state.code).move_as_ok()); json_obj("new_code", cell_to_boc_b64(result.new_state.code).move_as_ok());
json_obj("new_data", cell_to_boc_b64(result.new_state.data).move_as_ok()); json_obj("new_data", cell_to_boc_b64(result.new_state.data).move_as_ok());
json_obj.leave(); json_obj.leave();