Skip to content

Commit

Permalink
align with rusty block version test
Browse files Browse the repository at this point in the history
  • Loading branch information
okilisan committed Aug 23, 2024
1 parent 4ab6b22 commit d1e678a
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ func (v *blockValidator) checkBlockVersion(header externalapi.BlockHeader) error
ruleerrors.ErrWrongBlockVersion, "The block version should be %d", constants.BlockVersion)
}
*/
if header.DAAScore() >= v.hfDAAScore {
if header.Version() != constants.BlockVersionKHashV2 {
log.Warnf("After HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV2, header.DAAScore(), header.Version())
}
} else {
if header.Version() != constants.BlockVersionKHashV1 {
log.Warnf("Before HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV1, header.DAAScore(), header.Version())
}
if header.DAAScore() >= v.hfDAAScore && header.Version() != constants.BlockVersionKHashV2 {
log.Warnf("After HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV2, header.DAAScore(), header.Version())
return errors.Wrapf(ruleerrors.ErrWrongBlockVersion, "The block version should be %d", constants.BlockVersionKHashV2)
} else if header.DAAScore() < v.hfDAAScore && header.Version() != constants.BlockVersionKHashV1 {
log.Warnf("Before HF1 the block version should be %d - block[%d][v%d]", constants.BlockVersionKHashV1, header.DAAScore(), header.Version())
return errors.Wrapf(ruleerrors.ErrWrongBlockVersion, "The block version should be %d", constants.BlockVersionKHashV1)
}
return nil
}
Expand Down

0 comments on commit d1e678a

Please sign in to comment.