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 15, 2021
1 parent 71aaf61 commit 110596a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/Data.hs
Expand Up @@ -35,6 +35,7 @@ module Cardano.Ledger.Alonzo.Data
)
where


import Cardano.Ledger.Alonzo.Scripts
( Script (..),
isPlutusScript,
Expand Down Expand Up @@ -70,8 +71,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 qualified Data.Foldable as Foldable
import qualified Data.List as List
Expand Down
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 110596a

Please sign in to comment.