From d660f3921355bd98f817e943bc27f06cbbc19b2e Mon Sep 17 00:00:00 2001 From: adorda <angdmz@gmail.com> Date: Tue, 23 Jul 2019 11:41:54 -0300 Subject: [PATCH] =?UTF-8?q?Corregido=20uso=20de=20bloque=20can=C3=B3nico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gateway/gateway.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gateway/gateway.py b/gateway/gateway.py index 2b6fe31..a278af4 100644 --- a/gateway/gateway.py +++ b/gateway/gateway.py @@ -50,11 +50,14 @@ class NoConnectionException(Exception): class Gateway: + is_poa = False + def __init__(self, provider_generator, is_geth_poa_network=False): self.w3 = Web3(provider_generator.generate_provider()) if is_geth_poa_network: from web3.middleware import geth_poa_middleware self.w3.middleware_stack.inject(geth_poa_middleware, layer=0) + self.is_poa = True if not self.w3.isConnected(): raise InvalidTransactionException("No connection to node") @@ -153,7 +156,7 @@ class Gateway: def get_tx_input(self, contract, tx): return contract.decode_function_input(tx.input) - def transaction_is_canonical(self, transaction): + def block_is_canonical_poa(self, transaction): last_block_number = self.get_last_blocknumber() tx_block_number = transaction.blockNumber required_block_difference = math.ceil(self.get_signers_count() / 2) + 1 -- GitLab