Add Env::meta()

This commit is contained in:
Vinnie Falco
2015-07-28 17:00:33 -07:00
committed by Nik Bougalis
parent 13b33b5d4d
commit 2cc12b2f2f
3 changed files with 45 additions and 7 deletions

View File

@@ -344,6 +344,17 @@ public:
}
/** @} */
/** Return metadata for the last JTx.
Effects:
The open ledger is closed as if by a call
to close(). The metadata for the last
transaction ID, if any, is returned.
*/
std::shared_ptr<STObject const>
meta();
private:
void
fund (bool setDefaultRipple,
@@ -446,6 +457,7 @@ protected:
int trace_ = 0;
bool testing_ = true;
TestStopwatch stopwatch_;
uint256 txid_;
void
autofill_sig (JTx& jt);

View File

@@ -258,6 +258,7 @@ Env::submit (JTx const& jt)
auto const& stx = jt.stx;
if (stx)
{
txid_ = stx->getTransactionID();
openLedger.modify(
[&](OpenView& view, beast::Journal j)
{
@@ -297,6 +298,14 @@ Env::submit (JTx const& jt)
// held.insert(stx);
}
std::shared_ptr<STObject const>
Env::meta()
{
close();
auto const item = closed()->txRead(txid_);
return item.second;
}
void
Env::autofill_sig (JTx& jt)
{