mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make accounts there own type
so we can add new functionality and so they can display properly. Cleanups and missing helper function.
This commit is contained in:
@@ -99,6 +99,11 @@ std::vector<unsigned char> SerializedTransaction::getSignature() const
|
||||
return mSignature.getValue();
|
||||
}
|
||||
|
||||
const std::vector<unsigned char>& SerializedTransaction::peekSignature() const
|
||||
{
|
||||
return mSignature.peekValue();
|
||||
}
|
||||
|
||||
bool SerializedTransaction::sign(CKey& key)
|
||||
{
|
||||
return key.Sign(getSigningHash(), mSignature.peekValue());
|
||||
@@ -156,6 +161,36 @@ void SerializedTransaction::setSequence(uint32 seq)
|
||||
v->setValue(seq);
|
||||
}
|
||||
|
||||
std::vector<unsigned char> SerializedTransaction::getSigningAccount() const
|
||||
{
|
||||
const STVariableLength* v=
|
||||
dynamic_cast<const STVariableLength*>(mMiddleTxn.peekAtPIndex(TransactionISigningAccount));
|
||||
if(!v) throw(std::runtime_error("corrupt transaction"));
|
||||
return v->getValue();
|
||||
}
|
||||
|
||||
const std::vector<unsigned char>& SerializedTransaction::peekSigningAccount() const
|
||||
{
|
||||
const STVariableLength* v=
|
||||
dynamic_cast<const STVariableLength*>(mMiddleTxn.peekAtPIndex(TransactionISigningAccount));
|
||||
if(!v) throw(std::runtime_error("corrupt transaction"));
|
||||
return v->peekValue();
|
||||
}
|
||||
|
||||
std::vector<unsigned char>& SerializedTransaction::peekSigningAccount()
|
||||
{
|
||||
STVariableLength* v=dynamic_cast<STVariableLength*>(mMiddleTxn.getPIndex(TransactionISigningAccount));
|
||||
if(!v) throw(std::runtime_error("corrupt transaction"));
|
||||
return v->peekValue();
|
||||
}
|
||||
|
||||
void SerializedTransaction::setSigningAccount(const std::vector<unsigned char>& s)
|
||||
{
|
||||
STVariableLength* v=dynamic_cast<STVariableLength*>(mMiddleTxn.getPIndex(TransactionISigningAccount));
|
||||
if(!v) throw(std::runtime_error("corrupt transaction"));
|
||||
v->setValue(s);
|
||||
}
|
||||
|
||||
int SerializedTransaction::getITFieldIndex(SOE_Field field) const
|
||||
{
|
||||
return mInnerTxn.getFieldIndex(field);
|
||||
|
||||
Reference in New Issue
Block a user