Skip to content

Commit

Permalink
Merge pull request #720 from input-output-hk/plt-7663-fix-marlowe-cli…
Browse files Browse the repository at this point in the history
…-run

PLT-7663 Fix `marlowe cli run`
  • Loading branch information
jhbertra authored Sep 26, 2023
2 parents 432cef3 + 4686992 commit fe834df
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
54 changes: 42 additions & 12 deletions marlowe-cli/command/Language/Marlowe/CLI/Command/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -267,20 +267,20 @@ runRunCommand
runRunCommand command =
do
let network' = network command
connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File $ socketPath command
}
marloweParams' = maybe defaultMarloweParams marloweParams $ rolesCurrency command
stake' = fromMaybe NoStakeAddress $ stake command
printTxId = liftIO . putStrLn . ("TxId " <>) . show
padTxOut (address, value) = (address, C.TxOutDatumNone, value)
outputs' = padTxOut <$> outputs command
costModel <- getPV2CostModelParams (QueryNode connection)
case command of
Initialize{..} -> do
let connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File socketPath
}
costModel <- getPV2CostModelParams (QueryNode connection)
slotConfig <- querySlotConfig connection
protocolVersion <- getProtocolVersion (QueryNode connection)
initializeTransaction
Expand All @@ -305,7 +305,13 @@ runRunCommand command =
maximumTime
outputFile
printStats
Run{..} ->
Run{..} -> do
let connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File socketPath
}
runTransaction
connection
marloweIn
Expand All @@ -320,7 +326,13 @@ runRunCommand command =
printStats
invalid
>>= printTxId
Withdraw{..} ->
Withdraw{..} -> do
let connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File socketPath
}
withdrawFunds
connection
marloweOut
Expand All @@ -336,7 +348,13 @@ runRunCommand command =
printStats
invalid
>>= printTxId
AutoRun{..} ->
AutoRun{..} -> do
let connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File socketPath
}
autoRunTransaction
connection
marloweIn'
Expand All @@ -349,7 +367,13 @@ runRunCommand command =
printStats
invalid
>>= printTxId
AutoWithdraw{..} ->
AutoWithdraw{..} -> do
let connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File socketPath
}
autoWithdrawFunds
connection
marloweOut
Expand All @@ -362,7 +386,13 @@ runRunCommand command =
(PrintStats printStats)
invalid
>>= printTxId
Analyze{..} ->
Analyze{..} -> do
let connection =
LocalNodeConnectInfo
{ localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = network'
, localNodeSocketPath = File socketPath
}
analyze
connection
marloweOut
Expand Down
1 change: 1 addition & 0 deletions marlowe-cli/src/Language/Marlowe/CLI/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ instance (IsPlutusScriptLanguage lang, IsShelleyBasedEra era) => ToJSON (Marlowe
object
[ "marloweValidator" .= toJSON mtValidator
, "rolesValidator" .= toJSON mtRoleValidator
, "openRolesValidator" .= toJSON mtOpenRoleValidator
, "roles" .= toJSON mtRolesCurrency
, "state" .= toJSON mtState
, "contract" .= toJSON mtContract
Expand Down

0 comments on commit fe834df

Please sign in to comment.