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
5d818814
Commit
5d818814
authored
Dec 15, 2020
by
aniket-engg
Committed by
Aniket
Dec 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage imports updated
parent
2984cc21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
mappingPreimages.ts
libs/remix-debug/src/storage/mappingPreimages.ts
+2
-2
storageResolver.ts
libs/remix-debug/src/storage/storageResolver.ts
+4
-4
storageViewer.ts
libs/remix-debug/src/storage/storageViewer.ts
+3
-4
No files found.
libs/remix-debug/src/storage/mappingPreimages.ts
View file @
5d818814
const
util
=
require
(
'../solidity-decoder/types/util'
)
import
{
sub
}
from
'../solidity-decoder/types/util'
/**
* extract the mappings location from the storage
...
...
@@ -17,7 +17,7 @@ export async function decodeMappingsKeys (web3, storage, corrections) {
try
{
const
key
=
storage
[
hashedLoc
].
key
for
(
let
k
in
corrections
)
{
const
corrected
=
util
.
sub
(
key
,
corrections
[
k
].
slot
).
toString
(
16
)
const
corrected
=
sub
(
key
,
corrections
[
k
].
slot
).
toString
(
16
)
preimage
=
await
getPreimage
(
web3
,
'0x'
+
corrected
)
if
(
preimage
)
break
}
...
...
libs/remix-debug/src/storage/storageResolver.ts
View file @
5d818814
'use strict'
const
traceHelper
=
require
(
'../trace/traceHelper'
)
const
mappingPreimages
=
require
(
'./mappingPreimages'
)
import
{
isContractCreation
}
from
'../trace/traceHelper'
import
{
decodeMappingsKeys
}
from
'./mappingPreimages'
/**
* Basically one instance is created for one debugging session.
...
...
@@ -50,7 +50,7 @@ export class StorageResolver {
return
this
.
preimagesMappingByAddress
[
address
]
}
const
storage
=
await
this
.
storageRange
(
tx
,
stepIndex
,
address
)
const
mappings
=
mappingPreimages
.
decodeMappingsKeys
(
this
.
web3
,
storage
,
corrections
)
const
mappings
=
decodeMappingsKeys
(
this
.
web3
,
storage
,
corrections
)
this
.
preimagesMappingByAddress
[
address
]
=
mappings
return
mappings
}
...
...
@@ -130,7 +130,7 @@ export class StorageResolver {
storageRangeWeb3Call
(
tx
,
address
,
start
,
maxSize
):
Promise
<
Array
<
unknown
>>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
traceHelper
.
isContractCreation
(
address
))
{
if
(
isContractCreation
(
address
))
{
resolve
([{},
null
])
}
else
{
this
.
web3
.
debug
.
storageRangeAt
(
...
...
libs/remix-debug/src/storage/storageViewer.ts
View file @
5d818814
'use strict'
const
remixLib
=
require
(
'@remix-project/remix-lib'
)
const
util
=
remixLib
.
util
const
mappingPreimages
=
require
(
'./mappingPreimages'
)
import
{
util
}
from
'@remix-project/remix-lib'
import
{
decodeMappingsKeys
}
from
'./mappingPreimages'
/**
* easier access to the storage resolver
...
...
@@ -102,7 +101,7 @@ export class StorageViewer {
if
(
this
.
mappingsLocationChanges
)
{
return
this
.
mappingsLocationChanges
}
const
mappings
=
mappingPreimages
.
decodeMappingsKeys
(
this
.
web3
,
storageChanges
,
corrections
)
const
mappings
=
decodeMappingsKeys
(
this
.
web3
,
storageChanges
,
corrections
)
this
.
mappingsLocationChanges
=
mappings
return
this
.
mappingsLocationChanges
}
...
...
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