mirror of https://github.com/nucypher/nucypher.git
set the active provider on RPC condition when configured
parent
280fe0d0f9
commit
41b28ab05d
|
@ -152,6 +152,7 @@ class RPCCondition(AccessControlCondition):
|
||||||
# internal
|
# internal
|
||||||
self.name = name
|
self.name = name
|
||||||
self.chain = chain
|
self.chain = chain
|
||||||
|
self.provider: Optional[BaseProvider] = None # set in _configure_provider
|
||||||
self.method = self.validate_method(method=method)
|
self.method = self.validate_method(method=method)
|
||||||
|
|
||||||
# test
|
# test
|
||||||
|
@ -188,6 +189,7 @@ class RPCCondition(AccessControlCondition):
|
||||||
|
|
||||||
def _configure_w3(self, provider: BaseProvider) -> Web3:
|
def _configure_w3(self, provider: BaseProvider) -> Web3:
|
||||||
# Instantiate a local web3 instance
|
# Instantiate a local web3 instance
|
||||||
|
self.provider = provider
|
||||||
w3 = Web3(provider)
|
w3 = Web3(provider)
|
||||||
if self.chain in POA_CHAINS:
|
if self.chain in POA_CHAINS:
|
||||||
# inject web3 middleware to handle POA chain extra_data field.
|
# inject web3 middleware to handle POA chain extra_data field.
|
||||||
|
|
Loading…
Reference in New Issue