mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
refactor: share and use GenerateRandomKey helper
Making the `GenerateRandomKey` helper available to other modules via
key.{h.cpp} allows us to create random private keys directly at
instantiation of CKey, in contrast to the two-step process of creating
the instance and then having to call `MakeNewKey(...)`.
This commit is contained in:
@@ -136,10 +136,8 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_success)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(script_standard_Solver_failure)
|
||||
{
|
||||
CKey key;
|
||||
CPubKey pubkey;
|
||||
key.MakeNewKey(true);
|
||||
pubkey = key.GetPubKey();
|
||||
CKey key = GenerateRandomKey();
|
||||
CPubKey pubkey = key.GetPubKey();
|
||||
|
||||
CScript s;
|
||||
std::vector<std::vector<unsigned char> > solutions;
|
||||
@@ -192,10 +190,8 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_failure)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
|
||||
{
|
||||
CKey key;
|
||||
CPubKey pubkey;
|
||||
key.MakeNewKey(true);
|
||||
pubkey = key.GetPubKey();
|
||||
CKey key = GenerateRandomKey();
|
||||
CPubKey pubkey = key.GetPubKey();
|
||||
|
||||
CScript s;
|
||||
CTxDestination address;
|
||||
|
||||
Reference in New Issue
Block a user