gofmt: fix formatting issues in test files (#15577)

This commit is contained in:
terence
2025-08-11 08:56:53 -07:00
committed by GitHub
parent 09565e0c3a
commit f7f992c256
8 changed files with 32 additions and 29 deletions

View File

@@ -1727,7 +1727,7 @@ func TestSubmitBlindedBlock_BlobsBundlerInterface(t *testing.T) {
t.Run("Interface signature verification", func(t *testing.T) {
// This test verifies that the SubmitBlindedBlock method signature
// has been updated to return BlobsBundler interface
client := &Client{}
// Verify the method exists with the correct signature

View File

@@ -20,7 +20,7 @@ func TestSaveOrigin(t *testing.T) {
// Initialize genesis with mainnet config - this will load the embedded mainnet state
require.NoError(t, genesis.Initialize(ctx, t.TempDir()))
// Get the initialized genesis state
st, err := genesis.State()
require.NoError(t, err)

View File

@@ -564,7 +564,7 @@ func TestBuildValidatorAssignmentMap(t *testing.T) {
start := primitives.Slot(200)
bySlot := [][][]primitives.ValidatorIndex{
{{1, 2, 3}}, // slot 200, committee 0
{{7, 8, 9}}, // slot 201, committee 0
{{7, 8, 9}}, // slot 201, committee 0
{{4, 5}, {10, 11}}, // slot 202, committee 0 & 1
}
@@ -632,7 +632,7 @@ func TestGetValidatorAssignment_WithAssignmentMap(t *testing.T) {
}
vs := &Server{}
// Test existing validator (validator 2 is at position 1 in the committee, not position 2)
assignment := vs.getValidatorAssignment(meta, primitives.ValidatorIndex(2))
require.NotNil(t, assignment)
@@ -662,7 +662,7 @@ func TestGetValidatorAssignment_WithoutAssignmentMap(t *testing.T) {
}
vs := &Server{}
// Test existing validator
assignment := vs.getValidatorAssignment(meta, primitives.ValidatorIndex(5))
require.NotNil(t, assignment)
@@ -682,24 +682,24 @@ func TestLoadMetadata_ThresholdBehavior(t *testing.T) {
epoch := primitives.Epoch(0)
tests := []struct {
name string
numValidators int
expectAssignmentMap bool
name string
numValidators int
expectAssignmentMap bool
}{
{
name: "Small request - below threshold",
numValidators: 100,
expectAssignmentMap: false,
name: "Small request - below threshold",
numValidators: 100,
expectAssignmentMap: false,
},
{
name: "Large request - at threshold",
numValidators: validatorLookupThreshold,
expectAssignmentMap: true,
name: "Large request - at threshold",
numValidators: validatorLookupThreshold,
expectAssignmentMap: true,
},
{
name: "Large request - above threshold",
numValidators: validatorLookupThreshold + 1000,
expectAssignmentMap: true,
name: "Large request - above threshold",
numValidators: validatorLookupThreshold + 1000,
expectAssignmentMap: true,
},
}

View File

@@ -37,7 +37,7 @@ func TestUnblinder_UnblindBlobSidecars_InvalidBundle(t *testing.T) {
func TestUnblindBlobsSidecars_WithBlobsBundler(t *testing.T) {
// Test that the function accepts BlobsBundler interface
// This test focuses on the interface change rather than full integration
t.Run("Interface compatibility with BlobsBundle", func(t *testing.T) {
// Create a simple pre-Deneb block that will return nil (no processing needed)
wBlock, err := consensusblocks.NewSignedBeaconBlock(&ethpb.SignedBeaconBlockCapella{
@@ -87,7 +87,7 @@ func TestUnblindBlobsSidecars_WithBlobsBundler(t *testing.T) {
t.Run("Function signature accepts BlobsBundler interface", func(t *testing.T) {
// This test verifies that the function signature has been updated to accept BlobsBundler
// We test this by verifying the code compiles with both types
// Create a simple pre-Deneb block for the interface test
wBlock, err := consensusblocks.NewSignedBeaconBlock(&ethpb.SignedBeaconBlockCapella{
Block: &ethpb.BeaconBlockCapella{
@@ -106,7 +106,7 @@ func TestUnblindBlobsSidecars_WithBlobsBundler(t *testing.T) {
_, err = unblindBlobsSidecars(wBlock, regularBundle)
require.NoError(t, err)
// Verify function accepts BlobsBundleV2 through the interface
// Verify function accepts BlobsBundleV2 through the interface
var bundleV2 enginev1.BlobsBundler = &enginev1.BlobsBundleV2{
KzgCommitments: [][]byte{make([]byte, 48)},
Proofs: [][]byte{make([]byte, 48)},

View File

@@ -22,11 +22,11 @@ import (
)
type testSetup struct {
service *Service
p2pService *p2ptest.TestP2P
beaconDB db.Database
ctx context.Context
initialSlot primitives.Slot
service *Service
p2pService *p2ptest.TestP2P
beaconDB db.Database
ctx context.Context
initialSlot primitives.Slot
initialCount uint64
}
@@ -34,7 +34,7 @@ func setupCustodyTest(t *testing.T, withChain bool) *testSetup {
ctx := t.Context()
p2pService := p2ptest.NewTestP2P(t)
beaconDB := dbtesting.SetupDB(t)
const (
initialEarliestSlot = primitives.Slot(50)
initialCustodyCount = uint64(5)
@@ -123,7 +123,7 @@ func TestUpdateCustodyInfoIfNeeded(t *testing.T) {
t.Run("Skip update when actual custody count >= target", func(t *testing.T) {
setup := setupCustodyTest(t, false)
err := setup.service.updateCustodyInfoIfNeeded()
require.NoError(t, err)

View File

@@ -0,0 +1,3 @@
### Ignored
- Fix Go formatting issues in test files

View File

@@ -28,7 +28,7 @@ func TestInitialize(t *testing.T) {
func TestEmbeddedMainnetHardcodedValues(t *testing.T) {
// Initialize genesis with mainnet config to load embedded state
require.NoError(t, genesis.Initialize(t.Context(), t.TempDir()))
// Get the initialized genesis state
state, err := genesis.State()
require.NoError(t, err)

View File

@@ -18,4 +18,4 @@ func init() {
func TestAnalyzer(t *testing.T) {
testdata := analysistest.TestData()
analysistest.RunWithSuggestedFixes(t, testdata, logcapitalization.Analyzer, "a")
}
}