Add CryptoIdentifierType and RippleCryptoIdentifier Traits

This commit is contained in:
Vinnie Falco
2013-09-23 10:07:09 -07:00
parent 1dd50f4422
commit 321898f71e
28 changed files with 984 additions and 164 deletions

View File

@@ -22,7 +22,7 @@ public:
}
};
typedef boost::unordered_map <PublicKey, Info, PublicKey::HashFunction> MapType;
typedef boost::unordered_map <PublicKey, Info, PublicKey::hasher> MapType;
ChosenList (std::size_t expectedSize = 0)
{

View File

@@ -46,7 +46,7 @@ public:
};
typedef boost::unordered_map <
PublicKey, ValidatorInfo, PublicKey::HashFunction> MapType;
PublicKey, ValidatorInfo, PublicKey::hasher> MapType;
struct State
{
@@ -318,12 +318,10 @@ public:
iter != list->map().end(); ++iter)
{
Json::Value entry (Json::objectValue);
/*
ChosenList::MapType::key_type const& key (iter->first);
ChosenList::MapType::mapped_type const& value (iter->second);
entry ["key"] = key;
entry ["value"] = value;
*/
entry ["key"] = key.to_string();
//ChosenList::MapType::mapped_type const& value (iter->second);
//entry ["value"] = value.to_string();
entries.append (entry);
}
}

View File

@@ -84,7 +84,7 @@ bool Utilities::parseInfoLine (
else if (deprecatedPublicKey.setNodePublic (encodedKey))
{
// We got a public key.
RipplePublicKey publicKey (deprecatedPublicKey.toRipplePublicKey ());
RipplePublicKey publicKey (deprecatedPublicKey);
success = true;
}
else
@@ -238,15 +238,15 @@ Time Utilities::stringToTime (String s)
std::string Utilities::publicKeyToString (PublicKey const& publicKey)
{
std::string s (PublicKey::sizeInBytes, ' ');
std::string s (PublicKey::size, ' ');
std::copy (publicKey.cbegin(), publicKey.cend(), s.begin());
return s;
}
PublicKey Utilities::stringToPublicKey (std::string const& s)
{
bassert (s.size() == PublicKey::sizeInBytes);
return PublicKey (&s.front());
bassert (s.size() == PublicKey::size);
return PublicKey ();
}
//------------------------------------------------------------------------------