This repository was archived by the owner on May 11, 2024. It is now read-only.
Commit 2d00517 1 parent 9461b05 commit 2d00517 Copy full SHA for 2d00517
File tree 3 files changed +36
-30
lines changed
3 files changed +36
-30
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ import (
6
6
)
7
7
8
8
// TryParsingCustomError tries to checks whether the given error is one of the
9
- // custom errors defined the TaikoL1 / TaikoL2's ABI , if so, it will return
9
+ // custom errors defined the protocol ABIs , if so, it will return
10
10
// the matched custom error, otherwise, it simply returns the original error.
11
11
func TryParsingCustomError (originalError error ) error {
12
+ if originalError == nil {
13
+ return nil
14
+ }
15
+
12
16
errData := getErrorData (originalError )
13
17
14
18
// if errData is unparsable and returns 0x, we should not match any errors.
Original file line number Diff line number Diff line change @@ -99,35 +99,37 @@ func (c *ProofContester) SubmitContest(
99
99
return err
100
100
}
101
101
102
- return c .sender .Send (
103
- ctx ,
104
- & proofProducer.ProofWithHeader {
105
- BlockID : blockID ,
106
- Meta : meta ,
107
- Header : header ,
108
- Proof : []byte {},
109
- Opts : & proofProducer.ProofRequestOptions {
110
- EventL1Hash : l1HeaderProposedIn .Hash (),
111
- StateRoot : header .Root ,
112
- },
113
- Tier : tier ,
114
- },
115
- c .txBuilder .Build (
102
+ return encoding .TryParsingCustomError (
103
+ c .sender .Send (
116
104
ctx ,
117
- blockID ,
118
- meta ,
119
- & bindings.TaikoDataTransition {
120
- ParentHash : header .ParentHash ,
121
- BlockHash : header .Hash (),
122
- StateRoot : header .Root ,
123
- Graffiti : c .graffiti ,
124
- },
125
- & bindings.TaikoDataTierProof {
126
- Tier : transition .Tier ,
127
- Data : []byte {},
105
+ & proofProducer.ProofWithHeader {
106
+ BlockID : blockID ,
107
+ Meta : meta ,
108
+ Header : header ,
109
+ Proof : []byte {},
110
+ Opts : & proofProducer.ProofRequestOptions {
111
+ EventL1Hash : l1HeaderProposedIn .Hash (),
112
+ StateRoot : header .Root ,
113
+ },
114
+ Tier : tier ,
128
115
},
129
- c .sender .GetOpts (),
130
- false ,
116
+ c .txBuilder .Build (
117
+ ctx ,
118
+ blockID ,
119
+ meta ,
120
+ & bindings.TaikoDataTransition {
121
+ ParentHash : header .ParentHash ,
122
+ BlockHash : header .Hash (),
123
+ StateRoot : header .Root ,
124
+ Graffiti : c .graffiti ,
125
+ },
126
+ & bindings.TaikoDataTierProof {
127
+ Tier : transition .Tier ,
128
+ Data : []byte {},
129
+ },
130
+ c .sender .GetOpts (),
131
+ false ,
132
+ ),
131
133
),
132
134
)
133
135
}
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ func (s *ProofSubmitter) SubmitProof(
170
170
}
171
171
172
172
// Build the TaikoL1.proveBlock transaction and send it to the L1 node.
173
- if err := s .sender .Send (
173
+ if err := encoding . TryParsingCustomError ( s .sender .Send (
174
174
ctx ,
175
175
proofWithHeader ,
176
176
s .txBuilder .Build (
@@ -190,7 +190,7 @@ func (s *ProofSubmitter) SubmitProof(
190
190
s .sender .GetOpts (),
191
191
proofWithHeader .Tier == encoding .TierGuardianID ,
192
192
),
193
- ); err != nil {
193
+ )) ; err != nil {
194
194
if err .Error () == transaction .ErrUnretryableSubmission .Error () {
195
195
return nil
196
196
}
You can’t perform that action at this time.
0 commit comments