Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
c12bf917
Commit
c12bf917
authored
Dec 23, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linting issues; issue with deploy
parent
8ccc4cdd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
21 deletions
+26
-21
contractDropdown.js
src/app/tabs/runTab/contractDropdown.js
+2
-2
dropdownlogic.js
src/app/tabs/runTab/model/dropdownlogic.js
+23
-18
run-tab.js
src/app/udapp/run-tab.js
+1
-1
No files found.
src/app/tabs/runTab/contractDropdown.js
View file @
c12bf917
...
...
@@ -107,7 +107,7 @@ class ContractDropdownUI {
}
const
selectedContract
=
this
.
getSelectedContract
()
const
clickCallback
=
(
valArray
,
inputsValues
)
=>
{
const
clickCallback
=
async
(
valArray
,
inputsValues
)
=>
{
var
selectedContract
=
this
.
getSelectedContract
()
this
.
createInstance
(
selectedContract
,
inputsValues
)
}
...
...
@@ -130,7 +130,7 @@ class ContractDropdownUI {
return
this
.
dropdownLogic
.
getSelectedContract
(
contractName
,
compilerAtributeName
)
}
createInstance
(
selectedContract
,
args
)
{
async
createInstance
(
selectedContract
,
args
)
{
if
(
selectedContract
.
bytecodeObject
.
length
===
0
)
{
return
modalDialogCustom
.
alert
(
'This contract may be abstract, not implement an abstract parent
\'
s methods completely or not invoke an inherited contract
\'
s constructor correctly.'
)
}
...
...
src/app/tabs/runTab/model/dropdownlogic.js
View file @
c12bf917
...
...
@@ -149,22 +149,27 @@ class DropdownLogic {
)
}
determineGasFees
(
gasPrice
,
cb
)
{
let
txFeeText
,
priceStatus
// TODO: this try catch feels like an anti pattern, can/should be
// removed, but for now keeping the original logic
try
{
var
fee
=
this
.
calculateFee
(
tx
.
gas
,
gasPrice
)
txFeeText
=
' '
+
this
.
fromWei
(
fee
,
false
,
'ether'
)
+
' Ether'
priceStatus
=
true
}
catch
(
e
)
{
txFeeText
=
' Please fix this issue before sending any transaction. '
+
e
.
message
priceStatus
=
false
// determineGasFees (gasPrice, cb) {
determineGasFees
(
tx
)
{
const
determineGasFeesCb
=
(
gasPrice
,
cb
)
=>
{
let
txFeeText
,
priceStatus
// TODO: this try catch feels like an anti pattern, can/should be
// removed, but for now keeping the original logic
try
{
var
fee
=
this
.
calculateFee
(
tx
.
gas
,
gasPrice
)
txFeeText
=
' '
+
this
.
fromWei
(
fee
,
false
,
'ether'
)
+
' Ether'
priceStatus
=
true
}
catch
(
e
)
{
txFeeText
=
' Please fix this issue before sending any transaction. '
+
e
.
message
priceStatus
=
false
}
cb
(
txFeeText
,
priceStatus
)
}
cb
(
txFeeText
,
priceStatus
)
return
determineGasFeesCb
}
determineGasPrice
(
cb
)
{
determineGasPrice
(
cb
)
{
this
.
getGasPrice
((
error
,
gasPrice
)
=>
{
var
warnMessage
=
' Please fix this issue before sending any transaction. '
if
(
error
)
{
...
...
@@ -179,13 +184,13 @@ class DropdownLogic {
})
}
getConfirmationCb
(
modalDialog
,
confirmDialog
)
{
getConfirmationCb
(
modalDialog
,
confirmDialog
)
{
const
confirmationCb
=
(
network
,
tx
,
gasEstimation
,
continueTxExecution
,
cancelCb
)
=>
{
if
(
network
.
name
!==
'Main'
)
{
return
continueTxExecution
(
null
)
}
const
amount
=
this
.
fromWei
(
tx
.
value
,
true
,
'ether'
)
const
content
=
confirmDialog
(
tx
,
amount
,
gasEstimation
,
null
,
this
.
determineGasFees
,
this
.
determineGasPrice
)
const
content
=
confirmDialog
(
tx
,
amount
,
gasEstimation
,
null
,
this
.
determineGasFees
(
tx
)
,
this
.
determineGasPrice
)
modalDialog
(
'Confirm transaction'
,
content
,
{
label
:
'Confirm'
,
...
...
@@ -215,12 +220,12 @@ class DropdownLogic {
this
.
udapp
.
runTx
(
data
,
confirmationCb
,
continueCb
,
promptCb
,
finalCb
)
}
getCompilerContracts
()
{
getCompilerContracts
()
{
return
this
.
compilersArtefacts
[
'__last'
].
getData
().
contracts
}
async
deploContract
(
selectedContract
,
args
,
contractMetadata
,
compilerContracts
,
callbacks
,
dialogs
)
{
const
{
continueCb
,
promptCb
,
statusCb
,
finalCb
}
=
callbacks
async
deplo
y
Contract
(
selectedContract
,
args
,
contractMetadata
,
compilerContracts
,
callbacks
,
dialogs
)
{
const
{
continueCb
,
promptCb
,
statusCb
,
finalCb
}
=
callbacks
const
{
modalDialog
,
confirmDialog
}
=
dialogs
var
constructor
=
selectedContract
.
getConstructorInterface
()
...
...
src/app/udapp/run-tab.js
View file @
c12bf917
...
...
@@ -134,7 +134,7 @@ export class RunTab extends LibraryPlugin {
const
dropdownLogic
=
new
DropdownLogic
(
this
.
executionContext
,
compilersArtefacts
,
config
,
editor
,
udapp
,
this
)
this
.
contractDropdownUI
=
new
ContractDropdownUI
(
dropdownLogic
,
logCallback
,
this
)
fileManager
.
events
.
on
(
'currentFileChanged'
,
contractDropdownUI
.
changeCurrentFile
.
bind
(
contractDropdownUI
))
fileManager
.
events
.
on
(
'currentFileChanged'
,
this
.
contractDropdownUI
.
changeCurrentFile
.
bind
(
this
.
contractDropdownUI
))
this
.
contractDropdownUI
.
event
.
register
(
'clearInstance'
,
()
=>
{
const
noInstancesText
=
this
.
noInstancesText
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment