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
ec3857eb
Unverified
Commit
ec3857eb
authored
Mar 17, 2022
by
Conner Fromknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: code move, move BatchType contants near type def
parent
99021e29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
encoding.go
go/batch-submitter/drivers/sequencer/encoding.go
+24
-24
No files found.
go/batch-submitter/drivers/sequencer/encoding.go
View file @
ec3857eb
...
...
@@ -83,26 +83,22 @@ func (c *BatchContext) Read(r io.Reader) error {
return
readUint64
(
r
,
&
c
.
BlockNumber
,
5
)
}
// BatchType represents the type of batch being
// submitted. When the first context in the batch
// has a timestamp of 0, the blocknumber is interpreted
// as an enum that represets the type
// BatchType represents the type of batch being submitted. When the first
// context in the batch has a timestamp of 0, the blocknumber is interpreted as
// an enum that represets the type.
type
BatchType
int8
// Implements the Stringer interface for BatchType
func
(
b
BatchType
)
String
()
string
{
switch
b
{
case
BatchTypeLegacy
:
return
"LEGACY"
case
BatchTypeZlib
:
return
"ZLIB"
default
:
return
""
}
}
const
(
// BatchTypeLegacy represets the legacy batch type.
BatchTypeLegacy
BatchType
=
-
1
// BatchTypeZlib represents a batch type where the transaction data is
// compressed using zlib.
BatchTypeZlib
BatchType
=
0
)
// BatchTypeFromString returns the BatchType
//
enum based on a human readable string
// BatchTypeFromString returns the BatchType
enum based on a human readable
//
string.
func
BatchTypeFromString
(
s
string
)
BatchType
{
switch
s
{
case
"zlib"
,
"ZLIB"
:
...
...
@@ -114,13 +110,17 @@ func BatchTypeFromString(s string) BatchType {
}
}
const
(
// BatchTypeLegacy represets the legacy batch type
BatchTypeLegacy
BatchType
=
-
1
// BatchTypeZlib represents a batch type where the
// transaction data is compressed using zlib
BatchTypeZlib
BatchType
=
0
)
// String implements the Stringer interface for BatchType.
func
(
b
BatchType
)
String
()
string
{
switch
b
{
case
BatchTypeLegacy
:
return
"LEGACY"
case
BatchTypeZlib
:
return
"ZLIB"
default
:
return
""
}
}
// AppendSequencerBatchParams holds the raw data required to submit a batch of
// L2 txs to L1 CTC contract. Rather than encoding the objects using the
...
...
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