From 5777e2b84803b45ac67fffe50ee5ac3e2b53cc82 Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 16 Jul 2019 15:19:04 +0300 Subject: [PATCH] coretests: more cases for escrow_custom_test (zero pledges + contract cancellation) -- exposes a bug --- tests/core_tests/escrow_wallet_tests.cpp | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/core_tests/escrow_wallet_tests.cpp b/tests/core_tests/escrow_wallet_tests.cpp index 25e07538..f3515054 100644 --- a/tests/core_tests/escrow_wallet_tests.cpp +++ b/tests/core_tests/escrow_wallet_tests.cpp @@ -1589,6 +1589,35 @@ bool escrow_custom_test::generate(std::vector& events) const test_details.push_back(cd); } + { + escrow_custom_test_callback_details cd = test_details[0]; + cd.cpd.comment = "cancellation: zero A pledge"; + cd.cpd.amount_a_pledge = 0; + cd.release_type = BC_ESCROW_SERVICE_INSTRUCTION_RELEASE_CANCEL; + cd.a_cancel_proposal_fee = 3 * TESTS_DEFAULT_FEE; + cd.cancellation_expiration_period = 1000; + test_details.push_back(cd); + } + + { + escrow_custom_test_callback_details cd = test_details[0]; + cd.cpd.comment = "cancellation: zero B pledge"; + cd.cpd.amount_b_pledge = 0; + cd.release_type = BC_ESCROW_SERVICE_INSTRUCTION_RELEASE_CANCEL; + cd.a_cancel_proposal_fee = 3 * TESTS_DEFAULT_FEE; + cd.cancellation_expiration_period = 1000; + test_details.push_back(cd); + } + + { + escrow_custom_test_callback_details cd = test_details[0]; + cd.cpd.comment = "cancellation: zero amount to pay"; + cd.cpd.amount_to_pay = 0; + cd.release_type = BC_ESCROW_SERVICE_INSTRUCTION_RELEASE_CANCEL; + cd.a_cancel_proposal_fee = 3 * TESTS_DEFAULT_FEE; + cd.cancellation_expiration_period = 1000; + test_details.push_back(cd); + } for(auto cd : test_details) {