refactor: Remove redundant string conversion in BeaconDbStater.State (#15081)

This commit is contained in:
Julian Yap
2025-03-21 09:23:16 -07:00
committed by GitHub
parent d7628bab37
commit bfa24606c3
2 changed files with 4 additions and 2 deletions

View File

@@ -143,8 +143,7 @@ func (p *BeaconDbStater) State(ctx context.Context, stateId []byte) (state.Beaco
return nil, errors.Wrap(err, "could not get justified state")
}
default:
stringId := strings.ToLower(string(stateId))
if len(stringId) >= 2 && stringId[:2] == "0x" {
if len(stateIdString) >= 2 && stateIdString[:2] == "0x" {
decoded, parseErr := hexutil.Decode(string(stateId))
if parseErr != nil {
e := NewStateIdParseError(parseErr)

View File

@@ -0,0 +1,3 @@
### Changed
- Removed redundant string conversion in `BeaconDbStater.State` to improve code clarity and maintainability.