mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improvements to STParsedJSON:
* Cleanups and reduction of copying * Add STArray::back, operator[], push_back(&&) * Add make_stvar * Rework STParsedJSON * Fix code and unit tests that use STParsedJSON * STTx move constructor
This commit is contained in:
@@ -445,15 +445,14 @@ transactionSign (
|
||||
}
|
||||
|
||||
STParsedJSONObject parsed (std::string (jss::tx_json), tx_json);
|
||||
if (!parsed.object.get())
|
||||
if (! parsed.object)
|
||||
{
|
||||
jvResult [jss::error] = parsed.error [jss::error];
|
||||
jvResult [jss::error_code] = parsed.error [jss::error_code];
|
||||
jvResult [jss::error_message] = parsed.error [jss::error_message];
|
||||
return jvResult;
|
||||
}
|
||||
std::unique_ptr<STObject> sopTrans = std::move(parsed.object);
|
||||
sopTrans->setFieldVL (
|
||||
parsed.object->setFieldVL (
|
||||
sfSigningPubKey,
|
||||
keypair.publicKey.getAccountPublic());
|
||||
|
||||
@@ -461,7 +460,7 @@ transactionSign (
|
||||
|
||||
try
|
||||
{
|
||||
stpTrans = std::make_shared<STTx> (*sopTrans);
|
||||
stpTrans = std::make_shared<STTx> (std::move (*parsed.object));
|
||||
}
|
||||
catch (std::exception&)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user