Skip to content

Commit c508794

Browse files
committed
Add Predicate serialization tests for BBODY and MEMPOOL rules
1 parent b4bc321 commit c508794

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

eras/conway/impl/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
* Deprecate `Conway` type synonym
77
* Remove crypto parametrization from `ConwayEra`
88

9+
### `testlib`
10+
11+
* Add `Arbitrary` instance for `ConwayBbodyPredFailure` and `ConwayMempoolPredFailure`
12+
913
## 1.18.0.0
1014

1115
* Remove `SlotNo` from `CertEnv` and `CertsEnv`

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Arbitrary.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@ instance
218218

219219
shrink = genericShrink
220220

221+
instance
222+
( Era era
223+
, Arbitrary (PredicateFailure (EraRule "LEDGERS" era))
224+
) =>
225+
Arbitrary (ConwayBbodyPredFailure era)
226+
where
227+
arbitrary = genericArbitraryU
228+
229+
instance Arbitrary (ConwayMempoolPredFailure era) where
230+
arbitrary = genericArbitraryU
231+
221232
instance
222233
( EraTxOut era
223234
, Arbitrary (Value era)

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Binary/RoundTrip.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ roundTripConwayEraTypesSpec = do
7676
instance RuleListEra ConwayEra where
7777
type
7878
EraRules ConwayEra =
79-
'[ "GOV"
80-
, "UTXOS"
81-
, "LEDGER"
82-
, "CERTS"
79+
'[ "BBODY"
8380
, "CERT"
81+
, "CERTS"
8482
, "DELEG"
8583
, "GOVCERT"
86-
, "UTXOW"
87-
, "UTXO"
84+
, "GOV"
85+
, "LEDGER"
8886
, "LEDGERS"
87+
, "MEMPOOL"
8988
, "POOL"
89+
, "UTXO"
90+
, "UTXOS"
91+
, "UTXOW"
9092
]

0 commit comments

Comments
 (0)