Merge pull request #226 from Liqwid-Labs/seungheonoh/fixproperty
Fix `phashDatum` property
This commit is contained in:
commit
6827855c70
1 changed files with 9 additions and 11 deletions
|
|
@ -1,34 +1,32 @@
|
|||
module Property.Utils (props) where
|
||||
|
||||
import Agora.Utils (phashDatum)
|
||||
import Cardano.Prelude (ByteString)
|
||||
import Generics.SOP (NP (Nil, (:*)))
|
||||
import Plutarch.Api.V2 (datumHash)
|
||||
import Plutarch.Test.QuickCheck (
|
||||
Equality (OnPEq),
|
||||
Partiality (ByComplete),
|
||||
haskEquiv',
|
||||
TestableTerm (TestableTerm),
|
||||
arbitraryPLift,
|
||||
haskEquiv,
|
||||
)
|
||||
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.QuickCheck (
|
||||
Property,
|
||||
QuickCheckTests,
|
||||
resize,
|
||||
testProperty,
|
||||
)
|
||||
|
||||
propHashDatumCorrect :: Property
|
||||
propHashDatumCorrect =
|
||||
haskEquiv'
|
||||
haskEquiv
|
||||
@'OnPEq
|
||||
@'ByComplete
|
||||
hashDatum
|
||||
phashDatum
|
||||
where
|
||||
hashDatum :: ByteString -> DatumHash
|
||||
hashDatum = datumHash . Datum . BuiltinData . B
|
||||
datumHash
|
||||
(TestableTerm phashDatum)
|
||||
(resize 5 arbitraryPLift :* Nil)
|
||||
|
||||
props :: [TestTree]
|
||||
props =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue