diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-01-02 16:53:02 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-01-20 15:25:23 +0100 |
commit | faedb111d2df78eabddaeccaba42f47572388bc7 (patch) | |
tree | ce51566ee5b0ac9311b4dedeebf48a4590f7afc9 /src/test/sighash_tests.cpp | |
parent | 1824644a363bf4adfb54cf32ab63806808fe778b (diff) |
refactor tests to fix ubsan suppressions
Diffstat (limited to 'src/test/sighash_tests.cpp')
-rw-r--r-- | src/test/sighash_tests.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index c16087bc1b..1601b02356 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -91,8 +91,9 @@ void static RandomScript(CScript &script) { script << oplist[InsecureRandRange(std::size(oplist))]; } -void static RandomTransaction(CMutableTransaction &tx, bool fSingle) { - tx.nVersion = InsecureRand32(); +void static RandomTransaction(CMutableTransaction& tx, bool fSingle) +{ + tx.nVersion = int(InsecureRand32()); tx.vin.clear(); tx.vout.clear(); tx.nLockTime = (InsecureRandBool()) ? InsecureRand32() : 0; @@ -126,7 +127,7 @@ BOOST_AUTO_TEST_CASE(sighash_test) int nRandomTests = 50000; #endif for (int i=0; i<nRandomTests; i++) { - int nHashType = InsecureRand32(); + int nHashType{int(InsecureRand32())}; CMutableTransaction txTo; RandomTransaction(txTo, (nHashType & 0x1f) == SIGHASH_SINGLE); CScript scriptCode; |