Refactor AccountID (RIPD-953):

All AccountID functionality is removed from RippleAddress and
replaced with free functions. The AccountID to string conversion
cache is factored out as an explicit type with an instance in
the Application object. New base58 conversion functions are used,
with no dependence on OpenSSL.

All types and free functions related to AccountID are consolidated
into one header file. Routines to operate on "tokens" are also
introduced and consolidated into a single header file.

A token one of the cryptographic primitives used in Ripple:

    Secret Seed
    Server Public Key
    Server Secret Key
    Account ID
    Account Public Key
    Account Private Key

    and these deprecated primitives:

    Account Family Seed
    Account Family Generator
This commit is contained in:
Vinnie Falco
2015-06-18 11:05:18 -07:00
parent 63d438c979
commit 2f485672fa
109 changed files with 1901 additions and 1545 deletions

View File

@@ -215,13 +215,16 @@ public:
// Break the multi-signing hash computation into 2 parts for optimization.
Serializer startMultiSigningData () const;
void finishMultiSigningData (
RippleAddress const& signingForID,
RippleAddress const& signingID, Serializer& s) const;
AccountID const& signingForID,
AccountID const& signingID, Serializer& s) const;
// VFALCO Get functions are usually simple observers but
// this one performs an expensive construction.
//
// Get data to compute a complete multi-signature.
Serializer getMultiSigningData (
RippleAddress const& signingForID,
RippleAddress const& signingID) const;
AccountID const& signingForID,
AccountID const& signingID) const;
const STBase& peekAtIndex (int offset) const
{
@@ -259,8 +262,7 @@ public:
uint160 getFieldH160 (SField const& field) const;
uint256 getFieldH256 (SField const& field) const;
RippleAddress getFieldAccount (SField const& field) const;
AccountID getFieldAccount160 (SField const& field) const;
AccountID getAccountID (SField const& field) const;
Blob getFieldVL (SField const& field) const;
STAmount const& getFieldAmount (SField const& field) const;
@@ -282,11 +284,9 @@ public:
void setFieldH128 (SField const& field, uint128 const&);
void setFieldH256 (SField const& field, uint256 const& );
void setFieldVL (SField const& field, Blob const&);
void setFieldAccount (SField const& field, AccountID const&);
void setFieldAccount (SField const& field, RippleAddress const& addr)
{
setFieldAccount (field, addr.getAccountID ());
}
void setAccountID (SField const& field, AccountID const&);
void setFieldAmount (SField const& field, STAmount const&);
void setFieldPathSet (SField const& field, STPathSet const&);
void setFieldV256 (SField const& field, STVector256 const& v);