From 99faf5e65d08d93281ea6fbd968f34fe0e91a697 Mon Sep 17 00:00:00 2001 From: angdmz <agustindorda@gmail.com> Date: Fri, 19 Jul 2019 19:23:33 -0300 Subject: [PATCH] validacion de bloque canonico y validacion de address --- gateway/gateway.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gateway/gateway.py b/gateway/gateway.py index 2b6fe31..312b221 100644 --- a/gateway/gateway.py +++ b/gateway/gateway.py @@ -153,9 +153,9 @@ 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, block_number): last_block_number = self.get_last_blocknumber() - tx_block_number = transaction.blockNumber + tx_block_number = block_number required_block_difference = math.ceil(self.get_signers_count() / 2) + 1 return (last_block_number - tx_block_number) > required_block_difference @@ -328,3 +328,9 @@ class HTTPFastLogSearcher: for i in v: res.append(i) return res + + +class AddressValidation: + + def is_valid(self, address): + return Web3.isAddress(address) -- GitLab