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
ad8cfc96
Commit
ad8cfc96
authored
Jul 19, 2020
by
Iuri Matias
Committed by
aniket-engg
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor storageSlot
parent
d8c64f75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
storageResolver.js
libs/remix-debug/src/storage/storageResolver.js
+6
-4
storageViewer.js
libs/remix-debug/src/storage/storageViewer.js
+3
-7
No files found.
libs/remix-debug/src/storage/storageResolver.js
View file @
ad8cfc96
...
...
@@ -61,10 +61,12 @@ class StorageResolver {
* @param {String} - address - lookup address
* @param {Function} - callback - {key, hashedKey, value} -
*/
storageSlot
(
slot
,
tx
,
stepIndex
,
address
,
callback
)
{
this
.
storageRangeInternal
(
this
,
slot
,
tx
,
stepIndex
,
address
).
then
((
storage
)
=>
{
callback
(
null
,
storage
[
slot
]
!==
undefined
?
storage
[
slot
]
:
null
)
}).
catch
(
callback
)
storageSlot
(
slot
,
tx
,
stepIndex
,
address
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
storageRangeInternal
(
this
,
slot
,
tx
,
stepIndex
,
address
).
then
((
storage
)
=>
{
resolve
(
storage
[
slot
]
!==
undefined
?
storage
[
slot
]
:
null
)
}).
catch
(
reject
)
})
}
/**
...
...
libs/remix-debug/src/storage/storageViewer.js
View file @
ad8cfc96
...
...
@@ -46,13 +46,9 @@ class StorageViewer {
if
(
this
.
storageChanges
[
hashed
])
{
return
callback
(
null
,
this
.
storageChanges
[
hashed
])
}
this
.
storageResolver
.
storageSlot
(
hashed
,
this
.
context
.
tx
,
this
.
context
.
stepIndex
,
this
.
context
.
address
,
(
error
,
storage
)
=>
{
if
(
error
)
{
callback
(
error
)
}
else
{
callback
(
null
,
storage
)
}
})
this
.
storageResolver
.
storageSlot
(
hashed
,
this
.
context
.
tx
,
this
.
context
.
stepIndex
,
this
.
context
.
address
).
then
((
storage
)
=>
{
callback
(
null
,
storage
)
}).
catch
(
callback
)
}
/**
...
...
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