Skip to content

Commit 9e504c3

Browse files
committed
Remove heapwords from cardano-ledger-shelley
1 parent 5ff9f4f commit 9e504c3

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

eras/shelley/impl/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 1.17.0.0
44

5+
* Remove `HeapWords` instances for: #5001
6+
- `ShelleyTxOut`
57
* Move `Annotator` instances, `txSeqDecoder` and `mapTraverseableDecoderA` to `testlib`
68
* Deprecate `witsFromTxWitnesses`
79
* Expose access to `ShelleyTxRaw`, `ShelleyTxAuxDataRaw`, `ShelleyTxBodyRaw`, `ShelleyTxWitsRaw`, `MkMultiSig`

eras/shelley/impl/cardano-ledger-shelley.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ library
116116
data-default,
117117
deepseq,
118118
groups,
119-
heapwords,
120119
mempack,
121120
microlens,
122121
mtl,

eras/shelley/impl/src/Cardano/Ledger/Shelley/TxOut.hs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ module Cardano.Ledger.Shelley.TxOut (
2424
valueEitherShelleyTxOutL,
2525
) where
2626

27-
import qualified Cardano.Crypto.Hash as HS
28-
import Cardano.HeapWords (HeapWords (..))
2927
import Cardano.Ledger.Address (Addr (..), CompactAddr, compactAddr, decompactAddr)
3028
import Cardano.Ledger.Binary (
3129
DecCBOR (..),
@@ -48,11 +46,8 @@ import Cardano.Ledger.Shelley.PParams ()
4846
import Cardano.Ledger.Val (Val)
4947
import Control.DeepSeq (NFData (rnf))
5048
import Data.Aeson (KeyValue, ToJSON (..), object, pairs, (.=))
51-
import qualified Data.ByteString.Short as SBS (ShortByteString, pack)
5249
import Data.Maybe (fromMaybe)
5350
import Data.MemPack
54-
import Data.Proxy (Proxy (..))
55-
import Data.Word (Word8)
5651
import GHC.Stack (HasCallStack)
5752
import Lens.Micro
5853
import NoThunks.Class (InspectHeapNamed (..), NoThunks (..))
@@ -121,11 +116,6 @@ valueEitherShelleyTxOutL =
121116
)
122117
{-# INLINE valueEitherShelleyTxOutL #-}
123118

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-
129119
instance (Era era, Val (Value era)) => Show (ShelleyTxOut era) where
130120
show = show . viewCompactTxOut -- FIXME: showing TxOut as a tuple is just sad
131121

@@ -196,12 +186,3 @@ toTxOutPair (ShelleyTxOut !addr !amount) =
196186
[ "address" .= addr
197187
, "amount" .= amount
198188
]
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

Comments
 (0)