Inject Application:

Calls to getApp are replaced with dependency injections.
This commit is contained in:
Vinnie Falco
2015-09-14 14:25:23 -07:00
committed by Edward Hennis
parent f4fe55caff
commit 9b787434c9
132 changed files with 1203 additions and 1063 deletions

View File

@@ -28,6 +28,11 @@
namespace ripple {
TransactionStateSF::TransactionStateSF(Application& app)
: app_ (app)
{
}
// VFALCO This might be better as Blob&&
void TransactionStateSF::gotNode (bool fromFilter,
SHAMapNodeID const& id,
@@ -40,7 +45,7 @@ void TransactionStateSF::gotNode (bool fromFilter,
// and this should use that Database instad of getNodeStore
assert(type !=
SHAMapTreeNode::tnTRANSACTION_NM);
getApp().getNodeStore().store(
app_.getNodeStore().store(
hotTRANSACTION_NODE,
std::move (nodeData), nodeHash);
}
@@ -49,7 +54,7 @@ bool TransactionStateSF::haveNode (SHAMapNodeID const& id,
uint256 const& nodeHash,
Blob& nodeData)
{
return getApp().getLedgerMaster ().getFetchPack (nodeHash, nodeData);
return app_.getLedgerMaster ().getFetchPack (nodeHash, nodeData);
}
} // ripple