Skip to content

Commit

Permalink
Enabled mainnet for marlowe-cli.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbush committed Sep 25, 2022
1 parent f06e02f commit 54f956b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion marlowe-cli/marlowe-cli.cabal
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: marlowe-cli
version: 0.0.8.1
version: 0.0.8.2
license: Apache-2.0
license-files:
LICENSE
Expand Down
20 changes: 9 additions & 11 deletions marlowe-cli/src/Language/Marlowe/CLI/Command/Run.hs
Expand Up @@ -167,18 +167,20 @@ runRunCommand command =
do
costModel <- getDefaultCostModel
let
network' = if True then Mainnet else network command
network' =
case network command of
Testnet (C.NetworkMagic 764824073) -> Mainnet
testnet -> testnet
connection =
LocalNodeConnectInfo
{
localConsensusModeParams = CardanoModeParams $ EpochSlots 21600
, localNodeNetworkId = Mainnet -- network'
, localNodeNetworkId = network'
, localNodeSocketPath = socketPath command
}
marloweParams' = maybe defaultMarloweParams marloweParams $ rolesCurrency command
stake' = fromMaybe NoStakeAddress $ stake command
printTxId = liftIO . putStrLn . ("TxId " <>) . show
guardMainnet = pure () -- when (network' == Mainnet) $ throwError "Mainnet usage is not supported."
padTxOut (address, value) = (address, Nothing, value)
outputs' = padTxOut <$> outputs command
case command of
Expand All @@ -204,8 +206,7 @@ runRunCommand command =
maximumTime
outputFile
printStats
Run{..} -> guardMainnet
>> runTransaction
Run{..} -> runTransaction
connection
marloweIn
marloweOut
Expand All @@ -219,8 +220,7 @@ runRunCommand command =
printStats
invalid
>>= printTxId
Withdraw{..} -> guardMainnet
>> withdrawFunds
Withdraw{..} -> withdrawFunds
connection
marloweOut
roleName
Expand All @@ -235,8 +235,7 @@ runRunCommand command =
printStats
invalid
>>= printTxId
AutoRun{..} -> guardMainnet
>> autoRunTransaction
AutoRun{..} -> autoRunTransaction
connection
marloweIn'
marloweOut
Expand All @@ -248,8 +247,7 @@ runRunCommand command =
printStats
invalid
>>= printTxId
AutoWithdraw{..} -> guardMainnet
>> autoWithdrawFunds
AutoWithdraw{..} -> autoWithdrawFunds
connection
marloweOut
roleName
Expand Down
19 changes: 9 additions & 10 deletions marlowe-cli/src/Language/Marlowe/CLI/Command/Transaction.hs
Expand Up @@ -33,11 +33,11 @@ import Cardano.Api
, IsShelleyBasedEra
, LocalNodeConnectInfo(..)
, NetworkId(..)
, NetworkMagic(..)
, SlotNo
, TxIn
)
import Control.Monad (when)
import Control.Monad.Except (MonadError, MonadIO, liftIO, throwError)
import Control.Monad.Except (MonadError, MonadIO, liftIO)
import Data.Maybe (fromMaybe)
import Language.Marlowe.CLI.Command.Parse
( parseAddress
Expand Down Expand Up @@ -181,7 +181,10 @@ runTransactionCommand :: MonadError CliError m
runTransactionCommand command =
do
let
network' = network command
network' =
case network command of
Testnet (NetworkMagic 764824073) -> Mainnet
testnet -> testnet
connection =
LocalNodeConnectInfo
{
Expand All @@ -190,7 +193,6 @@ runTransactionCommand command =
, localNodeSocketPath = socketPath command
}
printTxId = liftIO . putStrLn . ("TxId " <>) . show
guardMainnet = when (network' == Mainnet) $ throwError "Mainnet usage is not supported."
padTxOut (address, value) = (address, Nothing, value)
outputs' = padTxOut <$> outputs command
case command of
Expand All @@ -204,8 +206,7 @@ runTransactionCommand command =
printStats
invalid
>>= printTxId
BuildCreate{..} -> guardMainnet
>> buildIncoming
BuildCreate{..} -> buildIncoming
connection
scriptAddress
signingKeyFiles
Expand All @@ -218,8 +219,7 @@ runTransactionCommand command =
printStats
invalid
>>= printTxId
BuildAdvance{..} -> guardMainnet
>> buildContinuing
BuildAdvance{..} -> buildContinuing
connection
scriptAddress
validatorFile
Expand All @@ -237,8 +237,7 @@ runTransactionCommand command =
printStats
invalid
>>= printTxId
BuildClose{..} -> guardMainnet
>> buildOutgoing
BuildClose{..} -> buildOutgoing
connection
validatorFile
redeemerFile
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 54f956b

Please sign in to comment.