Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
cc209be1
Unverified
Commit
cc209be1
authored
May 16, 2021
by
Maurelian
Committed by
GitHub
May 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test(contracts): easily set storageXOR values in prestate (#879)
parent
5b7e13c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
test-runner.ts
packages/contracts/test/helpers/test-runner/test-runner.ts
+17
-8
No files found.
packages/contracts/test/helpers/test-runner/test-runner.ts
View file @
cc209be1
...
...
@@ -37,7 +37,7 @@ import {
}
from
'
../constants
'
import
{
getStorageXOR
}
from
'
../
'
import
{
UNSAFE_BYTECODE
}
from
'
../dummy
'
import
{
getContractFactory
}
from
'
../../../src
'
import
{
getContractFactory
,
predeploys
}
from
'
../../../src
'
export
class
ExecutionManagerTestRunner
{
private
snapshot
:
string
...
...
@@ -64,24 +64,25 @@ export class ExecutionManagerTestRunner {
StateManager
:
{
owner
:
'
$OVM_EXECUTION_MANAGER
'
,
accounts
:
{
[
'
0x4200000000000000000000000000000000000002
'
]:
{
[
predeploys
.
OVM_DeployerWhitelist
]:
{
codeHash
:
NON_NULL_BYTES32
,
ethAddress
:
'
$OVM_DEPLOYER_WHITELIST
'
,
},
[
'
0x4200000000000000000000000000000000000009
'
]:
{
[
predeploys
.
OVM_ProxyEOA
]:
{
codeHash
:
NON_NULL_BYTES32
,
ethAddress
:
'
$OVM_PROXY_EOA
'
,
},
},
contractStorage
:
{
[
'
0x4200000000000000000000000000000000000002
'
]:
{
'
0x0000000000000000000000000000000000000000000000000000000000000000
'
:
getStorageXOR
(
ethers
.
constants
.
HashZero
),
[
predeploys
.
OVM_DeployerWhitelist
]:
{
'
0x0000000000000000000000000000000000000000000000000000000000000000
'
:
{
getStorageXOR
:
true
,
value
:
ethers
.
constants
.
HashZero
,
},
},
},
verifiedContractStorage
:
{
[
'
0x4200000000000000000000000000000000000002
'
]:
{
[
predeploys
.
OVM_DeployerWhitelist
]:
{
'
0x0000000000000000000000000000000000000000000000000000000000000000
'
:
true
,
},
},
...
...
@@ -296,6 +297,14 @@ export class ExecutionManagerTestRunner {
return
this
.
setPlaceholderStrings
(
element
)
})
}
else
if
(
typeof
ret
===
'
object
'
&&
ret
!==
null
)
{
if
(
ret
.
getStorageXOR
)
{
// Special case allowing us to set prestate with an object which will be
// padded to 32 bytes and XORd with STORAGE_XOR_VALUE
return
getStorageXOR
(
ethers
.
utils
.
hexZeroPad
(
getReplacementString
(
ret
.
value
),
32
)
)
}
for
(
const
key
of
Object
.
keys
(
ret
))
{
const
replacedKey
=
getReplacementString
(
key
)
...
...
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