Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-roberts committed Jun 12, 2024
1 parent 079b917 commit 8162311
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
10 changes: 2 additions & 8 deletions backend/quests/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@ func CheckHodlStatus(q *Quest, user string) (progress int, needed int) {
}

func CheckNftStatus(q *Quest, user string) (progress int, needed int) {
// gets the count of NFTs minted by `user`
nfts_minted_by_user, err := core.PostgresQueryOne[int]("SELECT COUNT(*) FROM NFTs WHERE minter = $1", user)
// if error is encountered, return 0, 1

if err != nil {
return 0, 1
}
// checks if count is greater than 0, if yes, returns 1, 1, else 0, 1
if *nfts_minted_by_user > 0 {
return 1, 1
}
return 0, 1
return *nfts_minted_by_user, 1
}

func CheckPixelStatus(q *Quest, user string) (progress int, needed int) {
Expand Down Expand Up @@ -118,7 +113,6 @@ func CheckUnruggableStatus(q *Quest, user string) (progress int, needed int) {
}

func CheckUsernameStatus(q *Quest, user string) (progress int, needed int) {

count, err := core.PostgresQueryOne[int]("SELECT COUNT (*) FROM Users where address = $1", user)

if err != nil {
Expand Down
12 changes: 0 additions & 12 deletions configs/quests.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@
],
"storeParams": []
}
},
{
"name": "Mint an NFT",
"description": "Mint NFT of any size from the canvas",
"reward": 5,
"questContract": {
"type": "NFTMintQuest",
"initParams": [
"$ART_PEACE_CONTRACT",
"$REWARD"
]
}
}
]
},
Expand Down

0 comments on commit 8162311

Please sign in to comment.