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
7c6fa5b3
Commit
7c6fa5b3
authored
Jun 23, 2021
by
Mark Tyneway
Committed by
Liam Horne
Jun 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l2geth: rollup client explicitly checks for >= 400 errors
parent
cabb82c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
client.go
l2geth/rollup/client.go
+13
-0
No files found.
l2geth/rollup/client.go
View file @
7c6fa5b3
...
@@ -24,6 +24,10 @@ const (
...
@@ -24,6 +24,10 @@ const (
// found. It applies to transactions, queue elements and batches
// found. It applies to transactions, queue elements and batches
var
errElementNotFound
=
errors
.
New
(
"element not found"
)
var
errElementNotFound
=
errors
.
New
(
"element not found"
)
// errHttpError represents the error case of when the remote server
// returns a 400 or greater error
var
errHTTPError
=
errors
.
New
(
"http error"
)
// Batch represents the data structure that is submitted with
// Batch represents the data structure that is submitted with
// a series of transactions to layer one
// a series of transactions to layer one
type
Batch
struct
{
type
Batch
struct
{
...
@@ -154,6 +158,15 @@ func NewClient(url string, chainID *big.Int) *Client {
...
@@ -154,6 +158,15 @@ func NewClient(url string, chainID *big.Int) *Client {
client
:=
resty
.
New
()
client
:=
resty
.
New
()
client
.
SetHostURL
(
url
)
client
.
SetHostURL
(
url
)
client
.
SetHeader
(
"User-Agent"
,
"sequencer"
)
client
.
SetHeader
(
"User-Agent"
,
"sequencer"
)
client
.
OnAfterResponse
(
func
(
c
*
resty
.
Client
,
r
*
resty
.
Response
)
error
{
statusCode
:=
r
.
StatusCode
()
if
statusCode
>=
400
{
method
:=
r
.
Request
.
Method
url
:=
r
.
Request
.
URL
return
fmt
.
Errorf
(
"%d cannot %s %s: %w"
,
statusCode
,
method
,
url
,
errHTTPError
)
}
return
nil
})
signer
:=
types
.
NewEIP155Signer
(
chainID
)
signer
:=
types
.
NewEIP155Signer
(
chainID
)
return
&
Client
{
return
&
Client
{
...
...
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