If I understand correctly, the hope is that the using
statements that you have right now will be removed in the future as we find better interfaces/boundaries between our modules?
Yes, but I think this change is good whether or not that happens. The using
statements just show places where module boundaries are being crossed. In general it’s better if modules are self-contained and boundaries are crossed in fewer places. But it’s useful in any case to be able to see the places where boundaries are crossed and not have hidden dependencies.
I can see how that would work for src/index/ code and interfaces::Chain
, but I’m wondering how we’d get rid of cases like the various places with using node::NodeContext;
, or perhaps these cases are ones where we want to keep the using
statements?
Just if you move the code using node::NodeContext
inside the node
namespace, then you no longer need node::
prefixes or using
statements to reference it. This is what I was referring to with the src/node/rpc/
src/node/test/
idea above, but that’s just one possible way the node module could be more self-contained.
(Also NodeContext
is kind of a weird case because it’s the one node identifier that begins with word “node”. I was thinking of making a followup PR that would remove all using node::NodeContext
and rename node::NodeContext
to node::Context
and rename wallet::WalletContext
to wallet::Context
. Would be purely an aesthetic change, though, and low on the priority list.)