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
5d4df4fd
Commit
5d4df4fd
authored
Apr 28, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linting
parent
6c7f6638
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
execution-context.ts
libs/remix-lib/src/execution/execution-context.ts
+23
-23
No files found.
libs/remix-lib/src/execution/execution-context.ts
View file @
5d4df4fd
...
@@ -31,32 +31,32 @@ class StateManagerCommonStorageDump extends StateManager {
...
@@ -31,32 +31,32 @@ class StateManagerCommonStorageDump extends StateManager {
this
.
keyHashes
=
{}
this
.
keyHashes
=
{}
}
}
S
putContractStorage
(
address
,
key
,
value
)
{
this
.
keyHashes
[
keccak
(
key
).
toString
(
'hex'
)]
=
bufferToHex
(
key
)
return
super
.
putContractStorage
(
address
,
key
,
value
)
}
dumpStorage
(
address
)
{
putContractStorage
(
address
,
key
,
value
)
{
return
new
Promise
<
StorageDump
>
((
resolve
,
reject
)
=>
{
this
.
keyHashes
[
keccak
(
key
).
toString
(
'hex'
)]
=
bufferToHex
(
key
)
this
.
_getStorageTrie
(
address
).
then
((
trie
)
=>
{
return
super
.
putContractStorage
(
address
,
key
,
value
)
const
storage
=
{}
}
const
stream
=
trie
.
createReadStream
()
stream
.
on
(
'data'
,
(
val
)
=>
{
dumpStorage
(
address
)
{
const
value
=
rlp
.
decode
(
val
.
value
)
return
new
Promise
<
StorageDump
>
((
resolve
,
reject
)
=>
{
storage
[
'0x'
+
val
.
key
.
toString
(
'hex'
)]
=
{
this
.
_getStorageTrie
(
address
).
then
((
trie
)
=>
{
key
:
this
.
keyHashes
[
val
.
key
.
toString
(
'hex'
)],
const
storage
=
{}
value
:
'0x'
+
value
.
toString
(
'hex'
)
const
stream
=
trie
.
createReadStream
()
}
stream
.
on
(
'data'
,
(
val
)
=>
{
})
const
value
=
rlp
.
decode
(
val
.
value
)
stream
.
on
(
'end'
,
function
()
{
storage
[
'0x'
+
val
.
key
.
toString
(
'hex'
)]
=
{
resolve
(
storage
)
key
:
this
.
keyHashes
[
val
.
key
.
toString
(
'hex'
)],
value
:
'0x'
+
value
.
toString
(
'hex'
)
}
})
stream
.
on
(
'end'
,
function
()
{
resolve
(
storage
)
})
}).
catch
((
error
)
=>
{
reject
(
error
)
})
})
}).
catch
((
error
)
=>
{
reject
(
error
)
})
})
})
}
}
async
getStateRoot
(
force
:
boolean
=
false
):
Promise
<
Buffer
>
{
async
getStateRoot
(
force
:
boolean
=
false
):
Promise
<
Buffer
>
{
if
(
!
force
&&
this
.
_checkpointCount
!==
0
)
{
if
(
!
force
&&
this
.
_checkpointCount
!==
0
)
{
...
...
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