@@ -24,8 +24,6 @@ module Cardano.Ledger.Shelley.TxOut (
24
24
valueEitherShelleyTxOutL ,
25
25
) where
26
26
27
- import qualified Cardano.Crypto.Hash as HS
28
- import Cardano.HeapWords (HeapWords (.. ))
29
27
import Cardano.Ledger.Address (Addr (.. ), CompactAddr , compactAddr , decompactAddr )
30
28
import Cardano.Ledger.Binary (
31
29
DecCBOR (.. ),
@@ -48,11 +46,8 @@ import Cardano.Ledger.Shelley.PParams ()
48
46
import Cardano.Ledger.Val (Val )
49
47
import Control.DeepSeq (NFData (rnf ))
50
48
import Data.Aeson (KeyValue , ToJSON (.. ), object , pairs , (.=) )
51
- import qualified Data.ByteString.Short as SBS (ShortByteString , pack )
52
49
import Data.Maybe (fromMaybe )
53
50
import Data.MemPack
54
- import Data.Proxy (Proxy (.. ))
55
- import Data.Word (Word8 )
56
51
import GHC.Stack (HasCallStack )
57
52
import Lens.Micro
58
53
import NoThunks.Class (InspectHeapNamed (.. ), NoThunks (.. ))
@@ -121,11 +116,6 @@ valueEitherShelleyTxOutL =
121
116
)
122
117
{-# INLINE valueEitherShelleyTxOutL #-}
123
118
124
- -- assume Shelley+ type address : payment addr, staking addr (same length as payment), plus 1 word overhead
125
- instance (Era era , HeapWords (CompactForm (Value era ))) => HeapWords (ShelleyTxOut era ) where
126
- heapWords (TxOutCompact _ vl) =
127
- 3 + heapWords packedADDRHASH + heapWords vl
128
-
129
119
instance (Era era , Val (Value era )) => Show (ShelleyTxOut era ) where
130
120
show = show . viewCompactTxOut -- FIXME: showing TxOut as a tuple is just sad
131
121
@@ -196,12 +186,3 @@ toTxOutPair (ShelleyTxOut !addr !amount) =
196
186
[ " address" .= addr
197
187
, " amount" .= amount
198
188
]
199
-
200
- -- a ShortByteString of the same length as the ADDRHASH
201
- -- used to calculate heapWords
202
- packedADDRHASH :: SBS. ShortByteString
203
- packedADDRHASH =
204
- SBS. pack $
205
- replicate
206
- (fromIntegral (1 + 2 * HS. sizeHash (Proxy :: Proxy ADDRHASH )))
207
- (1 :: Word8 )
0 commit comments