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
fb498ecf
Unverified
Commit
fb498ecf
authored
Dec 16, 2022
by
mergify[bot]
Committed by
GitHub
Dec 16, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4518 from ethereum-optimism/test/l1fee-constants
op-bindings: add test coverage of the L1 fee constants
parents
e362fc4c
b232cf41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
addresses_test.go
op-bindings/predeploys/addresses_test.go
+26
-0
No files found.
op-bindings/predeploys/addresses_test.go
View file @
fb498ecf
package
predeploys
package
predeploys
import
(
import
(
"math/big"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
...
@@ -12,3 +15,26 @@ func TestGethAddresses(t *testing.T) {
...
@@ -12,3 +15,26 @@ func TestGethAddresses(t *testing.T) {
// we import geth in the monorepo, and do not want to import op-bindings into geth.
// we import geth in the monorepo, and do not want to import op-bindings into geth.
require
.
Equal
(
t
,
L1BlockAddr
,
types
.
L1BlockAddr
)
require
.
Equal
(
t
,
L1BlockAddr
,
types
.
L1BlockAddr
)
}
}
// TestL1BlockSlots ensures that the storage layout of the L1Block
// contract matches the hardcoded values in `op-geth`.
func
TestL1BlockSlots
(
t
*
testing
.
T
)
{
layout
,
err
:=
bindings
.
GetStorageLayout
(
"L1Block"
)
require
.
NoError
(
t
,
err
)
var
l1BaseFeeSlot
,
overHeadSlot
,
scalarSlot
common
.
Hash
for
_
,
entry
:=
range
layout
.
Storage
{
switch
entry
.
Label
{
case
"l1FeeOverhead"
:
overHeadSlot
=
common
.
BigToHash
(
big
.
NewInt
(
int64
(
entry
.
Slot
)))
case
"l1FeeScalar"
:
scalarSlot
=
common
.
BigToHash
(
big
.
NewInt
(
int64
(
entry
.
Slot
)))
case
"basefee"
:
l1BaseFeeSlot
=
common
.
BigToHash
(
big
.
NewInt
(
int64
(
entry
.
Slot
)))
}
}
require
.
Equal
(
t
,
types
.
OverheadSlot
,
overHeadSlot
)
require
.
Equal
(
t
,
types
.
ScalarSlot
,
scalarSlot
)
require
.
Equal
(
t
,
types
.
L1BaseFeeSlot
,
l1BaseFeeSlot
)
}
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