Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Sep 24, 2023
1 parent 135f45d commit 0483440
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions realm/chess.gno
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ type Game struct {

func (g Game) json() string {
s, err := g.MarshalJSON()
if err != nil {
panic(err)
}
checkErr(err)
return string(s)
}

Expand Down
4 changes: 1 addition & 3 deletions realm/chess_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ func parseCommandTest(t *testing.T, command string) (funcs []testCommandRunner,
lines := strings.Split(command, "\n")
atoi := func(s string) int {
n, err := strconv.Atoi(s)
if err != nil {
panic(err)
}
checkErr(err)
return n
}
// used to detect whether to auto-add a panic checker
Expand Down
12 changes: 3 additions & 9 deletions realm/discovery.gno
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ func GetPlayer(player string) string {
panic("player not found")
}
b, err := v.(*Player).MarshalJSON()
if err != nil {
panic(err)
}
checkErr(err)
return string(b)
}

Expand Down Expand Up @@ -282,9 +280,7 @@ func Leaderboard(category string) string {
for idx, entry := range leaderboard[cat] {
p, _ := playerStore.Get(entry.addr.String())
d, err := p.(Player).MarshalJSON()
if err != nil {
panic(err)
}
checkErr(err)
buf.Write(d)
if idx != len(leaderboard[cat])-1 {
buf.WriteByte(',')
Expand Down Expand Up @@ -420,9 +416,7 @@ func parseFilters(filters string) (r listGamesFilters) {
r.minID = pred
case "limit:":
n, err := strconv.Atoi(pred)
if err != nil {
panic(err)
}
checkErr(err)
r.limit = n
case "sort:":
r.reverse = pred == "desc"
Expand Down

0 comments on commit 0483440

Please sign in to comment.