5
5
"errors"
6
6
"fmt"
7
7
"os"
8
+ "strconv"
8
9
"strings"
9
10
10
11
builderApiV1 "github.com/attestantio/go-builder-client/api/v1"
@@ -194,8 +195,8 @@ type BuilderGetValidatorsResponseEntry struct {
194
195
195
196
type BidTraceV2 struct {
196
197
builderApiV1.BidTrace
197
- BlockNumber uint64 `db:"block_number" json:"block_number,string"`
198
- NumTx uint64 `db:"num_tx" json:"num_tx,string"`
198
+ BlockNumber uint64 `db:"block_number" json:"block_number,string"`
199
+ NumTx uint64 `db:"num_tx" json:"num_tx,string"`
199
200
}
200
201
201
202
type BidTraceV2JSON struct {
@@ -267,17 +268,17 @@ func (b *BidTraceV2JSON) CSVHeader() []string {
267
268
268
269
func (b * BidTraceV2JSON ) ToCSVRecord () []string {
269
270
return []string {
270
- fmt . Sprint (b .Slot ),
271
+ strconv . FormatUint (b .Slot , 10 ),
271
272
b .ParentHash ,
272
273
b .BlockHash ,
273
274
b .BuilderPubkey ,
274
275
b .ProposerPubkey ,
275
276
b .ProposerFeeRecipient ,
276
- fmt . Sprint (b .GasLimit ),
277
- fmt . Sprint (b .GasUsed ),
277
+ strconv . FormatUint (b .GasLimit , 10 ),
278
+ strconv . FormatUint (b .GasUsed , 10 ),
278
279
b .Value ,
279
- fmt . Sprint (b .NumTx ),
280
- fmt . Sprint (b .BlockNumber ),
280
+ strconv . FormatUint (b .NumTx , 10 ),
281
+ strconv . FormatUint (b .BlockNumber , 10 ),
281
282
}
282
283
}
283
284
@@ -309,20 +310,20 @@ func (b *BidTraceV2WithTimestampJSON) CSVHeader() []string {
309
310
310
311
func (b * BidTraceV2WithTimestampJSON ) ToCSVRecord () []string {
311
312
return []string {
312
- fmt . Sprint (b .Slot ),
313
+ strconv . FormatUint (b .Slot , 10 ),
313
314
b .ParentHash ,
314
315
b .BlockHash ,
315
316
b .BuilderPubkey ,
316
317
b .ProposerPubkey ,
317
318
b .ProposerFeeRecipient ,
318
- fmt . Sprint (b .GasLimit ),
319
- fmt . Sprint (b .GasUsed ),
319
+ strconv . FormatUint (b .GasLimit , 10 ),
320
+ strconv . FormatUint (b .GasUsed , 10 ),
320
321
b .Value ,
321
- fmt . Sprint (b .NumTx ),
322
- fmt . Sprint (b .BlockNumber ),
323
- fmt . Sprint (b .Timestamp ),
324
- fmt . Sprint (b .TimestampMs ),
325
- fmt . Sprint (b .OptimisticSubmission ),
322
+ strconv . FormatUint (b .NumTx , 10 ),
323
+ strconv . FormatUint (b .BlockNumber , 10 ),
324
+ strconv . FormatInt (b .Timestamp , 10 ),
325
+ strconv . FormatInt (b .TimestampMs , 10 ),
326
+ strconv . FormatBool (b .OptimisticSubmission ),
326
327
}
327
328
}
328
329
@@ -599,7 +600,7 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e
599
600
s .Message = new (builderApiV1.BidTrace )
600
601
}
601
602
if dst , err = s .Message .MarshalSSZTo (dst ); err != nil {
602
- return
603
+ return nil , err
603
604
}
604
605
605
606
// Offset (1) 'ExecutionPayloadHeader'
@@ -624,13 +625,13 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e
624
625
625
626
// Field (1) 'ExecutionPayloadHeader'
626
627
if dst , err = s .ExecutionPayloadHeader .MarshalSSZTo (dst ); err != nil {
627
- return
628
+ return nil , err
628
629
}
629
630
630
631
// Field (3) 'Transactions'
631
632
if size := len (s .Transactions ); size > 1073741824 {
632
633
err = ssz .ErrListTooBigFn ("SubmitBlockRequestV2Optimistic.Transactions" , size , 1073741824 )
633
- return
634
+ return nil , err
634
635
}
635
636
{
636
637
offset = 4 * len (s .Transactions )
@@ -642,19 +643,19 @@ func (s *SubmitBlockRequestV2Optimistic) MarshalSSZTo(buf []byte) (dst []byte, e
642
643
for ii := 0 ; ii < len (s .Transactions ); ii ++ {
643
644
if size := len (s .Transactions [ii ]); size > 1073741824 {
644
645
err = ssz .ErrBytesLengthFn ("SubmitBlockRequestV2Optimistic.Transactions[ii]" , size , 1073741824 )
645
- return
646
+ return nil , err
646
647
}
647
648
dst = append (dst , s .Transactions [ii ]... )
648
649
}
649
650
650
651
// Field (4) 'Withdrawals'
651
652
if size := len (s .Withdrawals ); size > 16 {
652
653
err = ssz .ErrListTooBigFn ("SubmitBlockRequestV2Optimistic.Withdrawals" , size , 16 )
653
- return
654
+ return nil , err
654
655
}
655
656
for ii := 0 ; ii < len (s .Withdrawals ); ii ++ {
656
657
if dst , err = s .Withdrawals [ii ].MarshalSSZTo (dst ); err != nil {
657
- return
658
+ return nil , err
658
659
}
659
660
}
660
661
return dst , nil
0 commit comments