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
b53f594b
Unverified
Commit
b53f594b
authored
Sep 18, 2018
by
yann300
Committed by
GitHub
Sep 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1523 from ethereum/variousFixes
Various fixes
parents
b6d94b2e
50486e47
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
77 additions
and
30 deletions
+77
-30
config.yml
.circleci/config.yml
+4
-4
browser_tests.sh
ci/browser_tests.sh
+1
-1
browser_tests_debugger.sh
ci/browser_tests_debugger.sh
+1
-1
debugger.js
src/app/debugger/debugger.js
+2
-2
contextView.js
src/app/editor/contextView.js
+1
-1
contextualListener.js
src/app/editor/contextualListener.js
+1
-1
pluginAPI.js
src/app/plugin/pluginAPI.js
+4
-0
staticAnalysisView.js
src/app/staticanalysis/staticAnalysisView.js
+1
-1
compile-tab.js
src/app/tabs/compile-tab.js
+1
-1
run-tab.js
src/app/tabs/run-tab.js
+29
-9
run-tab-styles.js
src/app/tabs/styles/run-tab-styles.js
+14
-3
cmdInterpreterAPI.js
src/lib/cmdInterpreterAPI.js
+11
-2
offsetToLineColumnConverter.js
src/lib/offsetToLineColumnConverter.js
+7
-2
multiParamManager.js
src/multiParamManager.js
+0
-2
No files found.
.circleci/config.yml
View file @
b53f594b
...
...
@@ -26,10 +26,10 @@ jobs:
-
checkout
-
restore_cache
:
keys
:
-
dep-bundle-2
1
-{{ checksum "package.json" }}
-
dep-bundle-2
2
-{{ checksum "package.json" }}
-
run
:
npm install
-
save_cache
:
key
:
dep-bundle-2
1
-{{ checksum "package.json" }}
key
:
dep-bundle-2
2
-{{ checksum "package.json" }}
paths
:
-
~/repo/node_modules
-
run
:
npm run lint && npm run test && npm run make-mock-compiler && npm run build
...
...
@@ -46,10 +46,10 @@ jobs:
-
checkout
-
restore_cache
:
keys
:
-
dep-bundle-1
6
-{{ checksum "package.json" }}
-
dep-bundle-1
7
-{{ checksum "package.json" }}
-
run
:
npm install
-
save_cache
:
key
:
dep-bundle-1
6
-{{ checksum "package.json" }}
key
:
dep-bundle-1
7
-{{ checksum "package.json" }}
paths
:
-
~/repo/node_modules
-
run
:
npm run build_debugger
...
...
ci/browser_tests.sh
View file @
b53f594b
...
...
@@ -19,7 +19,7 @@ else
OS
=
"linux"
FILEFORMAT
=
"tar.gz"
fi
SC_VERSION
=
"4.
4.1
1"
SC_VERSION
=
"4.
5.
1"
SAUCECONNECT_URL
=
"https://saucelabs.com/downloads/sc-
$SC_VERSION
-
$OS
.
$FILEFORMAT
"
SAUCECONNECT_USERNAME
=
"chriseth"
SAUCECONNECT_ACCESSKEY
=
"b781828a-9e9c-43d8-89d4-2fbb879595ca"
...
...
ci/browser_tests_debugger.sh
View file @
b53f594b
...
...
@@ -10,7 +10,7 @@ else
OS
=
"linux"
FILEFORMAT
=
"tar.gz"
fi
SC_VERSION
=
"4.
4.1
1"
SC_VERSION
=
"4.
5.
1"
SAUCECONNECT_URL
=
"https://saucelabs.com/downloads/sc-
$SC_VERSION
-
$OS
.
$FILEFORMAT
"
SAUCECONNECT_USERNAME
=
"yanneth"
SAUCECONNECT_ACCESSKEY
=
"1f5a4560-b02b-41aa-b52b-f033aad30870"
...
...
src/app/debugger/debugger.js
View file @
b53f594b
...
...
@@ -39,7 +39,7 @@ function Debugger (container, sourceHighlighter, localRegistry) {
this
.
isActive
=
false
this
.
breakPointManager
=
new
remixLib
.
code
.
BreakpointManager
(
this
.
debugger
,
(
sourceLocation
)
=>
{
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
this
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
},
(
step
)
=>
{
this
.
debugger_ui
.
stepManager
.
jumpTo
(
step
)
})
...
...
@@ -80,7 +80,7 @@ function Debugger (container, sourceHighlighter, localRegistry) {
if
(
error
)
return
console
.
log
(
error
)
self
.
debugger
.
callTree
.
sourceLocationTracker
.
getSourceLocationFromVMTraceIndex
(
address
,
index
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
contracts
,
function
(
error
,
rawLocation
)
{
if
(
!
error
&&
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
lineColumnPos
,
rawLocation
)
}
else
{
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
null
)
...
...
src/app/editor/contextView.js
View file @
b53f594b
...
...
@@ -98,7 +98,7 @@ class ContextView {
}
}
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
var
filename
=
self
.
_deps
.
compiler
.
getSourceName
(
position
.
file
)
// TODO: refactor with rendererAPI.errorClick
if
(
filename
!==
self
.
_deps
.
config
.
get
(
'currentFile'
))
{
...
...
src/app/editor/contextualListener.js
View file @
b53f594b
...
...
@@ -114,7 +114,7 @@ class ContextualListener {
_highlightInternal
(
position
,
node
)
{
var
self
=
this
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
lineColumn
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
position
,
position
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
var
css
=
'highlightreference'
if
(
node
.
children
&&
node
.
children
.
length
)
{
// If node has children, highlight the entire line. if not, just highlight the current source position of the node.
...
...
src/app/plugin/pluginAPI.js
View file @
b53f594b
...
...
@@ -127,6 +127,10 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
highlighter
.
currentSourceLocation
(
null
)
highlighter
.
currentSourceLocationFromfileName
(
position
,
filePath
,
hexColor
)
cb
()
},
discardHighlight
:
(
mod
,
cb
)
=>
{
highlighter
.
currentSourceLocation
(
null
)
cb
()
}
}
}
...
...
src/app/staticanalysis/staticAnalysisView.js
View file @
b53f594b
...
...
@@ -97,7 +97,7 @@ staticAnalysisView.prototype.run = function () {
start
:
parseInt
(
split
[
0
]),
length
:
parseInt
(
split
[
1
])
}
location
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
file
,
self
.
lastCompilationSource
.
sources
)
location
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
parseInt
(
file
),
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
location
=
Object
.
keys
(
self
.
lastCompilationResult
.
contracts
)[
file
]
+
':'
+
(
location
.
start
.
line
+
1
)
+
':'
+
(
location
.
start
.
column
+
1
)
+
':'
}
warningCount
++
...
...
src/app/tabs/compile-tab.js
View file @
b53f594b
...
...
@@ -615,7 +615,7 @@ const css = csjs`
color:
${
styles
.
rightPanel
.
modalDialog_text_Secondary
}
;
}
.icon {
margin-right:
3%
;
margin-right:
0.3em
;
}
.spinningIcon {
margin-right: .3em;
...
...
src/app/tabs/run-tab.js
View file @
b53f594b
...
...
@@ -292,6 +292,7 @@ function contractDropdown (events, self) {
instanceContainer
.
appendChild
(
instanceContainerTitle
)
instanceContainer
.
appendChild
(
self
.
_view
.
noInstancesText
)
var
compFails
=
yo
`<i title="Contract compilation failed. Please check the compile tab for more information." class="fa fa-times-circle
${
css
.
errorIcon
}
" ></i>`
var
info
=
yo
`<i class="fa fa-info
${
css
.
infoDeployAction
}
" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>`
self
.
_deps
.
compiler
.
event
.
register
(
'compilationFinished'
,
function
(
success
,
data
,
source
)
{
getContractNames
(
success
,
data
)
if
(
success
)
{
...
...
@@ -303,6 +304,25 @@ function contractDropdown (events, self) {
}
})
var
deployAction
=
(
value
)
=>
{
self
.
_view
.
createPanel
.
style
.
display
=
value
self
.
_view
.
orLabel
.
style
.
display
=
value
}
self
.
_deps
.
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
currentFile
)
=>
{
document
.
querySelector
(
`.
${
css
.
contractNames
}
`
).
classList
.
remove
(
css
.
contractNamesError
)
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
contractNames
.
innerHTML
=
''
if
(
/.
(
.abi
)
$/
.
exec
(
currentFile
))
{
deployAction
(
'none'
)
compFails
.
style
.
display
=
'none'
contractNames
.
appendChild
(
yo
`<option>(abi)</option>`
)
selectContractNames
.
setAttribute
(
'disabled'
,
true
)
}
else
if
(
/.
(
.sol
)
$/
.
exec
(
currentFile
))
{
deployAction
(
'block'
)
}
})
var
atAddressButtonInput
=
yo
`<input class="
${
css
.
input
}
ataddressinput" placeholder="Load contract from Address" title="atAddress" />`
var
selectContractNames
=
yo
`<select class="
${
css
.
contractNames
}
" disabled></select>`
...
...
@@ -317,15 +337,16 @@ function contractDropdown (events, self) {
return
null
}
var
createPanel
=
yo
`<div class="
${
css
.
button
}
"></div>`
self
.
_view
.
createPanel
=
yo
`<div class="
${
css
.
button
}
"></div>`
self
.
_view
.
orLabel
=
yo
`<div class="
${
css
.
orLabel
}
">or</div>`
var
el
=
yo
`
<div class="
${
css
.
container
}
">
<div class="
${
css
.
subcontainer
}
">
${
selectContractNames
}
${
compFails
}
${
selectContractNames
}
${
compFails
}
${
info
}
</div>
<div class="
${
css
.
buttons
}
">
${
createPanel
}
<div>
${
self
.
_view
.
createPanel
}
${
self
.
_view
.
orLabel
}
<div class="
${
css
.
button
}
${
css
.
atAddressSect
}
">
<div class="
${
css
.
atAddress
}
" onclick=
${
function
()
{
loadFromAddress
()
}
}>At Address</div>
${
atAddressButtonInput
}
...
...
@@ -335,17 +356,17 @@ function contractDropdown (events, self) {
`
function
setInputParamsPlaceHolder
()
{
createPanel
.
innerHTML
=
''
self
.
_view
.
createPanel
.
innerHTML
=
''
if
(
self
.
_deps
.
compiler
.
getContract
&&
selectContractNames
.
selectedIndex
>=
0
&&
selectContractNames
.
children
.
length
>
0
)
{
var
ctrabi
=
txHelper
.
getConstructorInterface
(
getSelectedContract
().
contract
.
object
.
abi
)
var
ctrEVMbc
=
getSelectedContract
().
contract
.
object
.
evm
.
bytecode
.
object
var
createConstructorInstance
=
new
MultiParamManager
(
0
,
ctrabi
,
(
valArray
,
inputsValues
)
=>
{
createInstance
(
inputsValues
)
},
txHelper
.
inputParametersDeclarationToString
(
ctrabi
.
inputs
),
'Deploy'
,
ctrEVMbc
)
createPanel
.
appendChild
(
createConstructorInstance
.
render
())
self
.
_view
.
createPanel
.
appendChild
(
createConstructorInstance
.
render
())
return
}
else
{
createPanel
.
innerHTML
=
'No compiled contracts'
self
.
_view
.
createPanel
.
innerHTML
=
'No compiled contracts'
}
}
...
...
@@ -624,7 +645,6 @@ function settings (container, self) {
function
newAccount
()
{
self
.
_deps
.
udapp
.
newAccount
(
''
,
(
error
,
address
)
=>
{
if
(
!
error
)
{
container
.
querySelector
(
'#txorigin'
).
appendChild
(
yo
`<option value=
${
address
}
>
${
address
}
</option>`
)
addTooltip
(
`account
${
address
}
created`
)
}
else
{
addTooltip
(
'Cannot create an account: '
+
error
)
...
...
src/app/tabs/styles/run-tab-styles.js
View file @
b53f594b
...
...
@@ -124,7 +124,7 @@ var css = csjs`
.button {
display: flex;
align-items: center;
margin-top:
2%
;
margin-top:
13px
;
}
.transaction {
${
styles
.
rightPanel
.
runTab
.
button_transaction
}
...
...
@@ -140,6 +140,9 @@ var css = csjs`
border-bottom-right-radius: 0;
border-right: 0;
}
.atAddressSect {
margin-top: 6px;
}
.atAddressSect input {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
...
...
@@ -148,7 +151,8 @@ var css = csjs`
${
styles
.
rightPanel
.
runTab
.
button_Create
}
}
.input {
${
styles
.
rightPanel
.
runTab
.
input_RunTab
}
${
styles
.
rightPanel
.
runTab
.
input_RunTab
}
;
font-size: 10px;
}
.noInstancesText {
${
styles
.
rightPanel
.
runTab
.
box_Instance
}
...
...
@@ -233,7 +237,14 @@ var css = csjs`
justify-content: space-evenly;
${
styles
.
rightPanel
.
runTab
.
box_Info_RunTab
}
;
width: 145px;
}
}
.orLabel {
margin-left: 44px;
}
.infoDeployAction {
margin-left: 5px;
font-size: 13px;
}
`
module
.
exports
=
css
src/lib/cmdInterpreterAPI.js
View file @
b53f594b
...
...
@@ -28,6 +28,7 @@ class CmdInterpreterAPI {
offsetToLineColumnConverter
:
self
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
}
self
.
commandHelp
=
{
'remix.getFile(path)'
:
'Returns te content of the file located at the given path'
,
'remix.debug(hash)'
:
'Start debugging a transaction.'
,
'remix.loadgist(id)'
:
'Load a gist in the file explorer.'
,
'remix.loadurl(url)'
:
'Load the given url in the file explorer. The url can be of type github, swarm, ipfs or raw http'
,
...
...
@@ -45,7 +46,7 @@ class CmdInterpreterAPI {
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
null
)
return
}
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
var
lineColumnPos
=
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
rawLocation
,
rawLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
self
.
_components
.
sourceHighlighter
.
currentSourceLocation
(
lineColumnPos
,
rawLocation
)
}
debug
(
hash
,
cb
)
{
...
...
@@ -106,7 +107,7 @@ class CmdInterpreterAPI {
self
.
d
.
goTo
=
(
row
)
=>
{
if
(
self
.
_deps
.
editor
.
current
())
{
var
breakPoint
=
new
remixLib
.
code
.
BreakpointManager
(
self
.
d
,
(
sourceLocation
)
=>
{
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
)
return
self
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
sourceLocation
,
sourceLocation
.
file
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
source
.
sources
,
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
sources
)
})
breakPoint
.
event
.
register
(
'breakpointHit'
,
(
sourceLocation
,
currentStep
)
=>
{
self
.
log
(
null
,
'step index '
+
currentStep
)
...
...
@@ -163,6 +164,14 @@ class CmdInterpreterAPI {
exeCurrent
(
cb
)
{
return
this
.
execute
(
undefined
,
cb
)
}
getFile
(
path
,
cb
)
{
var
provider
=
this
.
_deps
.
fileManager
.
fileProviderOf
(
path
)
if
(
provider
)
{
provider
.
get
(
path
,
cb
)
}
else
{
cb
(
'file not found'
)
}
}
execute
(
file
,
cb
)
{
const
self
=
this
...
...
src/lib/offsetToLineColumnConverter.js
View file @
b53f594b
...
...
@@ -10,10 +10,15 @@ function offsetToColumnConverter (compilerEvent) {
})
}
offsetToColumnConverter
.
prototype
.
offsetToLineColumn
=
function
(
rawLocation
,
file
,
sources
)
{
offsetToColumnConverter
.
prototype
.
offsetToLineColumn
=
function
(
rawLocation
,
file
,
sources
,
asts
)
{
if
(
!
this
.
lineBreakPositionsByContent
[
file
])
{
var
filename
=
Object
.
keys
(
sources
)[
file
]
for
(
var
filename
in
asts
)
{
var
source
=
asts
[
filename
]
if
(
source
.
id
===
file
)
{
this
.
lineBreakPositionsByContent
[
file
]
=
this
.
sourceMappingDecoder
.
getLinebreakPositions
(
sources
[
filename
].
content
)
break
}
}
}
return
this
.
sourceMappingDecoder
.
convertOffsetToLineColumn
(
rawLocation
,
this
.
lineBreakPositionsByContent
[
file
])
}
...
...
src/multiParamManager.js
View file @
b53f594b
...
...
@@ -122,7 +122,6 @@ class MultiParamManager {
var
onClick
=
(
domEl
)
=>
{
this
.
clickCallBack
(
this
.
funABI
.
inputs
,
this
.
basicInputField
.
value
)
this
.
emptyInputs
()
}
this
.
contractActionsContainerSingle
=
yo
`<div class="
${
css
.
contractActionsContainerSingle
}
" >
...
...
@@ -138,7 +137,6 @@ class MultiParamManager {
}
else
{
this
.
clickCallBack
(
this
.
funABI
.
inputs
,
''
)
}
this
.
emptyInputs
()
}
var
button
=
yo
`<button onclick=
${()
=>
{
multiOnClick
()
}}
class
=
"${css.instanceButton}"
><
/button>
`
...
...
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