|
1 | 1 | {-# LANGUAGE DataKinds #-} |
| 2 | +{-# LANGUAGE DeriveGeneric #-} |
2 | 3 | {-# LANGUAGE DerivingStrategies #-} |
3 | 4 | {-# LANGUAGE GADTs #-} |
4 | 5 | {-# LANGUAGE GeneralisedNewtypeDeriving #-} |
@@ -68,6 +69,7 @@ module Cardano.CLI.Types.Common |
68 | 69 | , TxBuildOutputOptions (..) |
69 | 70 | , TxByronWitnessCount (..) |
70 | 71 | , TxFile |
| 72 | + , TxIdSubmission (..) |
71 | 73 | , TxTreasuryDonation (..) |
72 | 74 | , TxInCount (..) |
73 | 75 | , TxMempoolQuery (..) |
@@ -100,8 +102,10 @@ import Data.Aeson (FromJSON (..), ToJSON (..), object, pairs, (.=)) |
100 | 102 | import qualified Data.Aeson as Aeson |
101 | 103 | import Data.String (IsString) |
102 | 104 | import Data.Text (Text) |
| 105 | +import qualified Data.Text as T |
103 | 106 | import qualified Data.Text as Text |
104 | 107 | import Data.Word (Word64) |
| 108 | +import GHC.Generics (Generic) |
105 | 109 |
|
106 | 110 | -- | Determines the direction in which the MIR certificate will transfer ADA. |
107 | 111 | data TransferDirection |
@@ -663,3 +667,12 @@ data PotentiallyCheckedAnchor anchorType anchor |
663 | 667 | -- ^ Whether to check the hash or not (CheckHash for checking or TrustHash for not checking) |
664 | 668 | } |
665 | 669 | deriving (Eq, Show) |
| 670 | + |
| 671 | +-- | Type used for serialization when printing the hash of a transaction |
| 672 | +-- after having submitted it. |
| 673 | +newtype TxIdSubmission = TxIdSubmission {txhash :: T.Text} |
| 674 | + deriving (Show, Generic) |
| 675 | + |
| 676 | +instance FromJSON TxIdSubmission |
| 677 | + |
| 678 | +instance ToJSON TxIdSubmission |
0 commit comments