From 72da57817c6e9a5166396404e129530918b450b1 Mon Sep 17 00:00:00 2001 From: leonz789 Date: Wed, 11 Dec 2024 21:32:41 +0800 Subject: [PATCH] fix: parse 0x failed --- fetcher/beaconchain/beaconchain.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetcher/beaconchain/beaconchain.go b/fetcher/beaconchain/beaconchain.go index 2f5ae98..f8bea48 100644 --- a/fetcher/beaconchain/beaconchain.go +++ b/fetcher/beaconchain/beaconchain.go @@ -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