@@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(compress_script_to_ckey_id)
7979 // Check compressed script
8080 BOOST_CHECK_EQUAL (out.size (), 21U );
8181 BOOST_CHECK_EQUAL (out[0 ], 0x00 );
82- BOOST_CHECK_EQUAL (memcmp (& out[ 1 ], & script[ 3 ] , 20 ), 0 ); // compare the 20 relevant chars of the CKeyId in the script
82+ BOOST_CHECK_EQUAL (memcmp (out. data () + 1 , script. data () + 3 , 20 ), 0 ); // compare the 20 relevant chars of the CKeyId in the script
8383}
8484
8585BOOST_AUTO_TEST_CASE (compress_script_to_cscript_id)
@@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(compress_script_to_cscript_id)
9696 // Check compressed script
9797 BOOST_CHECK_EQUAL (out.size (), 21U );
9898 BOOST_CHECK_EQUAL (out[0 ], 0x01 );
99- BOOST_CHECK_EQUAL (memcmp (& out[ 1 ], & script[ 2 ] , 20 ), 0 ); // compare the 20 relevant chars of the CScriptId in the script
99+ BOOST_CHECK_EQUAL (memcmp (out. data () + 1 , script. data () + 2 , 20 ), 0 ); // compare the 20 relevant chars of the CScriptId in the script
100100}
101101
102102BOOST_AUTO_TEST_CASE (compress_script_to_compressed_pubkey_id)
@@ -113,8 +113,8 @@ BOOST_AUTO_TEST_CASE(compress_script_to_compressed_pubkey_id)
113113
114114 // Check compressed script
115115 BOOST_CHECK_EQUAL (out.size (), 33U );
116- BOOST_CHECK_EQUAL (memcmp (& out[ 0 ], & script[ 1 ] , 1 ), 0 );
117- BOOST_CHECK_EQUAL (memcmp (& out[ 1 ], & script[ 2 ] , 32 ), 0 ); // compare the 32 chars of the compressed CPubKey
116+ BOOST_CHECK_EQUAL (memcmp (out. data (), script. data () + 1 , 1 ), 0 );
117+ BOOST_CHECK_EQUAL (memcmp (out. data () + 1 , script. data () + 2 , 32 ), 0 ); // compare the 32 chars of the compressed CPubKey
118118}
119119
120120BOOST_AUTO_TEST_CASE (compress_script_to_uncompressed_pubkey_id)
@@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE(compress_script_to_uncompressed_pubkey_id)
130130
131131 // Check compressed script
132132 BOOST_CHECK_EQUAL (out.size (), 33U );
133- BOOST_CHECK_EQUAL (memcmp (& out[ 1 ], & script[ 2 ] , 32 ), 0 ); // first 32 chars of CPubKey are copied into out[1:]
133+ BOOST_CHECK_EQUAL (memcmp (out. data () + 1 , script. data () + 2 , 32 ), 0 ); // first 32 chars of CPubKey are copied into out[1:]
134134 BOOST_CHECK_EQUAL (out[0 ], 0x04 | (script[65 ] & 0x01 )); // least significant bit (lsb) of last char of pubkey is mapped into out[0]
135135}
136136
0 commit comments