Skip to content

Instantly share code, notes, and snippets.

@feuGeneA
Created November 7, 2018 14:24
Show Gist options
  • Save feuGeneA/eed20d7e62bebb93957adc8335006df3 to your computer and use it in GitHub Desktop.
Save feuGeneA/eed20d7e62bebb93957adc8335006df3 to your computer and use it in GitHub Desktop.
______________________________________________ test_is_valid_signature__oddball_provider ______________________________________________
def test_is_valid_signature__oddball_provider():
"""Test that passing in a weird provider still works."""
class MyProvider:
def make_request(self, method, params):
provider = Web3.HTTPProvider("http://127.0.0.1:8545")
return provider.make_request(method, params)
(is_valid, reason) = is_valid_signature(
MyProvider(),
'0x6927e990021d23b1eb7b8789f6a6feaf98fe104bb0cf8259421b79f9a34222b0',
'0x1B61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc3340349190569279751135161d22529dc25add4f6069af05be04cacbda2ace225403',
> '0x5409ed021d9299bf6814279a6a1411a7e866a631',
)
test/test_signature_utils.py:142:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/zero_ex/order_utils/signature_utils.py:61: in is_valid_signature
network_id = web3_instance.net.version
../../../.pythonz/lib/python3.7/site-packages/web3-4.7.2-py3.7.egg/web3/net.py:21: in version
return self.web3.manager.request_blocking("net_version", [])
../../../.pythonz/lib/python3.7/site-packages/web3-4.7.2-py3.7.egg/web3/manager.py:109: in request_blocking
response = self._make_request(method, params)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <web3.manager.RequestManager object at 0x7fea0e63c3c8>, method = 'net_version', params = []
def _make_request(self, method, params):
for provider in self.providers:
> request_func = provider.request_func(self.web3, tuple(self.middleware_stack))
E AttributeError: 'MyProvider' object has no attribute 'request_func'
../../../.pythonz/lib/python3.7/site-packages/web3-4.7.2-py3.7.egg/web3/manager.py:89: AttributeError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment