Skip to content

Commit bcdb4f0

Browse files
committed
QA: Avoid copy of the private key in deterministicmns test
1 parent 85e7f6a commit bcdb4f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/evo_deterministicmns_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ BOOST_FIXTURE_TEST_CASE(dip3_protx, TestChain400Setup)
624624
// ProUpReg: change voting key, operator key and payout address
625625
{
626626
const uint256& proTx = dmnHashes[InsecureRandRange(dmnHashes.size())]; // pick one at random
627-
const CBLSSecretKey& new_operatorKey = GetRandomBLSKey();
627+
CBLSSecretKey new_operatorKey = GetRandomBLSKey();
628628
const CKey& new_votingKey = GetRandomKey();
629629
const CScript& new_payee = GenerateRandomAddress();
630630
// try first with wrong owner key
@@ -652,7 +652,7 @@ BOOST_FIXTURE_TEST_CASE(dip3_protx, TestChain400Setup)
652652
BOOST_CHECK_MESSAGE(dmn->pdmnState->keyIDVoting == new_votingKey.GetPubKey().GetID(), "mn voting key not changed");
653653
BOOST_CHECK_MESSAGE(dmn->pdmnState->scriptPayout == new_payee, "mn script payout not changed");
654654

655-
operatorKeys.at(proTx) = new_operatorKey;
655+
operatorKeys[proTx] = std::move(new_operatorKey);
656656

657657
// check that changing the operator key puts the MN in PoSe banned state
658658
BOOST_CHECK_MESSAGE(dmn->pdmnState->addr == CService(), "IP address not cleared after changing operator");

0 commit comments

Comments
 (0)