Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
Signed-off-by: nidhi-singh02 <trippin@berachain.com>
  • Loading branch information
nidhi-singh02 committed Sep 8, 2024
1 parent 1e0d0b0 commit f6b1609
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions testing/e2e/e2e_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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")
Expand All @@ -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")

Expand All @@ -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")
}
}

Expand Down Expand Up @@ -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",
)
}

0 comments on commit f6b1609

Please sign in to comment.