0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-01 09:35:52 -05:00

test: Don't redundantly define msg in key_tests

test/key_tests.cpp:184:21: error: declaration shadows a local variable [-Werror,-Wshadow]
        std::string msg = "A message to be signed" + ToString(i);
                    ^
test/key_tests.cpp:161:17: note: previous declaration is here
    std::string msg = "A message to be signed";
                ^
This commit is contained in:
Benjamin Woosley 2024-02-26 18:03:41 -03:00
parent b267c98c6c
commit 6d300e84d4
No known key found for this signature in database
GPG key ID: 609F2AB495D8C15C

View file

@ -166,8 +166,7 @@ BOOST_AUTO_TEST_CASE(key_signature_tests)
{
// When entropy is specified, we should see at least one high R signature within 20 signatures
CKey key = DecodeSecret(strSecret1);
std::string msg = "A message to be signed";
uint256 msg_hash = Hash(msg);
uint256 msg_hash = Hash("A message to be signed");
std::vector<unsigned char> sig;
bool found = false;
@ -189,8 +188,7 @@ BOOST_AUTO_TEST_CASE(key_signature_tests)
bool bad_sign = false;
for (int i = 0; i < 256; ++i) {
sig.clear();
std::string msg = "A message to be signed" + ToString(i);
msg_hash = Hash(msg);
msg_hash = Hash("A message to be signed" + ToString(i));
if (!key.Sign(msg_hash, sig)) {
bad_sign = true;
break;