Clean up creating seed from string.

This commit is contained in:
Arthur Britto
2012-06-13 17:50:44 -07:00
parent 8f8948e5a4
commit f000947bc7
3 changed files with 13 additions and 8 deletions

View File

@@ -13,7 +13,7 @@
#include "key.h"
#include "utils.h"
#include "TaggedCache.h"
#include "boost/filesystem.hpp"
#include "boost/filesystem.hpp"
Application* theApp = NULL;
@@ -102,14 +102,9 @@ void Application::run()
mConnectionPool.start();
// New stuff.
NewcoinAddress rootSeedMaster;
NewcoinAddress rootAddress;
rootSeedMaster.setFamilySeed(CKey::PassPhraseToKey("masterpassphrase"));
NewcoinAddress rootSeedMaster = NewcoinAddress::createSeedGeneric("masterpassphrase");
NewcoinAddress rootGeneratorMaster = NewcoinAddress::createGeneratorPublic(rootSeedMaster);
rootAddress.setAccountPublic(rootGeneratorMaster, 0);
NewcoinAddress rootAddress = NewcoinAddress::createAccountPublic(rootGeneratorMaster, 0);
// Print enough information to be able to claim root account.
std::cerr << "Root master seed: " << rootSeedMaster.humanFamilySeed() << std::endl;

View File

@@ -762,6 +762,15 @@ NewcoinAddress NewcoinAddress::createSeedRandom()
return naNew;
}
NewcoinAddress NewcoinAddress::createSeedGeneric(const std::string& strText)
{
NewcoinAddress naNew;
naNew.setFamilySeedGeneric(strText);
return naNew;
}
BOOST_AUTO_TEST_SUITE(newcoin_address)
BOOST_AUTO_TEST_CASE( my_test )

View File

@@ -171,6 +171,7 @@ public:
void setFamilySeedRandom();
static NewcoinAddress createSeedRandom();
static NewcoinAddress createSeedGeneric(const std::string& strText);
};
#endif