Skip to content
Snippets Groups Projects
Commit 74cfb49b authored by adorda's avatar adorda
Browse files

conexion ipc y signers count

parent 696ec951
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,11 @@ def generate_http_gateway(url, is_poa): ...@@ -17,6 +17,11 @@ def generate_http_gateway(url, is_poa):
return Gateway(provider_generator, is_poa) return Gateway(provider_generator, is_poa)
def generate_ipc_gateway(url, is_poa):
provider_generator = IPCProviderGenerator(url)
return Gateway(provider_generator, is_poa)
class HTTPProviderGenerator: class HTTPProviderGenerator:
def __init__(self, url): def __init__(self, url):
...@@ -26,6 +31,15 @@ class HTTPProviderGenerator: ...@@ -26,6 +31,15 @@ class HTTPProviderGenerator:
return Web3.HTTPProvider(self.url) return Web3.HTTPProvider(self.url)
class IPCProviderGenerator:
def __init__(self, ipc_path):
self.ipc_path = ipc_path
def generate_provider(self):
return Web3.IPCProvider(self.ipc_path)
class InvalidTransactionException(Exception): class InvalidTransactionException(Exception):
pass pass
...@@ -154,7 +168,7 @@ class Gateway: ...@@ -154,7 +168,7 @@ class Gateway:
return txs return txs
def get_signers_count(self): def get_signers_count(self):
return 10 return self.w3.manager.request_blocking("clique_getSigners", [])
def get_smart_contract_bytecode(self, smart_contract_address): def get_smart_contract_bytecode(self, smart_contract_address):
return self.w3.eth.getCode(smart_contract_address) return self.w3.eth.getCode(smart_contract_address)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment