Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Sync up guess endpoint to match plutus game contract #20

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/src/Plutus/Contracts/Game.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ lock = do

guess :: (AsContractError e) => Contract () GameSchema e ()
guess = do
-- Wait for script to have a UTxO of a least 1 lovelace
logInfo @Prelude.String "Waiting for script to have a UTxO of at least 1 lovelace"
utxos <- fundsAtAddressGeq gameAddress (Ada.lovelaceValueOf 1)
-- Wait for a call on the guess endpoint
logInfo @Prelude.String "Waiting for guess endpoint..."
GuessParams theGuess <- endpoint @"guess" @GuessParams
-- Wait for script to have a UTxO of a least 1 lovelace
logInfo @Prelude.String "Waiting for script to have a UTxO of at least 1 lovelace"
utxos <- fundsAtAddressGeq gameAddress (Ada.lovelaceValueOf 1)

let redeemer = clearString theGuess
tx = collectFromScript utxos redeemer
Expand Down