Skip to content

Commit

Permalink
fix: parse 0x failed
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Dec 11, 2024
1 parent 0cbc08c commit 72da578
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fetcher/beaconchain/beaconchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ func Init(confPath string) error {
// parse nstID by splitting it
nstID := strings.Split(cfg.NSTID, "_")
if len(nstID) != 2 {
return feedertypes.ErrInitFail.Wrap("invalid nstID format")
panic("invalid nstID format")
}
// the second element is the lzID of the chain
lzID, err := strconv.ParseUint(nstID[1], 16, 64)
lzID, err := strconv.ParseUint(strings.TrimPrefix(nstID[1], "0x"), 16, 64)
if err != nil {
return feedertypes.ErrInitFail.Wrap(err.Error())
panic("failed to parse lzID")
}
if slotsPerEpochKnown, ok := types.ChainToSlotsPerEpoch[lzID]; ok {
slotsPerEpoch = slotsPerEpochKnown
Expand Down

0 comments on commit 72da578

Please sign in to comment.