Skip to content

Commit

Permalink
🐛 Fix submission bug
Browse files Browse the repository at this point in the history
  • Loading branch information
beskay committed Aug 26, 2023
1 parent 3027dbd commit 6d53dca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ Note: The final score on the leaderboard can differ sligthly from the local scor
}
}

// If gas and size score is worse than existing one, skip submission
if gasValue >= existingGas && sizeValue >= existingSize {
fmt.Printf("\nWarning: Submission skipped!\nExisting solution is better than the current one (gas: %d, size: %d).\n", existingGas, existingSize)
return nil
// if existing solution is found (gas and size > 0)
if existingGas > 0 && existingSize > 0 {
// If gas and size score is worse than existing one, skip submission
if gasValue >= existingGas && sizeValue >= existingSize {
fmt.Printf("\nWarning: Submission skipped!\nExisting solution is better than the current one (gas: %d, size: %d).\n", existingGas, existingSize)
return nil
}
}
}
}

// Create a JSON payload
payload := map[string]string{
Expand Down

0 comments on commit 6d53dca

Please sign in to comment.