Skip to content

Commit e4b897e

Browse files
committed
Add Arbitrary instance for ChainDepState
1 parent b64af7c commit e4b897e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

libs/cardano-protocol-tpraos/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Version history for `cardano-protocol-tpraos`
22

3-
## 1.4.0.1
3+
## 1.4.1.0
44

55
* Add `GetLedgerView` instance for `DijkstraEra`
66

7+
### `testlib`
8+
9+
* Add `Arbitrary` instance for `ChainDepState`
10+
711
## 1.4.0.0
812

913
* Deprecated `bHeaderSize`

libs/cardano-protocol-tpraos/cardano-protocol-tpraos.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
name: cardano-protocol-tpraos
3-
version: 1.4.0.1
3+
version: 1.4.1.0
44
license: Apache-2.0
55
maintainer: operations@iohk.io
66
author: IOHK

libs/cardano-protocol-tpraos/testlib/Test/Cardano/Protocol/TPraos/Arbitrary.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Cardano.Ledger.BaseTypes (BlockNo (..), Nonce, Seed, SlotNo (..))
2525
import Cardano.Ledger.Block (Block (Block))
2626
import Cardano.Ledger.Core
2727
import Cardano.Protocol.Crypto (Crypto (KES, VRF), StandardCrypto)
28-
import Cardano.Protocol.TPraos.API (PraosCrypto)
28+
import Cardano.Protocol.TPraos.API (ChainDepState, PraosCrypto)
2929
import Cardano.Protocol.TPraos.BHeader (
3030
BHBody (BHBody),
3131
BHeader (BHeader),
@@ -45,6 +45,10 @@ import Test.Cardano.Ledger.Core.Arbitrary ()
4545
import Test.Cardano.Ledger.Shelley.Arbitrary ()
4646
import Test.Cardano.Protocol.TPraos.Create (AllIssuerKeys, mkBHBody, mkBHeader, mkBlock, mkOCert)
4747

48+
instance Arbitrary ChainDepState where
49+
arbitrary = genericArbitraryU
50+
shrink = genericShrink
51+
4852
newtype VRFNatVal = VRFNatVal Natural
4953
deriving (Show)
5054

0 commit comments

Comments
 (0)