mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-11 00:18:06 -05:00
refactor: Remove redundant string conversion in BeaconDbStater.State (#15081)
This commit is contained in:
@@ -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)
|
||||
|
||||
3
changelog/jyap808-staterrefactor.md
Normal file
3
changelog/jyap808-staterrefactor.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Changed
|
||||
|
||||
- Removed redundant string conversion in `BeaconDbStater.State` to improve code clarity and maintainability.
|
||||
Reference in New Issue
Block a user