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
5c81c768
Commit
5c81c768
authored
Jul 17, 2020
by
Iuri Matias
Committed by
aniket-engg
Aug 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor decodeMappingsKeys
parent
6f411db3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
18 deletions
+8
-18
mappingPreimages.js
libs/remix-debug/src/storage/mappingPreimages.js
+2
-2
storageResolver.js
libs/remix-debug/src/storage/storageResolver.js
+3
-8
storageViewer.js
libs/remix-debug/src/storage/storageViewer.js
+3
-8
No files found.
libs/remix-debug/src/storage/mappingPreimages.js
View file @
5c81c768
...
@@ -13,7 +13,7 @@ module.exports = {
...
@@ -13,7 +13,7 @@ module.exports = {
* @param {Function} callback - calback
* @param {Function} callback - calback
* @return {Map} - solidity mapping location (e.g { "<mapping_slot>" : { "<mapping-key1>": preimageOf1 }, { "<mapping-key2>": preimageOf2 }, ... })
* @return {Map} - solidity mapping location (e.g { "<mapping_slot>" : { "<mapping-key1>": preimageOf1 }, { "<mapping-key2>": preimageOf2 }, ... })
*/
*/
async
function
decodeMappingsKeys
(
web3
,
storage
,
corrections
,
callback
)
{
async
function
decodeMappingsKeys
(
web3
,
storage
,
corrections
)
{
const
ret
=
{}
const
ret
=
{}
if
(
!
corrections
.
length
)
corrections
.
push
({
offset
:
0
,
slot
:
0
})
if
(
!
corrections
.
length
)
corrections
.
push
({
offset
:
0
,
slot
:
0
})
for
(
let
hashedLoc
in
storage
)
{
for
(
let
hashedLoc
in
storage
)
{
...
@@ -38,7 +38,7 @@ async function decodeMappingsKeys (web3, storage, corrections, callback) {
...
@@ -38,7 +38,7 @@ async function decodeMappingsKeys (web3, storage, corrections, callback) {
ret
[
mappingSlot
][
mappingKey
]
=
preimage
ret
[
mappingSlot
][
mappingKey
]
=
preimage
}
}
}
}
callback
(
null
,
ret
)
return
ret
}
}
/**
/**
...
...
libs/remix-debug/src/storage/storageResolver.js
View file @
5c81c768
...
@@ -47,14 +47,9 @@ class StorageResolver {
...
@@ -47,14 +47,9 @@ class StorageResolver {
if
(
error
)
{
if
(
error
)
{
return
callback
(
error
)
return
callback
(
error
)
}
}
mappingPreimages
.
decodeMappingsKeys
(
this
.
web3
,
storage
,
corrections
,
(
error
,
mappings
)
=>
{
const
mappings
=
mappingPreimages
.
decodeMappingsKeys
(
this
.
web3
,
storage
,
corrections
)
if
(
error
)
{
this
.
preimagesMappingByAddress
[
address
]
=
mappings
callback
(
error
)
callback
(
null
,
mappings
)
}
else
{
this
.
preimagesMappingByAddress
[
address
]
=
mappings
callback
(
null
,
mappings
)
}
})
})
})
}
}
...
...
libs/remix-debug/src/storage/storageViewer.js
View file @
5c81c768
...
@@ -118,14 +118,9 @@ class StorageViewer {
...
@@ -118,14 +118,9 @@ class StorageViewer {
if
(
this
.
mappingsLocationChanges
)
{
if
(
this
.
mappingsLocationChanges
)
{
return
callback
(
null
,
this
.
mappingsLocationChanges
)
return
callback
(
null
,
this
.
mappingsLocationChanges
)
}
}
mappingPreimages
.
decodeMappingsKeys
(
this
.
web3
,
storageChanges
,
corrections
,
(
error
,
mappings
)
=>
{
const
mappings
=
mappingPreimages
.
decodeMappingsKeys
(
this
.
web3
,
storageChanges
,
corrections
)
if
(
!
error
)
{
this
.
mappingsLocationChanges
=
mappings
this
.
mappingsLocationChanges
=
mappings
return
callback
(
null
,
this
.
mappingsLocationChanges
)
return
callback
(
null
,
this
.
mappingsLocationChanges
)
}
else
{
callback
(
error
)
}
})
}
}
}
}
...
...
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