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
51d011f2
Unverified
Commit
51d011f2
authored
Jun 22, 2021
by
bunsenstraat
Committed by
GitHub
Jun 22, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into remixderror2
parents
f69dc5e5
82056a5b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
12 deletions
+48
-12
debugger-api.ts
apps/debugger/src/app/debugger-api.ts
+4
-1
currentWorkspaceIs.ts
apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts
+19
-0
url.spec.ts
apps/remix-ide-e2e/src/tests/url.spec.ts
+11
-1
index.d.ts
apps/remix-ide-e2e/src/types/index.d.ts
+1
-0
VmDebugger.ts
libs/remix-debug/src/debugger/VmDebugger.ts
+7
-5
traceHelper.ts
libs/remix-debug/src/trace/traceHelper.ts
+3
-3
remix-ui-workspace.tsx
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+3
-2
No files found.
apps/debugger/src/app/debugger-api.ts
View file @
51d011f2
...
...
@@ -74,7 +74,10 @@ export const DebuggerApiMixin = (Base) => class extends Base {
const
targetAddress
=
target
||
receipt
.
contractAddress
||
receipt
.
to
const
codeAtAddress
=
await
this
.
_web3
.
eth
.
getCode
(
targetAddress
)
const
output
=
await
this
.
call
(
'fetchAndCompile'
,
'resolve'
,
targetAddress
,
codeAtAddress
,
'browser/.debug'
)
return
new
CompilerAbstract
(
output
.
languageversion
,
output
.
data
,
output
.
source
)
if
(
output
)
{
return
new
CompilerAbstract
(
output
.
languageversion
,
output
.
data
,
output
.
source
)
}
return
null
}
async
getDebugWeb3
()
{
...
...
apps/remix-ide-e2e/src/commands/currentWorkspaceIs.ts
0 → 100644
View file @
51d011f2
import
{
NightwatchBrowser
}
from
'nightwatch'
import
EventEmitter
from
'events'
class
CurrentWorkspaceIs
extends
EventEmitter
{
command
(
this
:
NightwatchBrowser
,
name
:
string
):
NightwatchBrowser
{
this
.
api
.
execute
(
function
()
{
const
el
=
document
.
querySelector
(
'select[data-id="workspacesSelect"]'
)
as
HTMLSelectElement
return
el
.
value
},
[],
(
result
)
=>
{
console
.
log
(
result
)
this
.
api
.
assert
.
equal
(
result
.
value
,
name
)
this
.
emit
(
'complete'
)
})
return
this
}
}
module
.
exports
=
CurrentWorkspaceIs
apps/remix-ide-e2e/src/tests/url.spec.ts
View file @
51d011f2
...
...
@@ -10,7 +10,7 @@ const sources = [
module
.
exports
=
{
before
:
function
(
browser
:
NightwatchBrowser
,
done
:
VoidFunction
)
{
init
(
browser
,
done
,
'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js
&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0
'
,
true
)
init
(
browser
,
done
,
'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js'
,
true
)
},
'@sources'
:
function
()
{
...
...
@@ -19,6 +19,11 @@ module.exports = {
'Should load the code from URL params'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
pause
(
5000
)
.
url
(
'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0'
)
.
refresh
()
// we do one reload for making sure we already have the default workspace
.
pause
(
5000
)
.
currentWorkspaceIs
(
'code-sample'
)
.
getEditorValue
((
content
)
=>
{
browser
.
assert
.
ok
(
content
.
indexOf
(
'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol'
)
!==
-
1
,
...
...
@@ -28,6 +33,11 @@ module.exports = {
'Should load using URL compiler params'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
pause
(
5000
)
.
url
(
'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js'
)
.
refresh
()
.
pause
(
5000
)
.
clickLaunchIcon
(
'solidity'
)
.
assert
.
containsText
(
'#versionSelector option[selected="selected"]'
,
'0.7.4+commit.3f05b770'
)
.
assert
.
containsText
(
'#evmVersionSelector option[selected="selected"]'
,
'istanbul'
)
.
verify
.
elementPresent
(
'#optimize:checked'
)
...
...
apps/remix-ide-e2e/src/types/index.d.ts
View file @
51d011f2
...
...
@@ -56,6 +56,7 @@ declare module "nightwatch" {
checkAnnotations
(
type
:
string
,
line
:
number
):
NightwatchBrowser
checkAnnotationsNotPresent
(
type
:
string
):
NightwatchBrowser
getLastTransactionHash
(
callback
:
(
hash
:
string
)
=>
void
)
currentWorkspaceIs
(
name
:
string
):
NightwatchBrowser
}
export
interface
NightwatchBrowser
{
...
...
libs/remix-debug/src/debugger/VmDebugger.ts
View file @
51d011f2
...
...
@@ -189,7 +189,7 @@ export class VmDebuggerLogic {
})
})
this
.
debugger
.
event
.
register
(
'indexChanged'
,
this
,
(
index
)
=>
{
this
.
debugger
.
event
.
register
(
'indexChanged'
,
this
,
async
(
index
)
=>
{
if
(
index
<
0
)
return
if
(
this
.
stepManager
.
currentStepIndex
!==
index
)
return
if
(
!
this
.
storageResolver
)
return
...
...
@@ -201,11 +201,13 @@ export class VmDebuggerLogic {
for
(
var
k
in
this
.
addresses
)
{
var
address
=
this
.
addresses
[
k
]
var
storageViewer
=
new
StorageViewer
({
stepIndex
:
this
.
stepManager
.
currentStepIndex
,
tx
:
this
.
tx
,
address
:
address
},
this
.
storageResolver
,
this
.
_traceManager
)
storageViewer
.
storageRange
().
then
((
result
)
=>
{
storageJSON
[
address
]
=
result
this
.
event
.
trigger
(
'traceStorageUpdate'
,
[
storageJSON
])
})
try
{
storageJSON
[
address
]
=
await
storageViewer
.
storageRange
()
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
this
.
event
.
trigger
(
'traceStorageUpdate'
,
[
storageJSON
])
})
}
...
...
libs/remix-debug/src/trace/traceHelper.ts
View file @
51d011f2
...
...
@@ -15,11 +15,11 @@ export function resolveCalledAddress (vmTraceIndex, trace) {
}
export
function
isCallInstruction
(
step
)
{
return
[
'CALL'
,
'STATICCALL'
,
'CALLCODE'
,
'CREATE'
,
'DELEGATECALL'
].
includes
(
step
.
op
)
return
[
'CALL'
,
'STATICCALL'
,
'CALLCODE'
,
'CREATE'
,
'DELEGATECALL'
,
'CREATE2'
].
includes
(
step
.
op
)
}
export
function
isCreateInstruction
(
step
)
{
return
step
.
op
===
'CREATE'
return
step
.
op
===
'CREATE'
||
step
.
op
===
'CREATE2'
}
export
function
isReturnInstruction
(
step
)
{
...
...
@@ -47,7 +47,7 @@ export function isSHA3Instruction (step) {
}
export
function
newContextStorage
(
step
)
{
return
step
.
op
===
'CREATE'
||
step
.
op
===
'CALL'
return
step
.
op
===
'CREATE'
||
step
.
op
===
'CALL'
||
step
.
op
===
'CREATE2'
}
export
function
isCallToPrecompiledContract
(
index
,
trace
)
{
...
...
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
View file @
51d011f2
...
...
@@ -74,9 +74,10 @@ export const Workspace = (props: WorkspaceProps) => {
let
getWorkspaces
=
async
()
=>
{
if
(
props
.
workspaces
&&
Array
.
isArray
(
props
.
workspaces
))
{
if
(
props
.
workspaces
.
length
>
0
&&
state
.
currentWorkspace
===
NO_WORKSPACE
)
{
await
props
.
workspace
.
setWorkspace
(
props
.
workspaces
[
0
])
const
currentWorkspace
=
props
.
workspace
.
getWorkspace
()
?
props
.
workspace
.
getWorkspace
()
:
props
.
workspaces
[
0
]
await
props
.
workspace
.
setWorkspace
(
currentWorkspace
)
setState
(
prevState
=>
{
return
{
...
prevState
,
workspaces
:
props
.
workspaces
,
currentWorkspace
:
props
.
workspaces
[
0
]
}
return
{
...
prevState
,
workspaces
:
props
.
workspaces
,
currentWorkspace
}
})
}
else
{
setState
(
prevState
=>
{
...
...
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