@@ -45,12 +45,15 @@ func TestSubmitToDA_MempoolRetry_IncreasesGasAndSucceeds(t *testing.T) {
4545
4646 // First attempt returns a mempool-related error (mapped to StatusNotIncludedInBlock)
4747 // Expect gasPrice=1.0
48+
4849 ns := "ns"
50+ nsBz := coreda .NamespaceFromString (ns ).Bytes ()
51+
4952 opts := []byte ("opts" )
5053 // capture gas prices used
5154 var usedGas []float64
5255 mockDA .
53- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), ns , opts ).
56+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), nsBz , opts ).
5457 Run (func (args mock.Arguments ) {
5558 usedGas = append (usedGas , args .Get (2 ).(float64 ))
5659 }).
@@ -60,7 +63,7 @@ func TestSubmitToDA_MempoolRetry_IncreasesGasAndSucceeds(t *testing.T) {
6063 // Second attempt should use doubled gas price = 2.0 and succeed for all items
6164 ids := [][]byte {[]byte ("id1" ), []byte ("id2" ), []byte ("id3" )}
6265 mockDA .
63- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), ns , opts ).
66+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), nsBz , opts ).
6467 Run (func (args mock.Arguments ) {
6568 usedGas = append (usedGas , args .Get (2 ).(float64 ))
6669 }).
@@ -100,20 +103,22 @@ func TestSubmitToDA_UnknownError_RetriesSameGasThenSucceeds(t *testing.T) {
100103 mockDA .On ("GasMultiplier" , mock .Anything ).Return (3.0 , nil ).Once ()
101104
102105 ns := "ns"
106+ nsBz := coreda .NamespaceFromString (ns ).Bytes ()
107+
103108 opts := []byte ("opts" )
104109 var usedGas []float64
105110
106111 // First attempt: unknown failure -> reasonFailure, gas unchanged for next attempt
107112 mockDA .
108- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), ns , opts ).
113+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), nsBz , opts ).
109114 Run (func (args mock.Arguments ) { usedGas = append (usedGas , args .Get (2 ).(float64 )) }).
110115 Return (nil , errors .New ("boom" )).
111116 Once ()
112117
113118 // Second attempt: same gas, success
114119 ids := [][]byte {[]byte ("id1" )}
115120 mockDA .
116- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), ns , opts ).
121+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), nsBz , opts ).
117122 Run (func (args mock.Arguments ) { usedGas = append (usedGas , args .Get (2 ).(float64 )) }).
118123 Return (ids , nil ).
119124 Once ()
@@ -148,13 +153,15 @@ func TestSubmitToDA_TooBig_HalvesBatch(t *testing.T) {
148153 mockDA .On ("GasMultiplier" , mock .Anything ).Return (2.0 , nil ).Once ()
149154
150155 ns := "ns"
156+ nsBz := coreda .NamespaceFromString (ns ).Bytes ()
157+
151158 opts := []byte ("opts" )
152159 // record sizes of batches sent to DA
153160 var batchSizes []int
154161
155162 // First attempt: too big -> should halve and retry
156163 mockDA .
157- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , ns , opts ).
164+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , nsBz , opts ).
158165 Run (func (args mock.Arguments ) {
159166 blobs := args .Get (1 ).([][]byte )
160167 batchSizes = append (batchSizes , len (blobs ))
@@ -165,7 +172,7 @@ func TestSubmitToDA_TooBig_HalvesBatch(t *testing.T) {
165172 // Second attempt: expect half the size, succeed
166173 ids := [][]byte {[]byte ("id1" ), []byte ("id2" )}
167174 mockDA .
168- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , ns , opts ).
175+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , nsBz , opts ).
169176 Run (func (args mock.Arguments ) {
170177 blobs := args .Get (1 ).([][]byte )
171178 batchSizes = append (batchSizes , len (blobs ))
@@ -203,20 +210,22 @@ func TestSubmitToDA_SentinelNoGas_PreservesGasAcrossRetries(t *testing.T) {
203210 mockDA .On ("GasMultiplier" , mock .Anything ).Return (10.0 , nil ).Once ()
204211
205212 ns := "ns"
213+ nsBz := coreda .NamespaceFromString (ns ).Bytes ()
214+
206215 opts := []byte ("opts" )
207216 var usedGas []float64
208217
209218 // First attempt: mempool-ish error
210219 mockDA .
211- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), ns , opts ).
220+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), nsBz , opts ).
212221 Run (func (args mock.Arguments ) { usedGas = append (usedGas , args .Get (2 ).(float64 )) }).
213222 Return (nil , coreda .ErrTxAlreadyInMempool ).
214223 Once ()
215224
216225 // Second attempt: should use same sentinel gas (-1), succeed
217226 ids := [][]byte {[]byte ("id1" )}
218227 mockDA .
219- On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), ns , opts ).
228+ On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .AnythingOfType ("float64" ), nsBz , opts ).
220229 Run (func (args mock.Arguments ) { usedGas = append (usedGas , args .Get (2 ).(float64 )) }).
221230 Return (ids , nil ).
222231 Once ()
@@ -250,17 +259,19 @@ func TestSubmitToDA_PartialSuccess_AdvancesWindow(t *testing.T) {
250259 mockDA .On ("GasMultiplier" , mock .Anything ).Return (2.0 , nil ).Once ()
251260
252261 ns := "ns"
262+ nsBz := coreda .NamespaceFromString (ns ).Bytes ()
263+
253264 opts := []byte ("opts" )
254265 // track how many items postSubmit sees across attempts
255266 var totalSubmitted int
256267
257268 // First attempt: success for first 2 of 3
258269 firstIDs := [][]byte {[]byte ("id1" ), []byte ("id2" )}
259- mockDA .On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , ns , opts ).Return (firstIDs , nil ).Once ()
270+ mockDA .On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , nsBz , opts ).Return (firstIDs , nil ).Once ()
260271
261272 // Second attempt: success for remaining 1
262273 secondIDs := [][]byte {[]byte ("id3" )}
263- mockDA .On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , ns , opts ).Return (secondIDs , nil ).Once ()
274+ mockDA .On ("SubmitWithOptions" , mock .Anything , mock .Anything , mock .Anything , nsBz , opts ).Return (secondIDs , nil ).Once ()
264275
265276 s := newTestSubmitter (mockDA , func (c * config.Config ) { c .DA .GasPrice = 1.0 })
266277
0 commit comments