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
d56ed42e
Commit
d56ed42e
authored
5 years ago
by
adorda
Browse files
Options
Downloads
Patches
Plain Diff
Arreglados problemas de parametros en constructor
parent
13e27fcc
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
+6
-4
6 additions, 4 deletions
gateway/gateway.py
with
6 additions
and
4 deletions
gateway/gateway.py
+
6
−
4
View file @
d56ed42e
...
...
@@ -204,21 +204,23 @@ class ContractDeployer:
def
__init__
(
self
,
gateway
):
self
.
gateway
=
gateway
def
deploy_contract
(
self
,
abi
,
bytecode
,
gas
,
from_account
,
wait
=
False
):
def
deploy_contract
(
self
,
abi
,
bytecode
,
gas
,
from_account
,
params
,
wait
):
if
params
is
None
:
params
=
{}
logger
.
debug
(
"
Deploying contract from account: {}
"
.
format
(
str
(
from_account
)))
contrato
=
self
.
gateway
.
get_undeployed_contract
(
abi
,
bytecode
)
# Submit the transaction that deploys the contract
tx_hash
=
contrato
.
constructor
().
transact
({
'
from
'
:
from_account
,
'
gas
'
:
gas
,
'
gasLimit
'
:
gas
})
tx_hash
=
contrato
.
constructor
(
**
params
).
transact
({
'
from
'
:
from_account
,
'
gas
'
:
gas
,
'
gasLimit
'
:
gas
})
logger
.
debug
(
"
Transaction hash for contract deploy : {}
"
.
format
(
str
(
tx_hash
.
hex
())))
# Wait for the transaction to be mined, and get the transaction receipt
tx_receipt
=
self
.
gateway
.
get_receipt
(
tx_hash
,
wait
)
logger
.
debug
(
"
Receipt for contract deploy: {}
"
.
format
(
str
(
tx_receipt
)))
return
tx_receipt
def
estimate_deploy
(
self
,
abi
,
bytecode
):
def
estimate_deploy
(
self
,
abi
,
bytecode
,
params
):
contrato
=
self
.
gateway
.
get_undeployed_contract
(
abi
,
bytecode
)
return
contrato
.
constructor
().
estimateGas
()
return
contrato
.
constructor
(
**
params
).
estimateGas
()
class
HTTPFastLogSearcher
:
...
...
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