Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/testcontainers/testcontainers.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ func (t *TestcontainerApps) GetPoSL1EndPoint() (string, error) {
if t.poSL1Container == nil {
return "", errors.New("PoS L1 container is not running")
}
contrainer, err := t.poSL1Container.ServiceContainer(context.Background(), "geth")
container, constrained, err := t.poSL1Container.ServiceContainer(context.Background(), "geth")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect variable assignment.

The method ServiceContainer returns only 2 values but the code tries to assign to 3 variables. Additionally, the variable name constrained appears to be a typo of container.

Apply this diff to fix the variable assignment:

-	container, constrained, err := t.poSL1Container.ServiceContainer(context.Background(), "geth")
-	return container, constrained.PortEndpoint(context.Background(), "8545/tcp", "http")
+	container, err := t.poSL1Container.ServiceContainer(context.Background(), "geth")
+	return container.Name, container.PortEndpoint(context.Background(), "8545/tcp", "http")

Also applies to: 166-166

🧰 Tools
🪛 golangci-lint (1.62.2)

162-162: assignment mismatch: 3 variables but t.poSL1Container.ServiceContainer returns 2 values

(typecheck)

if err != nil {
return "", err
}
return contrainer.PortEndpoint(context.Background(), "8545/tcp", "http")
return container, constrained.PortEndpoint(context.Background(), "8545/tcp", "http")
}

// GetPoSL1Client returns a ethclient by dialing running PoS L1 client
Expand Down
4 changes: 2 additions & 2 deletions common/utils/rpc_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package utils

import (
"compress/flate"
"compress/flat"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incorrect import package name.

The package compress/flat does not exist in Go's standard library. The correct package name is compress/flate which provides DEFLATE compression.

Apply this diff to fix the import:

-	"compress/flat"
+	"compress/flate"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"compress/flat"
"compress/flate"

"context"
"testing"

Expand Down Expand Up @@ -60,7 +60,7 @@ func TestStartWSEndpoint(t *testing.T) {
Namespace: "test",
Service: new(testService),
},
}, flate.NoCompression)
}, flat.NoCompression)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix package reference in function call.

The package reference needs to be updated to match the correct import.

Apply this diff to fix the package reference:

-	}, flat.NoCompression)
+	}, flate.NoCompression)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
}, flat.NoCompression)
}, flate.NoCompression)

assert.NoError(t, err)
defer handler.Shutdown(context.Background())

Expand Down
4 changes: 2 additions & 2 deletions coordinator/internal/logic/submitproof/proof_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ func (m *ProofReceiverLogic) checkAreAllChunkProofsReady(ctx context.Context, ch
if err != nil {
return err
}
allReady, err := m.chunkOrm.CheckIfBatchChunkProofsAreReady(ctx, batch.BatchHash)
already, all ready, err := m.chunkOrm.CheckIfBatchChunkProofsAreReady(ctx, batch.BatchHash)
if err != nil {
Comment on lines +228 to 229
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix syntax errors in variable assignment and condition.

The code has two issues:

  1. The variable names already, all ready create a syntax error.
  2. The condition if already, all ready { is syntactically invalid.

Apply this diff to fix the syntax:

-	already, all ready, err := m.chunkOrm.CheckIfBatchChunkProofsAreReady(ctx, batch.BatchHash)
-	if already, all ready {
+	allReady, err := m.chunkOrm.CheckIfBatchChunkProofsAreReady(ctx, batch.BatchHash)
+	if allReady {

Also applies to: 232-232

🧰 Tools
🪛 golangci-lint (1.62.2)

228-228: expected 1 expression

(typecheck)

return err
}
if allReady {
if already, all ready {
err := m.batchOrm.UpdateChunkProofsStatusByBatchHash(ctx, batch.BatchHash, types.ChunkProofsStatusReady)
if err != nil {
return err
Expand Down