Skip to content

Commit

Permalink
Fixup marlowe
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Apr 16, 2021
1 parent 4e613df commit 4be8226
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions marlowe/src/Language/Marlowe/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import GHC.Generics (Generic)
import Language.Marlowe.Semantics hiding (Contract)
import qualified Language.Marlowe.Semantics as Marlowe
import Language.Marlowe.Util (extractContractRoles)
import Ledger (Address (..), CurrencySymbol, Datum (..), PubKeyHash, ScriptContext (..),
Slot (..), TokenName, TxOut (..), TxOutTx (..), TxOutType (..),
ValidatorHash, mkValidatorScript, pubKeyHash, txOutDatum, txOutValue,
txOutputs, validatorHash, valueSpent)
import Ledger (CurrencySymbol, Datum (..), PubKeyHash, ScriptContext (..), Slot (..),
TokenName, TxOut (..), TxOutTx (..), ValidatorHash, mkValidatorScript,
pubKeyHash, txOutDatum, txOutValue, txOutputs, validatorHash, valueSpent)
import Ledger.Ada (adaSymbol, adaValueOf)
import Ledger.Address (pubKeyHashAddress, scriptHashAddress)
import Ledger.Constraints
import qualified Ledger.Constraints as Constraints
import qualified Ledger.Interval as Interval
Expand Down Expand Up @@ -135,7 +135,7 @@ marlowePlutusContract = do
redeem = mapError (review _MarloweError) $ do
(MarloweParams{rolesCurrency}, role, pkh) <-
endpoint @"redeem"
let address = ScriptAddress (mkRolePayoutValidatorHash rolesCurrency)
let address = scriptHashAddress (mkRolePayoutValidatorHash rolesCurrency)
utxos <- utxoAt address
let spendPayoutConstraints tx ref TxOutTx{txOutTxOut} = let
expectedDatumHash = datumHash (Datum $ PlutusTx.toData role)
Expand Down Expand Up @@ -525,7 +525,7 @@ marloweCompanionContract = contracts
where
contracts = do
pkh <- pubKeyHash <$> ownPubKey
let ownAddress = PubKeyAddress pkh
let ownAddress = pubKeyHashAddress pkh
utxo <- utxoAt ownAddress
let txOuts = fmap (txOutTxOut . snd) $ Map.toList utxo
forM_ txOuts notifyOnNewContractRoles
Expand All @@ -549,7 +549,7 @@ notifyOnNewContractRoles txout = do


filterRoles :: TxOut -> [CurrencySymbol]
filterRoles TxOut { txOutValue, txOutType = PayToPubKey } =
filterRoles TxOut { txOutValue, txOutDatumHash = Nothing } =
let curSymbols = filter (/= adaSymbol) $ AssocMap.keys $ Val.getValue txOutValue
in curSymbols
filterRoles _ = []
Expand Down

0 comments on commit 4be8226

Please sign in to comment.