mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Remove unused and obsolete Ripple identifiers and tidy up:
These identifiers were part of a failed set of classes to replace the functionality combined into RippleAddress. They are not used and therefore can be removed. * Remove RippleAccountPrivateKey * Remove RippleAccountPublicKey * Remove RippleAccountID * Remove RipplePrivateKey * Remove RipplePublicKeyHash * Remove RippleLedgerHash * Remove unused withCheck argument * Remove CryptoIdentifier * Remove IdentifierStorage * Remove IdentifierType * Remove SimpleIdentifier * Add missing include
This commit is contained in:
@@ -25,11 +25,6 @@
|
||||
#include <ripple/types/RipplePublicKey.h>
|
||||
#include <ripple/types/UInt160.h>
|
||||
#include <ripple/protocol/UintTypes.h>
|
||||
#include <ripple/types/RippleAccountID.h>
|
||||
#include <ripple/types/RippleAccountPrivateKey.h>
|
||||
#include <ripple/types/RippleAccountPublicKey.h>
|
||||
#include <ripple/types/RipplePrivateKey.h>
|
||||
#include <ripple/types/RipplePublicKeyHash.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -284,61 +279,6 @@ operator>=(RippleAddress const& lhs, RippleAddress const& rhs)
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
/** RipplePublicKeyHash */
|
||||
template <>
|
||||
struct RipplePublicKeyHashTraits::assign <RippleAddress>
|
||||
{
|
||||
void operator() (value_type& value, RippleAddress const& v) const
|
||||
{
|
||||
auto const ui (v.getNodeID ());
|
||||
construct (ui.begin(), ui.end(), value);
|
||||
}
|
||||
};
|
||||
|
||||
/** RipplePrivateKey */
|
||||
template <>
|
||||
struct RipplePrivateKeyTraits::assign <RippleAddress>
|
||||
{
|
||||
void operator() (value_type& value, RippleAddress const& v) const
|
||||
{
|
||||
uint256 const ui (v.getNodePrivate ());
|
||||
construct (ui.begin(), ui.end(), value);
|
||||
}
|
||||
};
|
||||
|
||||
/** RippleAccountID */
|
||||
template <>
|
||||
struct RippleAccountIDTraits::assign <RippleAddress>
|
||||
{
|
||||
void operator() (value_type& value, RippleAddress const& v) const
|
||||
{
|
||||
auto const ui (v.getAccountID ());
|
||||
construct (ui.begin(), ui.end(), value);
|
||||
}
|
||||
};
|
||||
|
||||
/** RippleAccountPublicKey */
|
||||
template <>
|
||||
struct RippleAccountPublicKeyTraits::assign <RippleAddress>
|
||||
{
|
||||
void operator() (value_type& value, RippleAddress const& v) const
|
||||
{
|
||||
Blob const& b (v.getAccountPublic ());
|
||||
construct (&b.front(), &b.back()+1, value);
|
||||
}
|
||||
};
|
||||
|
||||
/** RippleAccountPrivateKey */
|
||||
template <>
|
||||
struct RippleAccountPrivateKeyTraits::assign <RippleAddress>
|
||||
{
|
||||
void operator() (value_type& value, RippleAddress const& v) const
|
||||
{
|
||||
uint256 const ui (v.getAccountPrivate ());
|
||||
construct (ui.begin(), ui.end(), value);
|
||||
}
|
||||
};
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
@@ -981,47 +981,11 @@ public:
|
||||
expect (publicKey.to_string() == deprecatedPublicKey.humanNodePublic(),
|
||||
publicKey.to_string());
|
||||
|
||||
testcase ("RipplePrivateKey");
|
||||
RippleAddress deprecatedPrivateKey (RippleAddress::createNodePrivate (seed));
|
||||
expect (deprecatedPrivateKey.humanNodePrivate () ==
|
||||
"pnen77YEeUd4fFKG7iycBWcwKpTaeFRkW2WFostaATy1DSupwXe",
|
||||
deprecatedPrivateKey.humanNodePrivate ());
|
||||
RipplePrivateKey privateKey (deprecatedPrivateKey);
|
||||
expect (privateKey.to_string() == deprecatedPrivateKey.humanNodePrivate(),
|
||||
privateKey.to_string());
|
||||
|
||||
testcase ("Generator");
|
||||
RippleAddress generator (RippleAddress::createGeneratorPublic (seed));
|
||||
expect (generator.humanGenerator () ==
|
||||
"fhuJKrhSDzV2SkjLn9qbwm5AaRmrxDPfFsHDCP6yfDZWcxDFz4mt",
|
||||
generator.humanGenerator ());
|
||||
|
||||
testcase ("RippleAccountID");
|
||||
RippleAddress deprecatedAccountPublicKey (
|
||||
RippleAddress::createAccountPublic (generator, 0));
|
||||
expect (deprecatedAccountPublicKey.humanAccountID () ==
|
||||
"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
|
||||
deprecatedAccountPublicKey.humanAccountID ());
|
||||
RippleAccountID accountID (deprecatedAccountPublicKey);
|
||||
expect (accountID.to_string() ==
|
||||
deprecatedAccountPublicKey.humanAccountID(),
|
||||
accountID.to_string());
|
||||
|
||||
testcase ("RippleAccountPublicKey");
|
||||
expect (deprecatedAccountPublicKey.humanAccountPublic () ==
|
||||
"aBQG8RQAzjs1eTKFEAQXr2gS4utcDiEC9wmi7pfUPTi27VCahwgw",
|
||||
deprecatedAccountPublicKey.humanAccountPublic ());
|
||||
|
||||
testcase ("RippleAccountPrivateKey");
|
||||
RippleAddress deprecatedAccountPrivateKey (
|
||||
RippleAddress::createAccountPrivate (generator, seed, 0));
|
||||
expect (deprecatedAccountPrivateKey.humanAccountPrivate () ==
|
||||
"p9JfM6HHi64m6mvB6v5k7G2b1cXzGmYiCNJf6GHPKvFTWdeRVjh",
|
||||
deprecatedAccountPrivateKey.humanAccountPrivate ());
|
||||
RippleAccountPrivateKey accountPrivateKey (deprecatedAccountPrivateKey);
|
||||
expect (accountPrivateKey.to_string() ==
|
||||
deprecatedAccountPrivateKey.humanAccountPrivate(),
|
||||
privateKey.to_string());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user