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
b36dd7a6
Commit
b36dd7a6
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 storageRangeWeb3Call
parent
ad8cfc96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
storageResolver.js
libs/remix-debug/src/storage/storageResolver.js
+24
-24
No files found.
libs/remix-debug/src/storage/storageResolver.js
View file @
b36dd7a6
...
...
@@ -91,10 +91,8 @@ class StorageResolver {
if
(
cached
&&
cached
.
storage
[
slotKey
])
{
// we have the current slot in the cache and maybe the next 1000...
return
resolve
(
cached
.
storage
)
}
this
.
storageRangeWeb3Call
(
tx
,
address
,
slotKey
,
self
.
maxSize
,
(
error
,
storage
,
nextKey
)
=>
{
if
(
error
)
{
return
reject
(
error
)
}
this
.
storageRangeWeb3Call
(
tx
,
address
,
slotKey
,
self
.
maxSize
).
then
((
result
)
=>
{
const
[
storage
,
nextKey
]
=
result
if
(
!
storage
[
slotKey
]
&&
slotKey
!==
self
.
zeroSlot
)
{
// we don't cache the zero slot (could lead to inconsistency)
storage
[
slotKey
]
=
{
key
:
slotKey
,
...
...
@@ -106,7 +104,7 @@ class StorageResolver {
self
.
storageByAddress
[
address
].
complete
=
true
}
return
resolve
(
storage
)
})
})
.
catch
(
reject
)
})
}
...
...
@@ -136,25 +134,27 @@ class StorageResolver {
self
.
storageByAddress
[
address
].
storage
=
Object
.
assign
(
self
.
storageByAddress
[
address
].
storage
||
{},
storage
)
}
storageRangeWeb3Call
(
tx
,
address
,
start
,
maxSize
,
callback
)
{
if
(
traceHelper
.
isContractCreation
(
address
))
{
callback
(
null
,
{},
null
)
}
else
{
this
.
web3
.
debug
.
storageRangeAt
(
tx
.
blockHash
,
tx
.
transactionIndex
===
undefined
?
tx
.
hash
:
tx
.
transactionIndex
,
address
,
start
,
maxSize
,
(
error
,
result
)
=>
{
if
(
error
)
{
callback
(
error
)
}
else
if
(
result
.
storage
)
{
callback
(
null
,
result
.
storage
,
result
.
nextKey
)
}
else
{
callback
(
'the storage has not been provided'
)
}
})
}
storageRangeWeb3Call
(
tx
,
address
,
start
,
maxSize
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
traceHelper
.
isContractCreation
(
address
))
{
resolve
([{},
null
])
}
else
{
this
.
web3
.
debug
.
storageRangeAt
(
tx
.
blockHash
,
tx
.
transactionIndex
===
undefined
?
tx
.
hash
:
tx
.
transactionIndex
,
address
,
start
,
maxSize
,
(
error
,
result
)
=>
{
if
(
error
)
{
reject
(
error
)
}
else
if
(
result
.
storage
)
{
resolve
([
result
.
storage
,
result
.
nextKey
])
}
else
{
reject
(
'the storage has not been provided'
)
}
})
}
})
}
}
...
...
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