Refine View interfaces:

This shores up the View interface support for contextual
transaction processing by putting params in the View, and
provides support for replacing the open ledger with the
open MetaView.

Transaction metadata is now part of the View interface.
Stacked MetaViews correctly apply their transaction
metadata to the parent.

* Add lastCloseTime to View
* Add insertTx to View, implement in MetaView
* Add View::txExists for transaction checking
* Add Fees to View, cache fees in Ledger and MetaView
* Use ViewFlags in View
* Use tapENABLE_TESTING flag for features
* Use cached Fees in View
* Rename to ViewFlags
* Move FreezeHandling to View.h, remove ViewAPIBasics.h
* Remove BasicView::parent hack
* Remove calls to getLedger in Transactors
This commit is contained in:
Vinnie Falco
2015-06-25 12:29:48 -07:00
committed by Nik Bougalis
parent 2fc8d70655
commit 57689c4e66
53 changed files with 1046 additions and 753 deletions

View File

@@ -48,7 +48,7 @@ private:
public:
SetSignerList (
STTx const& txn,
TransactionEngineParams params,
ViewFlags params,
TransactionEngine* engine)
: Transactor (
txn,
@@ -224,8 +224,9 @@ SetSignerList::replaceSignerList (uint256 const& index)
std::uint32_t const oldOwnerCount = mTxnAccount->getFieldU32 (sfOwnerCount);
std::uint32_t const addedOwnerCount = ownerCountDelta (signers_.size ());
std::uint64_t const newReserve =
mEngine->getLedger ()->getReserve (oldOwnerCount + addedOwnerCount);
auto const newReserve =
mEngine->view().fees().accountReserve(
oldOwnerCount + addedOwnerCount);
// We check the reserve against the starting balance because we want to
// allow dipping into the reserve to pay fees. This behavior is consistent
@@ -359,11 +360,13 @@ SetSignerList::ownerCountDelta (std::size_t entryCount)
TER
transact_SetSignerList (
STTx const& txn,
TransactionEngineParams params,
ViewFlags params,
TransactionEngine* engine)
{
if (! engine->enableMultiSign())
#if ! RIPPLE_ENABLE_MULTI_SIGN
if (! (engine->view().flags() & tapENABLE_TESTING))
return temDISABLED;
#endif
return SetSignerList (txn, params, engine).apply ();
}