From f6b1609faf5c57442f521a60520b095c7b9d39c8 Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Sun, 8 Sep 2024 21:04:14 +0530 Subject: [PATCH] linter Signed-off-by: nidhi-singh02 --- testing/e2e/e2e_api_test.go | 40 +++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/testing/e2e/e2e_api_test.go b/testing/e2e/e2e_api_test.go index 99dd9c1bf8..1468c7002b 100644 --- a/testing/e2e/e2e_api_test.go +++ b/testing/e2e/e2e_api_test.go @@ -71,11 +71,26 @@ func (s *BeaconKitE2ESuite) TestBeaconFork() { s.Require().NotEmpty(fork.PreviousVersion) s.Require().NotEmpty(fork.CurrentVersion) expectedVersion := phase0.Version{0x04, 0x00, 0x00, 0x00} - s.Require().Equal(expectedVersion, fork.PreviousVersion, "PreviousVersion does not match expected value") - s.Require().Equal(expectedVersion, fork.CurrentVersion, "CurrentVersion does not match expected value") - s.Require().Equal(phase0.Epoch(0), fork.Epoch, "Epoch does not match expected value") + s.Require().Equal( + expectedVersion, + fork.PreviousVersion, + "PreviousVersion does not match expected value", + ) + s.Require().Equal( + expectedVersion, + fork.CurrentVersion, + "CurrentVersion does not match expected value", + ) + s.Require().Equal( + phase0.Epoch(0), + fork.Epoch, + "Epoch does not match expected value", + ) } +// TestBeaconValidators tests the beacon node api for beacon validators. +// +//nolint:lll func (s *BeaconKitE2ESuite) TestBeaconValidators() { client := s.initBeaconTest() @@ -98,7 +113,6 @@ func (s *BeaconKitE2ESuite) TestBeaconValidators() { for _, validator := range validatorData { s.Require().NotNil(validator, "Validator should not be nil") - s.Require().True(validator.Index >= 0, "Validator index should be non-negative") s.Require().Contains(indices, validator.Index, "Validator index should be one of the requested indices") s.Require().NotEmpty(validator.Validator.PublicKey, "Validator public key should not be empty") @@ -112,8 +126,6 @@ func (s *BeaconKitE2ESuite) TestBeaconValidators() { s.Require().False(validator.Validator.Slashed, "Slashed status should not be true") - s.Require().True(validator.Validator.ActivationEligibilityEpoch >= 0, "Activation eligibility epoch should be non-negative") - s.Require().True(validator.Validator.ActivationEpoch >= validator.Validator.ActivationEligibilityEpoch, "Activation epoch should be greater than or equal to activation eligibility epoch") @@ -122,8 +134,8 @@ func (s *BeaconKitE2ESuite) TestBeaconValidators() { s.Require().NotEmpty(validator.Status, "Validator status should not be empty") - s.Require().True(validator.Balance > 0, "Validator balance should be positive") - s.Require().True(validator.Balance <= 32e9, "Validator balance should not exceed 32 ETH") + s.Require().Greater(validator.Balance, 0, "Validator balance should be positive") + s.Require().LessOrEqual(validator.Balance, 32e9, "Validator balance should not exceed 32 ETH") } } @@ -159,6 +171,14 @@ func (s *BeaconKitE2ESuite) TestBeaconRandao() { s.Require().NotNil(stateRandaoResp) s.Require().NotEmpty(stateRandaoResp.Data) randao := stateRandaoResp.Data - s.Require().Len(randao, 32, "Randao should be 32 bytes long") - s.Require().NotEqual(make([]byte, 32), randao, "Randao should not be all zeros") + s.Require().Len( + randao, + 32, + "Randao should be 32 bytes long", + ) + s.Require().NotEqual( + make([]byte, 32), + randao, + "Randao should not be all zeros", + ) }