From 20717b85b1cd255c9b423d54d1b67d78b1ce2ff9 Mon Sep 17 00:00:00 2001 From: stefann-01 Date: Sat, 28 Dec 2024 06:15:57 +0100 Subject: [PATCH] run make fmt --- examples/gno.land/r/stefann/fomo3d/errors.gno | 8 ++++---- examples/gno.land/r/stefann/fomo3d/fomo3d.gno | 16 ++++++++-------- .../gno.land/r/stefann/fomo3d/fomo3d_test.gno | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/gno.land/r/stefann/fomo3d/errors.gno b/examples/gno.land/r/stefann/fomo3d/errors.gno index 63ea487e517..99bb85ea9be 100644 --- a/examples/gno.land/r/stefann/fomo3d/errors.gno +++ b/examples/gno.land/r/stefann/fomo3d/errors.gno @@ -6,9 +6,9 @@ var ( // Game state errors ErrGameInProgress = errors.New("fomo3d: game already in progress") ErrGameNotInProgress = errors.New("fomo3d: game not in progress") - ErrGameEnded = errors.New("fomo3d: game has ended") - ErrGameTimeExpired = errors.New("fomo3d: game time expired") - ErrNoKeysPurchased = errors.New("fomo3d: no keys purchased") + ErrGameEnded = errors.New("fomo3d: game has ended") + ErrGameTimeExpired = errors.New("fomo3d: game time expired") + ErrNoKeysPurchased = errors.New("fomo3d: no keys purchased") // Payment errors ErrInvalidPayment = errors.New("fomo3d: must send ugnot only") @@ -19,4 +19,4 @@ var ( // Fee errors ErrNoFeesToClaim = errors.New("fomo3d: no owner fees to claim") -) \ No newline at end of file +) diff --git a/examples/gno.land/r/stefann/fomo3d/fomo3d.gno b/examples/gno.land/r/stefann/fomo3d/fomo3d.gno index 79fd0db5215..2603ee95589 100644 --- a/examples/gno.land/r/stefann/fomo3d/fomo3d.gno +++ b/examples/gno.land/r/stefann/fomo3d/fomo3d.gno @@ -28,8 +28,8 @@ import ( const ( MIN_KEY_PRICE int64 = 100000 // minimum key price in ugnot - TIME_EXTENSION int64 = 30 // time extension in blocks when new key is bought - MAX_TIME_EXTEND int64 = 86400 // max time that can be added (~24 hours @ 1s blocks) + TIME_EXTENSION int64 = 30 // time extension in blocks when new key is bought + MAX_TIME_EXTEND int64 = 86400 // max time that can be added (~24 hours @ 1s blocks) // Distribution percentages (total 100%) JACKPOT_PERCENT int64 = 47 // 47% goes to jackpot @@ -57,7 +57,7 @@ var ( lastBuyer std.Address // last key buyer (potential winner) players *avl.Tree // maps address -> PlayerInfo - totalKeys int64 // total number of keys in circulation + totalKeys int64 // total number of keys in circulation ended bool // Ownable instance @@ -306,10 +306,10 @@ func Render(path string) string { func RenderHome() string { gameStart, gameEnd, _, lastBuyer, pot, price, totalKeys, isEnded := GetGameState() // _, ownerFees := GetOwnerInfo() - + var builder strings.Builder builder.WriteString("# FOMO3D - The Ultimate Game of Greed\n\n") - + // About section builder.WriteString("## About the Game\n\n") builder.WriteString("FOMO3D is a blockchain-based game that combines elements of lottery and investment mechanics. ") @@ -335,7 +335,7 @@ func RenderHome() string { builder.WriteString(ufmt.Sprintf("🏆 **Winner:** %s\n", lastBuyer)) } else { builder.WriteString("🟢 **Game Status:** Active\n") - builder.WriteString(ufmt.Sprintf("⏱️ **Time Remaining:** %d blocks\n", gameEnd - std.GetHeight())) + builder.WriteString(ufmt.Sprintf("⏱️ **Time Remaining:** %d blocks\n", gameEnd-std.GetHeight())) } builder.WriteString(ufmt.Sprintf("💰 **Current Jackpot:** %d ugnot\n", pot)) builder.WriteString(ufmt.Sprintf("🔑 **Current Key Price:** %d ugnot\n", price)) @@ -376,12 +376,12 @@ func RenderPlayer(addr std.Address, keys int64, dividends int64) string { builder.WriteString("## Your Holdings\n\n") builder.WriteString(ufmt.Sprintf("🔑 **Keys Owned:** %d\n", keys)) builder.WriteString(ufmt.Sprintf("💰 **Unclaimed Dividends:** %d ugnot\n\n", dividends)) - + builder.WriteString("## Actions\n\n") builder.WriteString("* To buy more keys, send GNOT to this realm with `BuyKeys()`\n") if dividends > 0 { builder.WriteString("* You have unclaimed dividends! Call `ClaimDividends()` to collect them\n") } - + return builder.String() } diff --git a/examples/gno.land/r/stefann/fomo3d/fomo3d_test.gno b/examples/gno.land/r/stefann/fomo3d/fomo3d_test.gno index 325f90d51fa..f4c5f3f33a5 100644 --- a/examples/gno.land/r/stefann/fomo3d/fomo3d_test.gno +++ b/examples/gno.land/r/stefann/fomo3d/fomo3d_test.gno @@ -158,7 +158,7 @@ func TestFullGameFlow(t *testing.T) { // Verify player state keys, dividends := GetPlayerInfo(player1) - + shouldEqual(t, keys, int64(3)) shouldEqual(t, dividends, int64(0)) shouldEqual(t, lastBuyer, player1) @@ -185,7 +185,7 @@ func TestFullGameFlow(t *testing.T) { // Check player1 received dividends keys1, dividends1 := GetPlayerInfo(player1) - + shouldEqual(t, keys1, int64(3)) expectedDividends := payment * DIVIDENDS_PERCENT / 100 * 3 / totalKeys shouldEqual(t, dividends1, expectedDividends) @@ -236,7 +236,7 @@ func TestFullGameFlow(t *testing.T) { shouldNoPanic(t, StartGame) shouldEqual(t, ended, false) shouldEqual(t, currentRound, int64(2)) - + shouldEqual(t, jackpot, expectedNextPot) // New round starts with previous round's nextPot shouldEqual(t, nextPot, int64(0)) }) @@ -319,10 +319,10 @@ func TestClaimDividends(t *testing.T) { func TestEndGame(t *testing.T) { setupTestGame(t) StartGame() - + // Skip to end + 1 to ensure we're past the end block std.TestSkipHeights(MAX_TIME_EXTEND + 1) - + shouldPanic(t, EndGame) // Should panic because no keys purchased // Reset and start new game @@ -342,6 +342,6 @@ func TestEndGame(t *testing.T) { // Skip to well past the end std.TestSkipHeights(MAX_TIME_EXTEND + TIME_EXTENSION + 1) - + shouldNoPanic(t, EndGame) }