Skip to content

Commit

Permalink
round number on indexer 2
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-roberts committed Jan 16, 2025
1 parent d41beae commit c811d6a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/config/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type CanvasConfig struct {
Colors []string `json:"colors"`
VotableColors []string `json:"votableColors"`
ColorsBitWidth uint `json:"colorsBitwidth"`
Round uint `json:"round"`
Round string `json:"round"`
}

var DefaultCanvasConfig = &CanvasConfig{
Expand Down Expand Up @@ -43,7 +43,7 @@ var DefaultCanvasConfig = &CanvasConfig{
"#00DDDD",
},
ColorsBitWidth: 5,
Round: 2,
Round: "2",
}

var DefaultCanvasConfigPath = "../configs/canvas.config.json"
Expand Down
3 changes: 1 addition & 2 deletions backend/routes/canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net/http"
"strconv"

"github.com/keep-starknet-strange/art-peace/backend/core"
routeutils "github.com/keep-starknet-strange/art-peace/backend/routes/utils"
Expand Down Expand Up @@ -53,7 +52,7 @@ func getCanvas(w http.ResponseWriter, r *http.Request) {
// Get round number from query params, default to config round
roundNumber := r.URL.Query().Get("round")
if roundNumber == "" {
roundNumber = strconv.Itoa(int(core.ArtPeaceBackend.CanvasConfig.Round))
roundNumber = core.ArtPeaceBackend.CanvasConfig.Round
}

canvasKey := fmt.Sprintf("canvas-%s", roundNumber)
Expand Down
1 change: 0 additions & 1 deletion backend/routes/indexer/nft.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func processNFTMintedEvent(event IndexerEvent) {
}

// TODO: Check if file exists
roundNumber := os.Getenv("ROUND_NUMBER")
if roundNumber == "" {
PrintIndexerError("processNFTMintedEvent", "Error getting round number from environment", tokenIdLowHex, positionHex, widthHex, heightHex, nameHex, imageHashHex, blockNumberHex, minter)
return
Expand Down
2 changes: 1 addition & 1 deletion configs/canvas.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
"D4D7D9"
],
"colorsBitwidth": 5,
"round": 2
"round": "2"
}

0 comments on commit c811d6a

Please sign in to comment.