Skip to content

Commit 78bdf07

Browse files
committed
Adapt TreeDiff usage of LeiosCert to new exports
Not sure if this is better, but the upstream module has a smaller API surface now.
1 parent 267037a commit 78bdf07

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra

eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra/TreeDiff.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ module Test.Cardano.Ledger.Dijkstra.TreeDiff (
1717
) where
1818

1919
import Cardano.Crypto.DSIGN (rawSerialiseSigDSIGN)
20-
import Cardano.Crypto.Leios (LeiosCert (..), bitFieldToBytes)
20+
import Cardano.Crypto.Leios (LeiosCert (..), encodeBitField)
2121
import Cardano.Ledger.Alonzo.Plutus.Context (ContextError)
2222
import Cardano.Ledger.BaseTypes (StrictMaybe)
23+
import Cardano.Ledger.Binary.Plain (serialize)
2324
import qualified Cardano.Ledger.Conway.Rules as Conway
2425
import Cardano.Ledger.Dijkstra (DijkstraEra)
2526
import Cardano.Ledger.Dijkstra.BlockBody (PerasCert)
@@ -132,12 +133,14 @@ instance ToExpr (TxBody l DijkstraEra)
132133
instance ToExpr PerasCert
133134

134135
-- Manual ToExpr to avoid an orphan 'ToExpr (SigDSIGN BLS12381MinSigDSIGN)':
135-
-- show the BLS signature as its raw byte representation.
136+
-- show the BLS signature as its raw byte representation, and the bitfield
137+
-- as its CBOR encoding (since the wire-format bytes aren't separately
138+
-- observable through the public API).
136139
instance ToExpr LeiosCert where
137140
toExpr cert =
138141
Rec "LeiosCert" $
139142
OMap.fromList
140-
[ ("signers", toExpr (bitFieldToBytes $ signers cert))
143+
[ ("signers", toExpr (serialize (encodeBitField (signers cert))))
141144
, ("aggregatedSignature", toExpr (rawSerialiseSigDSIGN $ aggregatedSignature cert))
142145
]
143146

0 commit comments

Comments
 (0)