Skip to content

Commit 7fd5a50

Browse files
committed
Fix roundtrip test for Dijkstra
1 parent 02b1fc0 commit 7fd5a50

File tree

1 file changed

+3
-1
lines changed
  • eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ sizedDijkstraNativeScript n =
131131
instance (Arbitrary (TxBody l DijkstraEra), Typeable l) => Arbitrary (Tx l DijkstraEra) where
132132
arbitrary =
133133
fmap MkDijkstraTx . withSTxBothLevels @l $ \case
134-
STopTx -> DijkstraTx <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
134+
-- Per CIP-0167, Dijkstra transactions should always have isValid = True
135+
-- The isValid flag is omitted in serialization and defaults to True
136+
STopTx -> DijkstraTx <$> arbitrary <*> arbitrary <*> pure (IsValid True) <*> arbitrary
135137
SSubTx -> DijkstraSubTx <$> arbitrary <*> arbitrary <*> arbitrary
136138

137139
instance Era era => Arbitrary (DijkstraTxCert era) where

0 commit comments

Comments
 (0)