File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
cardano-cli/src/Cardano/CLI Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1483,7 +1483,9 @@ runTransactionSubmitCmd
14831483
14841484 res <- liftIO $ submitTxToNodeLocal localNodeConnInfo txInMode
14851485 case res of
1486- Net.Tx. SubmitSuccess -> liftIO $ Text. putStrLn " Transaction successfully submitted."
1486+ Net.Tx. SubmitSuccess -> do
1487+ liftIO $ Text. putStrLn " Transaction successfully submitted. Transaction hash is:"
1488+ liftIO $ LBS. putStrLn $ Aeson. encode $ TxIdSubmission (getTxId $ getTxBody tx)
14871489 Net.Tx. SubmitFail reason ->
14881490 case reason of
14891491 TxValidationErrorInCardanoMode err -> left . TxCmdTxSubmitError . Text. pack $ show err
Original file line number Diff line number Diff line change 11{-# LANGUAGE DataKinds #-}
2+ {-# LANGUAGE DeriveGeneric #-}
23{-# LANGUAGE DerivingStrategies #-}
34{-# LANGUAGE GADTs #-}
45{-# LANGUAGE GeneralisedNewtypeDeriving #-}
@@ -68,6 +69,7 @@ module Cardano.CLI.Types.Common
6869 , TxBuildOutputOptions (.. )
6970 , TxByronWitnessCount (.. )
7071 , TxFile
72+ , TxIdSubmission (.. )
7173 , TxTreasuryDonation (.. )
7274 , TxInCount (.. )
7375 , TxMempoolQuery (.. )
@@ -102,6 +104,7 @@ import Data.String (IsString)
102104import Data.Text (Text )
103105import qualified Data.Text as Text
104106import Data.Word (Word64 )
107+ import GHC.Generics (Generic )
105108
106109-- | Determines the direction in which the MIR certificate will transfer ADA.
107110data TransferDirection
@@ -663,3 +666,12 @@ data PotentiallyCheckedAnchor anchorType anchor
663666 -- ^ Whether to check the hash or not (CheckHash for checking or TrustHash for not checking)
664667 }
665668 deriving (Eq , Show )
669+
670+ -- | Type used for serialization when printing the hash of a transaction
671+ -- after having submitted it.
672+ newtype TxIdSubmission = TxIdSubmission { txhash :: TxId }
673+ deriving (Show , Generic )
674+
675+ instance FromJSON TxIdSubmission
676+
677+ instance ToJSON TxIdSubmission
You can’t perform that action at this time.
0 commit comments