Refactor jtx::Env:

These changes eliminate the Env's OpenLedger member and make
transactions go through the Application associated with each
instance of the Env, making the unit tests follow a code path
closer to the production code path.

* Add Env::open() for open ledger
* Add Env::now()
* Rename to Env::current()

* Inject ManualTimeKeeper in Env Application
* Make Config mutable
* Move setupConfigForUnitTests
* Launch Env Application thread
* Use Application ledgers in Env
* Adjust Application clock on ledger close
* Adjust close time for close resolution
* Scrub obsolete clock types
* Enable features via Env ctor
* Make Env::master Account object global

* Cache SSL context (performance)
* Cache master wallet keys in Ledger ctor (performance)
This commit is contained in:
Vinnie Falco
2015-10-01 09:09:18 -07:00
parent 90466d6cde
commit 1320898fbe
33 changed files with 530 additions and 354 deletions

View File

@@ -149,8 +149,11 @@ public:
auto const switchoverTime = STAmountCalcSwitchovers::enableUnderflowFixCloseTime ();
for (auto timeDelta : {-10s, 10s}){
NetClock::time_point const closeTime = switchoverTime + timeDelta;
for (auto timeDelta : {
- env.closed()->info().closeTimeResolution,
env.closed()->info().closeTimeResolution} )
{
auto const closeTime = switchoverTime + timeDelta;
STAmountCalcSwitchovers switchover (closeTime);
env.close (closeTime);
// Will fail without the underflow fix