Skip to content

Commit

Permalink
Don't generate negative constructor tags
Browse files Browse the repository at this point in the history
  • Loading branch information
redxaxder authored and michaelpj committed Jul 7, 2021
1 parent b305d5b commit 9bed391
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import Data.Map (Map)
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Text as T (pack)
import Numeric.Natural (Natural)
import qualified PlutusTx as Plutus
import Test.Cardano.Ledger.ShelleyMA.Serialisation.Generators (genMintValues)
import Test.QuickCheck
Expand All @@ -65,7 +66,8 @@ instance Arbitrary Plutus.Data where
[ (Plutus.I <$> arbitrary),
(Plutus.B <$> arbitrary),
(Plutus.Map <$> listOf (genPair (gendata (n `div` 2)) (gendata (n `div` 2)))),
(Plutus.Constr <$> arbitrary <*> listOf (gendata (n `div` 2))),
(Plutus.Constr <$> fmap fromIntegral (arbitrary :: Gen Natural)
<*> listOf (gendata (n `div` 2))),
(Plutus.List <$> listOf (gendata (n `div` 2)))
]
gendata _ = oneof [Plutus.I <$> arbitrary, Plutus.B <$> arbitrary]
Expand Down

0 comments on commit 9bed391

Please sign in to comment.