Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

fix dereference empty optional bug in api_tests/transaction_tests #5634

Merged
merged 1 commit into from
Sep 13, 2018

Conversation

arhag
Copy link
Contributor

@arhag arhag commented Sep 12, 2018

The applied_transaction signal can be given a transaction_trace for a failed input transaction in which the receipt optional is empty.

Disconnect the connection to the applied_transaction signal that was only meant for the send_transaction_trigger_error_handler test after that particular unit test is completed. This ensures that the stale signal handling lambda function is not called when applying the later transactions in the test.

Furthermore, the signal handler should still check if the receipt is empty before attempting to dereference it even for the send_transaction_trigger_error_handler unit test, since the initial
transaction to send the deferred transaction could fail, and it is better for the official failure in the Boost tests to be from BOOST_REQUIRE(trace) rather than from a SIGABRT.

The applied_transaction signal can be given a transaction_trace for a 
failed input transaction in which the receipt optional is empty.

Disconnect the connection to the applied_transaction signal that was 
only meant for the send_transaction_trigger_error_handler test after 
that particular unit test is completed.
This ensures that the stale signal handling lambda function is not 
called when applying the later transactions in the test.

Furthermore, the signal handler should still check if the receipt is 
empty before attempting to dereference it even for the 
send_transaction_trigger_error_handler unit test, since the initial 
transaction to send the deferred transaction could fail, and it is 
better for the official failure in the Boost tests to be from 
BOOST_REQUIRE(trace) rather than from a SIGABRT.
@heifner heifner merged commit 2b3de0c into develop Sep 13, 2018
@heifner heifner deleted the fix-api-test-empty-optional-dereference branch September 13, 2018 02:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants