Skip to content

Commit 3925c86

Browse files
fix lint
1 parent 76f652b commit 3925c86

5 files changed

Lines changed: 12 additions & 17 deletions

File tree

‎block/daIncluder_test.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestDAIncluderLoop_AdvancesHeightWhenBothDAIncluded(t *testing.T) {
4343
t.Parallel()
4444
m, store, exec, _ := newTestManager(t)
4545
startDAIncludedHeight := uint64(4)
46-
expectedDAIncludedHeight := uint64(startDAIncludedHeight + 1)
46+
expectedDAIncludedHeight := startDAIncludedHeight + 1
4747
m.daIncludedHeight.Store(startDAIncludedHeight)
4848

4949
header, data := types.GetRandomBlock(5, 1, "testchain")
@@ -180,7 +180,7 @@ func TestIncrementDAIncludedHeight_Success(t *testing.T) {
180180
t.Parallel()
181181
m, store, exec, _ := newTestManager(t)
182182
startDAIncludedHeight := uint64(4)
183-
expectedDAIncludedHeight := uint64(startDAIncludedHeight + 1)
183+
expectedDAIncludedHeight := startDAIncludedHeight + 1
184184
m.daIncludedHeight.Store(startDAIncludedHeight)
185185

186186
heightBytes := make([]byte, 8)
@@ -201,7 +201,7 @@ func TestIncrementDAIncludedHeight_SetMetadataError(t *testing.T) {
201201
t.Parallel()
202202
m, store, _, mockLogger := newTestManager(t)
203203
startDAIncludedHeight := uint64(4)
204-
expectedDAIncludedHeight := uint64(startDAIncludedHeight + 1)
204+
expectedDAIncludedHeight := startDAIncludedHeight + 1
205205
m.daIncludedHeight.Store(startDAIncludedHeight)
206206

207207
heightBytes := make([]byte, 8)
@@ -225,7 +225,7 @@ func TestIncrementDAIncludedHeight_SetFinalError(t *testing.T) {
225225
t.Parallel()
226226
m, store, exec, mockLogger := newTestManager(t)
227227
startDAIncludedHeight := uint64(4)
228-
expectedDAIncludedHeight := uint64(startDAIncludedHeight + 1)
228+
expectedDAIncludedHeight := startDAIncludedHeight + 1
229229
m.daIncludedHeight.Store(startDAIncludedHeight)
230230

231231
heightBytes := make([]byte, 8)

‎block/manager.go‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ func (m *Manager) publishBlockInternal(ctx context.Context) error {
568568
return fmt.Errorf("timestamp is not monotonically increasing: %s < %s", batchData.Time, m.getLastBlockTime())
569569
}
570570
m.logger.Info("Creating and publishing block", "height", newHeight)
571-
m.logger.Debug("block info", "num_tx", len(batchData.Batch.Transactions))
571+
m.logger.Debug("block info", "num_tx", len(batchData.Transactions))
572572
}
573573

574574
header, data, err = m.createBlock(ctx, newHeight, lastSignature, lastHeaderHash, batchData)
@@ -822,11 +822,6 @@ func (m *Manager) execCreateBlock(_ context.Context, height uint64, lastSignatur
822822
return header, blockData, nil
823823
}
824824

825-
func (m *Manager) execCommit(ctx context.Context, newState types.State, h *types.SignedHeader, _ *types.Data) ([]byte, error) {
826-
err := m.exec.SetFinal(ctx, h.Height())
827-
return newState.AppHash, err
828-
}
829-
830825
func (m *Manager) execApplyBlock(ctx context.Context, lastState types.State, header *types.SignedHeader, data *types.Data) (types.State, error) {
831826
rawTxs := make([][]byte, len(data.Txs))
832827
for i := range data.Txs {

‎block/retriever.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (m *Manager) processNextDAHeaderAndData(ctx context.Context) error {
7777
}
7878
m.logger.Debug("retrieved potential data", "n", len(blobsResp.Data), "daHeight", daHeight)
7979
for _, bz := range blobsResp.Data {
80-
if bz == nil || len(bz) == 0 {
80+
if len(bz) == 0 {
8181
m.logger.Debug("ignoring nil or empty blob", "daHeight", daHeight)
8282
continue
8383
}

‎block/store_test.go‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ import (
1111

1212
"cosmossdk.io/log"
1313
ds "github.com/ipfs/go-datastore"
14-
"github.com/stretchr/testify/assert"
15-
"github.com/stretchr/testify/mock"
16-
"github.com/stretchr/testify/require"
17-
1814
"github.com/rollkit/rollkit/pkg/config"
1915
"github.com/rollkit/rollkit/pkg/signer/noop"
20-
2116
// Use existing store mock if available, or define one
2217
mocksStore "github.com/rollkit/rollkit/test/mocks"
2318
extmocks "github.com/rollkit/rollkit/test/mocks/external"
2419
"github.com/rollkit/rollkit/types"
20+
"github.com/stretchr/testify/assert"
21+
"github.com/stretchr/testify/mock"
22+
"github.com/stretchr/testify/require"
2523
)
2624

2725
func setupManagerForStoreRetrieveTest(t *testing.T) (

‎types/serialization.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ func (d *Data) FromProto(other *pb.Data) error {
218218
if d.Metadata == nil {
219219
d.Metadata = &Metadata{}
220220
}
221-
d.Metadata.FromProto(other.Metadata)
221+
if err := d.Metadata.FromProto(other.Metadata); err != nil {
222+
return err
223+
}
222224
}
223225
d.Txs = byteSlicesToTxs(other.Txs)
224226

0 commit comments

Comments
 (0)