It's useful to use web3.eth.accounts for things like:
Acocunts used with the new in-flight transaction signing middleware will not show up in this list.
Add a conditional to the constructor for the transaction signing middleware that when set truthy will inject any addresses it can sign for into the returned accounts list. Logic should include checks to ensure that addresses are not duplicated in the returned list.
link #649
@pipermerriam is this something team gitcoin should/could bounty?
@owocki yes, but it's dependent on #649 being merged as well as a bit of confirmation from @dylanjw and/or @carver on whether they agree with how this should be implemented.
Yeah, that sounds good to me. I'd even advocate to drop the flag altogether, and always inject the addresses, until someone requests the feature of not injecting the addresses. It's much easier to add the flag in a minor point release than to remove it at the next major release, if we decide we don't want to support it.
Also, if strict is on, maybe we should strip out the node's addresses, since we can't use them anyway.
I think I'm +1 on address injection, though I am inclined to advocate for the same solution I suggest in #649 which is to implement the address injection as a stand-alone middleware and to write a new utility function merge_middlewares or combine_middlewares which wraps up multiple middlewares into a single unit.
note that combine_middlewares is already a function we use inweb3.middlewares.combine_middlwares, though I'd advocate for renaming that function to something like compile_middlewares
I agree with the middleware approach. So, in order to have it included by default, we would provide a merged middleware, and document that as _the_ primary local signing middleware?
Most helpful comment
I agree with the middleware approach. So, in order to have it included by default, we would provide a merged middleware, and document that as _the_ primary local signing middleware?