Skip to content

Commit

Permalink
chore: remove unused SanitizeLabel function and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frrist committed Jun 30, 2022
1 parent 2e43df8 commit 2b56565
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 59 deletions.
19 changes: 0 additions & 19 deletions tasks/actorstate/market/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ package market
import (
"context"
"fmt"
"strings"
"unicode/utf8"

"github.com/filecoin-project/lotus/chain/types"
"golang.org/x/text/runes"

"github.com/filecoin-project/lily/chain/actors/adt"
"github.com/filecoin-project/lily/tasks/actorstate"
Expand Down Expand Up @@ -61,19 +58,3 @@ func NewMarketStateExtractionContext(ctx context.Context, a actorstate.ActorInfo
func (m *MarketStateExtractionContext) IsGenesis() bool {
return m.CurrTs.Height() == 0
}

// SanitizeLabel ensures:
// - s is a valid utf8 string by removing any ill formed bytes.
// - s does not contain any nil (\x00) bytes because postgres doesn't support storing NULL (\0x00) characters in text fields.
func SanitizeLabel(s string) string {
if s == "" {
return s
}
s = strings.Replace(s, "\000", "", -1)
if utf8.ValidString(s) {
return s
}

tr := runes.ReplaceIllFormed()
return tr.String(s)
}
40 changes: 0 additions & 40 deletions tasks/actorstate/market/context_test.go

This file was deleted.

0 comments on commit 2b56565

Please sign in to comment.