Skip to content

Commit

Permalink
Show for CompactAddress, derived FromCBOR for Data.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSheard committed Apr 9, 2021
1 parent 4753732 commit 2890d85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module Cardano.Ledger.Alonzo.Data
)
where

import Cardano.Binary (FromCBOR (..), ToCBOR (..), withSlice)
import Cardano.Binary (FromCBOR (..), ToCBOR (..))
import Cardano.Ledger.AuxiliaryData (AuxiliaryDataHash (..))
import qualified Cardano.Ledger.Core as Core
import qualified Cardano.Ledger.Crypto as CC
Expand Down Expand Up @@ -65,8 +65,6 @@ import Cardano.Ledger.SafeHash
)
import Cardano.Prelude (HeapWords (..), heapWords0, heapWords1)
import qualified Data.ByteString as BS (ByteString, length)
import Data.ByteString.Lazy (toStrict)
import Data.ByteString.Short (toShort)
import Data.Coders
import Data.Map (Map)
import Data.MemoBytes (Mem, MemoBytes (..), memoBytes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ import Shelley.Spec.Ledger.Slot (SlotNo (..))
newtype CompactAddr crypto = UnsafeCompactAddr ShortByteString
deriving (Eq, Ord)

instance CC.Crypto c => Show (CompactAddr c) where
show c = show (decompactAddr c)

compactAddr :: Addr crypto -> CompactAddr crypto
compactAddr = UnsafeCompactAddr . SBS.toShort . serialiseAddr

Expand Down

0 comments on commit 2890d85

Please sign in to comment.