diff --git a/gateway/gateway.py b/gateway/gateway.py index 2b6fe3111bc3d8ebea27902554a4d158a5effcbb..a278af44e57614a268bfbedac68b28dde540b07a 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