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
32f0cf4b
Commit
32f0cf4b
authored
Nov 30, 2023
by
Baptiste Oueriagli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nit(op-node): use DataSourceConfig in place of rollup.Config in DataSource & DataSourceFactory
parent
4d22eb44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
calldata_source.go
op-node/rollup/derive/calldata_source.go
+4
-6
No files found.
op-node/rollup/derive/calldata_source.go
View file @
32f0cf4b
...
...
@@ -28,17 +28,17 @@ type L1TransactionFetcher interface {
// This is not a stage in the pipeline, but a wrapper for another stage in the pipeline
type
DataSourceFactory
struct
{
log
log
.
Logger
cfg
*
rollup
.
Config
dsCfg
DataSource
Config
fetcher
L1TransactionFetcher
}
func
NewDataSourceFactory
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
fetcher
L1TransactionFetcher
)
*
DataSourceFactory
{
return
&
DataSourceFactory
{
log
:
log
,
cfg
:
cfg
,
fetcher
:
fetcher
}
return
&
DataSourceFactory
{
log
:
log
,
dsCfg
:
DataSourceConfig
{
l1Signer
:
cfg
.
L1Signer
(),
batchInboxAddress
:
cfg
.
BatchInboxAddress
}
,
fetcher
:
fetcher
}
}
// OpenData returns a DataIter. This struct implements the `Next` function.
func
(
ds
*
DataSourceFactory
)
OpenData
(
ctx
context
.
Context
,
id
eth
.
BlockID
,
batcherAddr
common
.
Address
)
DataIter
{
return
NewDataSource
(
ctx
,
ds
.
log
,
ds
.
c
fg
,
ds
.
fetcher
,
id
,
batcherAddr
)
return
NewDataSource
(
ctx
,
ds
.
log
,
ds
.
dsC
fg
,
ds
.
fetcher
,
id
,
batcherAddr
)
}
// DataSourceConfig regroups the mandatory rollup.Config fields needed for DataFromEVMTransactions.
...
...
@@ -65,11 +65,9 @@ type DataSource struct {
// NewDataSource creates a new calldata source. It suppresses errors in fetching the L1 block if they occur.
// If there is an error, it will attempt to fetch the result on the next call to `Next`.
func
NewDataSource
(
ctx
context
.
Context
,
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
fetcher
L1TransactionFetcher
,
block
eth
.
BlockID
,
batcherAddr
common
.
Address
)
DataIter
{
func
NewDataSource
(
ctx
context
.
Context
,
log
log
.
Logger
,
dsCfg
DataSource
Config
,
fetcher
L1TransactionFetcher
,
block
eth
.
BlockID
,
batcherAddr
common
.
Address
)
DataIter
{
_
,
txs
,
err
:=
fetcher
.
InfoAndTxsByHash
(
ctx
,
block
.
Hash
)
dsCfg
:=
DataSourceConfig
{
cfg
.
L1Signer
(),
cfg
.
BatchInboxAddress
}
if
err
!=
nil
{
return
&
DataSource
{
open
:
false
,
...
...
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