mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-03 08:55:52 +00:00
Use addWithoutSigningFields in jtx::sign
This commit is contained in:
committed by
Vinnie Falco
parent
889afd0cbd
commit
90466d6cde
@@ -561,6 +561,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
// Test that jtx can re-sign a transaction that's already been signed.
|
||||
void testResignSigned()
|
||||
{
|
||||
using namespace jtx;
|
||||
Env env(*this);
|
||||
|
||||
env.fund(XRP(10000), "alice");
|
||||
auto const baseFee = env.open()->fees().base;
|
||||
std::uint32_t const aliceSeq = env.seq ("alice");
|
||||
|
||||
// Sign jsonNoop.
|
||||
Json::Value jsonNoop = env.json (
|
||||
noop ("alice"), fee(baseFee), seq(aliceSeq), sig("alice"));
|
||||
// Re-sign jsonNoop.
|
||||
JTx jt = env.jt (jsonNoop);
|
||||
env (jt);
|
||||
}
|
||||
|
||||
void
|
||||
run()
|
||||
{
|
||||
@@ -580,6 +598,7 @@ public:
|
||||
testAdvance();
|
||||
testClose();
|
||||
testPath();
|
||||
testResignSigned();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ sign (Json::Value& jv,
|
||||
strHex(account.pk().slice());
|
||||
Serializer ss;
|
||||
ss.add32 (HashPrefix::txSign);
|
||||
parse(jv).add(ss);
|
||||
parse(jv).addWithoutSigningFields(ss);
|
||||
auto const sig = ripple::sign(
|
||||
*publicKeyType(account.pk().slice()),
|
||||
account.sk(), ss.slice());
|
||||
|
||||
Reference in New Issue
Block a user