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
c3e85fef
Unverified
Commit
c3e85fef
authored
Jan 23, 2022
by
kf
Committed by
Kelvin Fichter
Jan 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance: clean up typings in core utils
parent
cd9b94a2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
10 deletions
+42
-10
three-bottles-marry.md
.changeset/three-bottles-marry.md
+5
-0
index.ts
packages/core-utils/src/coders/index.ts
+0
-1
index.ts
packages/core-utils/src/index.ts
+1
-2
basic.ts
packages/core-utils/src/types/basic.ts
+3
-0
bcfg.ts
packages/core-utils/src/types/bcfg.ts
+0
-0
geth.ts
packages/core-utils/src/types/geth.ts
+7
-3
index.ts
packages/core-utils/src/types/index.ts
+4
-0
rollup.ts
packages/core-utils/src/types/rollup.ts
+22
-4
No files found.
.changeset/three-bottles-marry.md
0 → 100644
View file @
c3e85fef
---
'
@eth-optimism/core-utils'
:
patch
---
Cleans up the internal file and folder structure for the typings exported by core-utils
packages/core-utils/src/coders/index.ts
View file @
c3e85fef
export
*
from
'
./types
'
export
*
from
'
./sequencer-batch
'
packages/core-utils/src/index.ts
View file @
c3e85fef
...
...
@@ -2,8 +2,7 @@ export * from './coders'
export
*
from
'
./common
'
export
*
from
'
./watcher
'
export
*
from
'
./l2context
'
export
*
from
'
./batches
'
export
*
from
'
./bcfg
'
export
*
from
'
./types
'
export
*
from
'
./fees
'
export
*
from
'
./provider
'
export
*
from
'
./alias
'
...
...
packages/core-utils/src/
coders/types
.ts
→
packages/core-utils/src/
types/basic
.ts
View file @
c3e85fef
// Use this file for simple types that aren't necessarily associated with a specific project or
// package. Often used for alias types like Address = string.
export
interface
Signature
{
r
:
string
s
:
string
...
...
packages/core-utils/src/bcfg.ts
→
packages/core-utils/src/
types/
bcfg.ts
View file @
c3e85fef
File moved
packages/core-utils/src/types.ts
→
packages/core-utils/src/types
/geth
.ts
View file @
c3e85fef
//
Optimism PBC 2021
//
Types explicitly related to dealing with Geth.
// Represents the ethereum state
/**
* Represents the Ethereum state, in the format that Geth expects it.
*/
export
interface
State
{
[
address
:
string
]:
{
nonce
:
number
...
...
@@ -14,7 +16,9 @@ export interface State {
}
}
// Represents a genesis file that geth can consume
/**
* Represents Geth's genesis file format.
*/
export
interface
Genesis
{
config
:
{
chainId
:
number
...
...
packages/core-utils/src/types/index.ts
0 → 100644
View file @
c3e85fef
export
*
from
'
./geth
'
export
*
from
'
./bcfg
'
export
*
from
'
./rollup
'
export
*
from
'
./basic
'
packages/core-utils/src/
batches
.ts
→
packages/core-utils/src/
types/rollup
.ts
View file @
c3e85fef
...
...
@@ -4,6 +4,9 @@ import {
TransactionResponse
,
}
from
'
@ethersproject/abstract-provider
'
/**
* Structure of the response returned by L2Geth nodes when querying the `rollup_getInfo` endpoint.
*/
export
interface
RollupInfo
{
mode
:
'
sequencer
'
|
'
verifier
'
syncing
:
boolean
...
...
@@ -17,14 +20,18 @@ export interface RollupInfo {
}
}
/**
* Enum used for the two transaction types (queue and direct to Sequencer).
*/
export
enum
QueueOrigin
{
Sequencer
=
'
sequencer
'
,
L1ToL2
=
'
l1
'
,
}
/**
* Transaction & Blocks. These are the true data-types we expect
* from running a batch submitter.
* JSON transaction representation when returned by L2Geth nodes. This is simply an extension to
* the standard transaction response type. You do NOT need to use this type unless you care about
* having typed access to L2-specific fields.
*/
export
interface
L2Transaction
extends
TransactionResponse
{
l1BlockNumber
:
number
...
...
@@ -33,21 +40,32 @@ export interface L2Transaction extends TransactionResponse {
rawTransaction
:
string
}
/**
* JSON block representation when returned by L2Geth nodes. Just a normal block but with
* L2Transaction objects instead of the standard transaction response object.
*/
export
interface
L2Block
extends
BlockWithTransactions
{
stateRoot
:
string
transactions
:
[
L2Transaction
]
}
/**
* BatchElement & Batch. These are the data-types of the compressed / batched
* block data we submit to L1.
* Generic batch element, either a state root batch element or a transaction batch element.
*/
export
interface
BatchElement
{
// Only exists on state root batch elements.
stateRoot
:
string
// Only exists on transaction batch elements.
isSequencerTx
:
boolean
rawTransaction
:
undefined
|
string
// Batch element context, exists on all batch elements.
timestamp
:
number
blockNumber
:
number
}
/**
* List of batch elements.
*/
export
type
Batch
=
BatchElement
[]
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