Skip to content

Commit

Permalink
Merge pull request #1100 from AntelopeIO/checktime_hashing_fail_cache
Browse files Browse the repository at this point in the history
relax `checktime_hashing_fail` contract caching timing to eliminate spurious test failures
  • Loading branch information
spoonincode authored Jan 15, 2025
2 parents 2939fea + 8f93ff0 commit dfea280
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions unittests/checktime_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(checktime_hashing_fail, T, validating_testers) { t
chain.produce_block();

BOOST_TEST( !chain.is_code_cached("testapi"_n) );

//hit deadline exception, but cache the contract
BOOST_CHECK_EXCEPTION( call_test( chain, test_api_action<WASM_TEST_ACTION("test_checktime", "checktime_sha1_failure")>{},
5000, 8, 8 ),
deadline_exception, is_deadline_exception );

//run a simple action to cache the contract
CALL_TEST_FUNCTION(chain, "test_checktime", "checktime_pass", {});
BOOST_TEST( chain.is_code_cached("testapi"_n) );

//the contract should be cached, now we should get deadline_exception because of calls to checktime() from hashing function
Expand Down

0 comments on commit dfea280

Please sign in to comment.