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
1187d4ad
Commit
1187d4ad
authored
Dec 14, 2020
by
aniket-engg
Committed by
Aniket
Dec 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage src updated
parent
24d41a87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
+20
-12
mappingPreimages.ts
libs/remix-debug/src/storage/mappingPreimages.ts
+1
-5
storageResolver.ts
libs/remix-debug/src/storage/storageResolver.ts
+9
-4
storageViewer.ts
libs/remix-debug/src/storage/storageViewer.ts
+10
-3
No files found.
libs/remix-debug/src/storage/mappingPreimages.ts
View file @
1187d4ad
const
util
=
require
(
'../solidity-decoder/types/util'
)
module
.
exports
=
{
decodeMappingsKeys
:
decodeMappingsKeys
}
/**
* extract the mappings location from the storage
* like { "<mapping_slot>" : { "<mapping-key1>": preimageOf1 }, { "<mapping-key2>": preimageOf2 }, ... }
...
...
@@ -13,7 +9,7 @@ module.exports = {
* @param {Function} callback - calback
* @return {Map} - solidity mapping location (e.g { "<mapping_slot>" : { "<mapping-key1>": preimageOf1 }, { "<mapping-key2>": preimageOf2 }, ... })
*/
async
function
decodeMappingsKeys
(
web3
,
storage
,
corrections
)
{
export
async
function
decodeMappingsKeys
(
web3
,
storage
,
corrections
)
{
const
ret
=
{}
if
(
!
corrections
.
length
)
corrections
.
push
({
offset
:
0
,
slot
:
0
})
for
(
let
hashedLoc
in
storage
)
{
...
...
libs/remix-debug/src/storage/storageResolver.ts
View file @
1187d4ad
...
...
@@ -6,7 +6,14 @@ const mappingPreimages = require('./mappingPreimages')
* Basically one instance is created for one debugging session.
* (TODO: one instance need to be shared over all the components)
*/
class
StorageResolver
{
export
class
StorageResolver
{
storageByAddress
preimagesMappingByAddress
maxSize
web3
zeroSlot
constructor
(
options
)
{
this
.
storageByAddress
=
{}
this
.
preimagesMappingByAddress
=
{}
...
...
@@ -121,7 +128,7 @@ class StorageResolver {
self
.
storageByAddress
[
address
].
storage
=
Object
.
assign
(
self
.
storageByAddress
[
address
].
storage
||
{},
storage
)
}
storageRangeWeb3Call
(
tx
,
address
,
start
,
maxSize
)
{
storageRangeWeb3Call
(
tx
,
address
,
start
,
maxSize
)
:
Promise
<
Array
<
unknown
>>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
traceHelper
.
isContractCreation
(
address
))
{
resolve
([{},
null
])
...
...
@@ -144,5 +151,3 @@ class StorageResolver {
})
}
}
module
.
exports
=
StorageResolver
libs/remix-debug/src/storage/storageViewer.ts
View file @
1187d4ad
...
...
@@ -8,7 +8,16 @@ const mappingPreimages = require('./mappingPreimages')
* Basically one instance is created foreach execution step and foreach component that need it.
* (TODO: one instance need to be shared over all the components)
*/
class
StorageViewer
{
export
class
StorageViewer
{
context
storageResolver
web3
initialMappingsLocationPromise
currentMappingsLocationPromise
storageChanges
mappingsLocationChanges
constructor
(
_context
,
_storageResolver
,
_traceManager
)
{
this
.
context
=
_context
this
.
storageResolver
=
_storageResolver
...
...
@@ -98,5 +107,3 @@ class StorageViewer {
return
this
.
mappingsLocationChanges
}
}
module
.
exports
=
StorageViewer
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