From 8cc16b5953450ba5a60e5c40fa550c0526a91584 Mon Sep 17 00:00:00 2001 From: Thomas Winant Date: Fri, 24 Jul 2020 11:30:22 +0200 Subject: [PATCH] Expose constructors to more efficiently translate transactions --- byron/ledger/impl/src/Cardano/Chain/Common/Compact.hs | 4 ++++ .../executable-spec/src/Shelley/Spec/Ledger/TxData.hs | 1 + 2 files changed, 5 insertions(+) diff --git a/byron/ledger/impl/src/Cardano/Chain/Common/Compact.hs b/byron/ledger/impl/src/Cardano/Chain/Common/Compact.hs index 5f7392c5fd8..ba7c51f0524 100644 --- a/byron/ledger/impl/src/Cardano/Chain/Common/Compact.hs +++ b/byron/ledger/impl/src/Cardano/Chain/Common/Compact.hs @@ -9,6 +9,7 @@ module Cardano.Chain.Common.Compact ( CompactAddress , toCompactAddress , fromCompactAddress + , unsafeGetCompactAddress ) where @@ -49,3 +50,6 @@ fromCompactAddress (CompactAddress addr) = case decodeFull' (BSS.fromShort addr) of Left err -> panic ("fromCompactAddress: impossible: " <> show err) Right decAddr -> decAddr + +unsafeGetCompactAddress :: CompactAddress -> ShortByteString +unsafeGetCompactAddress (CompactAddress sbs) = sbs diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/TxData.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/TxData.hs index 480fe02beed..e97f6222304 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/TxData.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/TxData.hs @@ -50,6 +50,7 @@ module Shelley.Spec.Ledger.TxData TxIn (TxIn), pattern TxInCompact, TxOut (TxOut), + pattern TxOutCompact, Url, Wdrl (..), WitVKey (WitVKey, wvkBytes),