Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-gateway
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Agustin Dorda
django-gateway
Commits
99faf5e6
Commit
99faf5e6
authored
6 years ago
by
angdmz
Browse files
Options
Downloads
Patches
Plain Diff
validacion de bloque canonico y validacion de address
parent
601ab089
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gateway/gateway.py
+8
-2
8 additions, 2 deletions
gateway/gateway.py
with
8 additions
and
2 deletions
gateway/gateway.py
+
8
−
2
View file @
99faf5e6
...
@@ -153,9 +153,9 @@ class Gateway:
...
@@ -153,9 +153,9 @@ class Gateway:
def
get_tx_input
(
self
,
contract
,
tx
):
def
get_tx_input
(
self
,
contract
,
tx
):
return
contract
.
decode_function_input
(
tx
.
input
)
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
()
last_block_number
=
self
.
get_last_blocknumber
()
tx_block_number
=
transaction
.
block
N
umber
tx_block_number
=
block
_n
umber
required_block_difference
=
math
.
ceil
(
self
.
get_signers_count
()
/
2
)
+
1
required_block_difference
=
math
.
ceil
(
self
.
get_signers_count
()
/
2
)
+
1
return
(
last_block_number
-
tx_block_number
)
>
required_block_difference
return
(
last_block_number
-
tx_block_number
)
>
required_block_difference
...
@@ -328,3 +328,9 @@ class HTTPFastLogSearcher:
...
@@ -328,3 +328,9 @@ class HTTPFastLogSearcher:
for
i
in
v
:
for
i
in
v
:
res
.
append
(
i
)
res
.
append
(
i
)
return
res
return
res
class
AddressValidation
:
def
is_valid
(
self
,
address
):
return
Web3
.
isAddress
(
address
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment