Fix phashDatum property
This commit is contained in:
parent
099a515361
commit
5f0dd0e433
1 changed files with 9 additions and 11 deletions
|
|
@ -1,34 +1,32 @@
|
||||||
module Property.Utils (props) where
|
module Property.Utils (props) where
|
||||||
|
|
||||||
import Agora.Utils (phashDatum)
|
import Agora.Utils (phashDatum)
|
||||||
import Cardano.Prelude (ByteString)
|
import Generics.SOP (NP (Nil, (:*)))
|
||||||
import Plutarch.Api.V2 (datumHash)
|
import Plutarch.Api.V2 (datumHash)
|
||||||
import Plutarch.Test.QuickCheck (
|
import Plutarch.Test.QuickCheck (
|
||||||
Equality (OnPEq),
|
Equality (OnPEq),
|
||||||
Partiality (ByComplete),
|
Partiality (ByComplete),
|
||||||
haskEquiv',
|
TestableTerm (TestableTerm),
|
||||||
|
arbitraryPLift,
|
||||||
|
haskEquiv,
|
||||||
)
|
)
|
||||||
import Plutarch.Test.QuickCheck.Instances ()
|
import Plutarch.Test.QuickCheck.Instances ()
|
||||||
import PlutusCore.Data (Data (B))
|
|
||||||
import PlutusLedgerApi.V1 (Datum (Datum))
|
|
||||||
import PlutusLedgerApi.V2 (BuiltinData (BuiltinData), DatumHash)
|
|
||||||
import Test.Tasty (TestTree, adjustOption)
|
import Test.Tasty (TestTree, adjustOption)
|
||||||
import Test.Tasty.QuickCheck (
|
import Test.Tasty.QuickCheck (
|
||||||
Property,
|
Property,
|
||||||
QuickCheckTests,
|
QuickCheckTests,
|
||||||
|
resize,
|
||||||
testProperty,
|
testProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
propHashDatumCorrect :: Property
|
propHashDatumCorrect :: Property
|
||||||
propHashDatumCorrect =
|
propHashDatumCorrect =
|
||||||
haskEquiv'
|
haskEquiv
|
||||||
@'OnPEq
|
@'OnPEq
|
||||||
@'ByComplete
|
@'ByComplete
|
||||||
hashDatum
|
datumHash
|
||||||
phashDatum
|
(TestableTerm phashDatum)
|
||||||
where
|
(resize 5 arbitraryPLift :* Nil)
|
||||||
hashDatum :: ByteString -> DatumHash
|
|
||||||
hashDatum = datumHash . Datum . BuiltinData . B
|
|
||||||
|
|
||||||
props :: [TestTree]
|
props :: [TestTree]
|
||||||
props =
|
props =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue