Skip to content

Commit

Permalink
feat: changes based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Nov 5, 2024
1 parent 479711d commit f6860b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/taiko-client/driver/chain_syncer/blob/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Syncer struct {
reorgDetectedFlag bool
maxRetrieveExponent uint64
blobDatasource *rpc.BlobDataSource
mutex *sync.Mutex
mutex sync.Mutex
}

// NewSyncer creates a new syncer instance.
Expand Down Expand Up @@ -90,7 +90,6 @@ func NewSyncer(
blobServerEndpoint,
socialScanEndpoint,
),
mutex: new(sync.Mutex),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ func (s *DriverTestSuite) insertSoftBlock(
marker = softblocks.BatchMarkerEmpty
}

txBatch := softblocks.TransactionBatch{
txBatch := &softblocks.TransactionBatch{
BlockID: l2BlockID,
ID: batchID,
TransactionsList: b,
Expand Down
5 changes: 4 additions & 1 deletion packages/taiko-client/driver/soft_blocks/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (b *TransactionBatch) ValidateSignature() (bool, error) {
// soft blocks creation requests.
type BuildSoftBlockRequestBody struct {
// @param transactionBatch TransactionBatch Transaction batch to be inserted into the soft block
TransactionBatch TransactionBatch `json:"transactionBatch"`
TransactionBatch *TransactionBatch `json:"transactionBatch"`
}

// CreateOrUpdateBlocksFromBatchResponseBody represents a response body when handling soft
Expand Down Expand Up @@ -109,6 +109,9 @@ func (s *SoftBlockAPIServer) BuildSoftBlock(c echo.Context) error {
if err := c.Bind(reqBody); err != nil {
s.returnError(c, http.StatusUnprocessableEntity, err)
}
if reqBody.TransactionBatch == nil {
return s.returnError(c, http.StatusBadRequest, errors.New("transactionBatch is required"))
}

log.Info(
"New soft block building request",
Expand Down

0 comments on commit f6860b5

Please sign in to comment.