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
4878667a
Commit
4878667a
authored
Feb 09, 2022
by
Antonis Kogias
Committed by
smartcontracts
Feb 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deleted common.ts in data-transport-layer and replaced them from core-utils
parent
9784c462
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
44 deletions
+14
-44
large-keys-punch.md
.changeset/large-keys-punch.md
+5
-0
service.ts
...data-transport-layer/src/services/l1-ingestion/service.ts
+5
-2
transaction.ts
...t-layer/src/services/l2-ingestion/handlers/transaction.ts
+2
-1
service.ts
...data-transport-layer/src/services/l2-ingestion/service.ts
+2
-1
common.ts
packages/data-transport-layer/src/utils/common.ts
+0
-39
index.ts
packages/data-transport-layer/src/utils/index.ts
+0
-1
No files found.
.changeset/large-keys-punch.md
0 → 100644
View file @
4878667a
---
'
@eth-optimism/data-transport-layer'
:
patch
---
Deletes common.ts in data-transport-layer. Uses core-utils.
packages/data-transport-layer/src/services/l1-ingestion/service.ts
View file @
4878667a
/* Imports: External */
import
{
fromHexString
,
FallbackProvider
}
from
'
@eth-optimism/core-utils
'
import
{
fromHexString
,
FallbackProvider
,
sleep
,
}
from
'
@eth-optimism/core-utils
'
import
{
BaseService
,
Metrics
}
from
'
@eth-optimism/common-ts
'
import
{
TypedEvent
}
from
'
@eth-optimism/contracts/dist/types/common
'
import
{
BaseProvider
}
from
'
@ethersproject/providers
'
...
...
@@ -15,7 +19,6 @@ import { MissingElementError } from './handlers/errors'
import
{
TransportDB
}
from
'
../../db/transport-db
'
import
{
OptimismContracts
,
sleep
,
loadOptimismContracts
,
loadContract
,
validators
,
...
...
packages/data-transport-layer/src/services/l2-ingestion/handlers/transaction.ts
View file @
4878667a
/* Imports: External */
import
{
BigNumber
,
ethers
}
from
'
ethers
'
import
{
serialize
}
from
'
@ethersproject/transactions
'
import
{
padHexString
}
from
'
@eth-optimism/core-utils
'
/* Imports: Internal */
import
{
TransportDB
}
from
'
../../../db/transport-db
'
...
...
@@ -9,7 +10,7 @@ import {
StateRootEntry
,
TransactionEntry
,
}
from
'
../../../types
'
import
{
pa
dHexString
,
pa
rseSignatureVParam
}
from
'
../../../utils
'
import
{
parseSignatureVParam
}
from
'
../../../utils
'
export
const
handleSequencerBlock
=
{
parseBlock
:
async
(
...
...
packages/data-transport-layer/src/services/l2-ingestion/service.ts
View file @
4878667a
/* Imports: External */
import
{
BaseService
,
Metrics
}
from
'
@eth-optimism/common-ts
'
import
{
StaticJsonRpcProvider
}
from
'
@ethersproject/providers
'
import
{
sleep
,
toRpcHexString
}
from
'
@eth-optimism/core-utils
'
import
{
BigNumber
}
from
'
ethers
'
import
{
LevelUp
}
from
'
levelup
'
import
axios
from
'
axios
'
...
...
@@ -10,7 +11,7 @@ import { Gauge } from 'prom-client'
/* Imports: Internal */
import
{
handleSequencerBlock
}
from
'
./handlers/transaction
'
import
{
TransportDB
}
from
'
../../db/transport-db
'
import
{
sleep
,
toRpcHexString
,
validators
}
from
'
../../utils
'
import
{
validators
}
from
'
../../utils
'
import
{
L1DataTransportServiceOptions
}
from
'
../main/service
'
interface
L2IngestionMetrics
{
...
...
packages/data-transport-layer/src/utils/common.ts
deleted
100644 → 0
View file @
9784c462
import
{
toHexString
}
from
'
@eth-optimism/core-utils
'
/**
* Basic timeout-based async sleep function.
*
* @param ms Number of milliseconds to sleep.
*/
export
const
sleep
=
async
(
ms
:
number
):
Promise
<
void
>
=>
{
return
new
Promise
<
void
>
((
resolve
)
=>
{
setTimeout
(
resolve
,
ms
)
})
}
export
const
assert
=
(
condition
:
()
=>
boolean
,
reason
?:
string
)
=>
{
try
{
if
(
condition
()
===
false
)
{
throw
new
Error
(
`Assertion failed:
${
reason
}
`
)
}
}
catch
(
err
)
{
throw
new
Error
(
`Assertion failed:
${
reason
}
\n
${
err
}
`
)
}
}
export
const
toRpcHexString
=
(
n
:
number
):
string
=>
{
if
(
n
===
0
)
{
return
'
0x0
'
}
else
{
// prettier-ignore
return
'
0x
'
+
toHexString
(
n
).
slice
(
2
).
replace
(
/^0+/
,
''
)
}
}
export
const
padHexString
=
(
str
:
string
,
length
:
number
):
string
=>
{
if
(
str
.
length
===
2
+
length
*
2
)
{
return
str
}
else
{
return
'
0x
'
+
str
.
slice
(
2
).
padStart
(
length
*
2
,
'
0
'
)
}
}
packages/data-transport-layer/src/utils/index.ts
View file @
4878667a
export
*
from
'
./common
'
export
*
from
'
./contracts
'
export
*
from
'
./validation
'
export
*
from
'
./eth-tx
'
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