Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
olgaklimenko committed Jul 14, 2023
1 parent 3195408 commit 30e7536
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Protocol/ProtocolScriptInfo.purs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ getProtocolScriptInfo protocol = do
protocolUtxo <- getProtocolUtxo protocol utxos
currentDatum <- liftContractM "Impossible to get Protocol Datum" $ extractDatumFromUTxO protocolUtxo
let value = extractValueFromUTxO protocolUtxo

let scriptRef = PlutusScriptRef (unwrap protocolValidator)
refScriptUtxo <- getUtxoByScriptRef "Protocol" scriptRef utxos
let refScriptInput = Constraints.RefInput $ mkTxUnspentOut (fst refScriptUtxo) (snd refScriptUtxo)
Expand Down
4 changes: 2 additions & 2 deletions src/Protocol/UpdateProtocol.purs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contract protocolData protocolConfigParams = do
constraints :: Constraints.TxConstraints Void Void
constraints =
Constraints.mustSpendScriptOutputUsingScriptRef
(fst protocolInfo.pUtxo)
(fst protocolInfo.pUtxo)
updateProtocolRedeemer
protocolInfo.pRefScriptInput
<> Constraints.mustPayToScriptAddress
Expand All @@ -74,7 +74,7 @@ contract protocolData protocolConfigParams = do
let
lookups :: Lookups.ScriptLookups Void
lookups =
Lookups.unspentOutputs protocolInfo.pUtxos
Lookups.unspentOutputs protocolInfo.pUtxos
<> Lookups.unspentOutputs walletUtxo

unbalancedTx <- liftedE $ Lookups.mkUnbalancedTx lookups constraints
Expand Down
19 changes: 10 additions & 9 deletions src/Shared/ScriptRef.purs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ createRefScriptUtxo scriptName validatorHash validator = do
let
constraints :: Constraints.TxConstraints Unit Unit
constraints = Constraints.mustPayToScriptAddressWithScriptRef
validatorHash
(ScriptCredential validatorHash)
unitDatum
Constraints.DatumWitness
scriptRef
minAdaValue
validatorHash
(ScriptCredential validatorHash)
unitDatum
Constraints.DatumWitness
scriptRef
minAdaValue

lookups :: Lookups.ScriptLookups PlutusData
lookups = Lookups.unspentOutputs creds.ownUtxo

unbalancedTx <- liftedE $ Lookups.mkUnbalancedTx lookups constraints
addressWithNetworkTag <-
liftedM "Failed to get own address with Network Tag"
$ Array.head <$> getWalletAddressesWithNetworkTag
addressWithNetworkTag <-
liftedM "Failed to get own address with Network Tag"
$ Array.head
<$> getWalletAddressesWithNetworkTag

let
balanceTxConstraints :: BalanceTxConstraintsBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Utxo.purs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ checkScriptRefInUTxO scriptRef (Tuple _ txOutWithRef) =

filteByScriptRefInUtxo :: ScriptRef -> Array UtxoTuple -> Array UtxoTuple
filteByScriptRefInUtxo scriptRef =
Array.filter (checkScriptRefInUTxO scriptRef)
Array.filter (checkScriptRefInUTxO scriptRef)

getUtxoByScriptRef :: String -> ScriptRef -> UtxoMap -> Contract UtxoTuple
getUtxoByScriptRef scriptName scriptRef utxos =
Expand Down

0 comments on commit 30e7536

Please sign in to comment.