mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
sign_for RPC command (RIPD-182):
The sign_for RPC command returns a field suitable for signing a multi-signed transaction. Actual multi-signed transactions are in the next commit.
This commit is contained in:
committed by
Vinnie Falco
parent
64ebd64d2b
commit
cf1638e6de
@@ -21,6 +21,7 @@
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/json/json_reader.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/HashPrefix.h>
|
||||
#include <ripple/protocol/InnerObjectFormats.h>
|
||||
#include <ripple/protocol/STBase.h>
|
||||
#include <ripple/protocol/STAccount.h>
|
||||
@@ -337,6 +338,34 @@ uint256 STObject::getSigningHash (std::uint32_t prefix) const
|
||||
return s.getSHA512Half ();
|
||||
}
|
||||
|
||||
Serializer
|
||||
STObject::startMultiSigningData () const
|
||||
{
|
||||
Serializer s;
|
||||
s.add32 (HashPrefix::txMultiSign);
|
||||
add (s, false);
|
||||
return s;
|
||||
}
|
||||
|
||||
void
|
||||
STObject::finishMultiSigningData (
|
||||
RippleAddress const& signingForID,
|
||||
RippleAddress const& signingID,
|
||||
Serializer& s) const
|
||||
{
|
||||
s.add160 (signingForID.getAccountID ());
|
||||
s.add160 (signingID.getAccountID ());
|
||||
}
|
||||
|
||||
Serializer
|
||||
STObject::getMultiSigningData (
|
||||
RippleAddress const& signingForID, RippleAddress const& signingID) const
|
||||
{
|
||||
Serializer s (startMultiSigningData ());
|
||||
finishMultiSigningData (signingForID, signingID, s);
|
||||
return s;
|
||||
}
|
||||
|
||||
int STObject::getFieldIndex (SField const& field) const
|
||||
{
|
||||
if (mType != nullptr)
|
||||
|
||||
Reference in New Issue
Block a user