Skip to content

Commit

Permalink
remove sanitize chainame
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Nov 17, 2023
1 parent 284e3d7 commit dc4051d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions pkg/snapshot/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package snapshot

import (
"encoding/json"
"strings"
)

type SnapshotHeader struct {
Expand All @@ -27,14 +26,3 @@ func SnapshotHeaderFromJson(snapshotHeaderOutput string) (*SnapshotHeader, error

return &snapshotHeader.SnapshotHeader, nil
}

// Example: TEZOS_ITHACANET_2022-01-25T15:00:00Z to ghostnet
// Example: TEZOS_MAINNETrolling to mainnet
func (s *SnapshotHeader) SanitizeChainame() string {
parts := strings.Split(s.ChaiName, "_")
chainName := strings.ToLower(parts[1])
if chainName == "ithacanet" {
chainName = "ghostnet"
}
return chainName
}
2 changes: 1 addition & 1 deletion pkg/store/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (s *SnapshotStorage) GetSnapshotItems(ctx context.Context) []snapshot.Snaps
Filename: filename,
Filesize: util.FileSize(size),
FilesizeBytes: size,
ChainName: snapshotHeader.SanitizeChainame(),
ChainName: snapshotHeader.ChaiName,
Date: date,
BlockTimestamp: snapshotHeader.Timestamp,
URL: obj.MediaLink,
Expand Down

0 comments on commit dc4051d

Please sign in to comment.