Skip to content

Commit

Permalink
Merge pull request #2071 from kadena-io/push-luonqnryqlvx
Browse files Browse the repository at this point in the history
Migrate to property-matchers 0.2
  • Loading branch information
edmundnoble authored Dec 17, 2024
2 parents 86aaa6b + d94a307 commit 8c85cbd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
9 changes: 6 additions & 3 deletions cabal.project.freeze
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ constraints: any.Cabal ==3.12.1.0,
clock -llvm,
any.cmdargs ==0.10.22,
cmdargs +quotation -testprog,
any.co-log-core ==0.3.2.2,
any.co-log-core ==0.3.2.3,
any.code-page ==0.2.1,
any.colour ==2.3.6,
any.commonmark ==0.2.6.1,
Expand Down Expand Up @@ -308,9 +308,10 @@ constraints: any.Cabal ==3.12.1.0,
any.pem ==0.2.4,
any.poly ==0.5.1.0,
poly +sparse,
any.predicate-transformers ==0.15.0.0,
any.pretty ==1.1.3.6,
any.pretty-show ==1.10,
any.pretty-simple ==4.1.3.0,
pretty-simple -buildexample +buildexe,
any.prettyprinter ==1.7.1,
prettyprinter -buildreadme +text,
any.prettyprinter-ansi-terminal ==1.1.3,
Expand All @@ -320,11 +321,13 @@ constraints: any.Cabal ==3.12.1.0,
any.primitive-unlifted ==2.1.0.0,
any.process ==1.6.18.0,
any.profunctors ==5.6.2,
any.property-matchers ==0.2.0.0,
any.psqueues ==0.2.8.0,
any.pvar ==1.0.0.0,
any.quickcheck-instances ==0.3.32,
any.ralist ==0.4.0.0,
any.random ==1.2.1.3,
any.recover-rtti ==0.5.0,
any.recv ==0.1.0,
any.reducers ==3.12.5,
any.reflection ==2.1.9,
Expand Down Expand Up @@ -514,4 +517,4 @@ constraints: any.Cabal ==3.12.1.0,
zip-archive -executable,
any.zlib ==0.7.1.0,
zlib -bundled-c-zlib +non-blocking-ffi +pkg-config
index-state: hackage.haskell.org 2024-12-14T23:51:20Z
index-state: hackage.haskell.org 2024-12-16T17:37:22Z
3 changes: 1 addition & 2 deletions chainweb.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -725,13 +725,12 @@ test-suite chainweb-tests
, pact-tng:pact-request-api
, pact-tng:test-utils
, patience >= 0.3
, property-matchers ^>= 0.1
, property-matchers ^>= 0.2
, pretty-show
, quickcheck-instances >= 0.3
, random >= 1.2
, resource-pool >= 0.4
, resourcet >= 1.3
, retry >= 0.7
, rosetta >= 1.0
, safe-exceptions >= 0.1
, scheduler >= 1.4
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Chainweb/Test/Pact5/PactServiceTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ tests baseRdb = testGroup "Pact5 PactServiceTest"
, testCase "failed txs should go into blocks" (failedTxsShouldGoIntoBlocks baseRdb)
]

successfulTx :: P.Boolish p => P.Prop p (CommandResult log err)
successfulTx :: P.Prop (CommandResult log err)
successfulTx = P.fun _crResult ? P.match _PactResultOk P.succeed

simpleEndToEnd :: RocksDb -> IO ()
Expand Down
7 changes: 2 additions & 5 deletions test/unit/Chainweb/Test/Pact5/RemotePactTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ import Chainweb.Test.Pact5.CmdBuilder
import Chainweb.Test.Pact5.CutFixture qualified as CutFixture
import Chainweb.Test.Pact5.Utils
import Chainweb.Test.TestVersions
import Chainweb.Test.Utils (deadbeef)
import Chainweb.Test.Utils (testRetryPolicy)
import Chainweb.Test.Utils (deadbeef, TestPact5CommandResult)
import Chainweb.Utils
import Chainweb.Version
import Chainweb.WebPactExecutionService
Expand Down Expand Up @@ -410,11 +409,9 @@ trivialTx cid n = defaultCmd
, _cbGasLimit = GasLimit (Gas 1_000)
}

_successfulTx :: P.Boolish p => P.Prop p (CommandResult log err)
_successfulTx :: P.Prop (CommandResult log err)
_successfulTx = P.fun _crResult ? P.match _PactResultOk P.succeed

pactDeadBeef :: RequestKey
pactDeadBeef = case deadbeef of
TransactionHash bytes -> RequestKey (Pact5.Hash bytes)

type TestPact5CommandResult = CommandResult Pact5.Hash (PactErrorCompat (LocatedErrorInfo Info))
2 changes: 1 addition & 1 deletion test/unit/Chainweb/Test/Pact5/SPVTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ tests baseRdb = testGroup "Pact5 SPVTest"
[ --testCase "simple end to end" (simpleEndToEnd baseRdb)
]

successfulTx :: P.Boolish p => P.Prop p (CommandResult log err)
successfulTx :: P.Prop (CommandResult log err)
successfulTx = P.fun _crResult ? P.match _PactResultOk P.succeed

cid = unsafeChainId 0
Expand Down
9 changes: 4 additions & 5 deletions test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ coinModuleName = ModuleName "coin" Nothing

-- usually we don't want to check the module hash
event
:: P.Boolish p
=> P.Prop p Text
-> P.Prop p [PactValue]
-> P.Prop p ModuleName
-> P.Prop p (PactEvent PactValue)
:: P.Prop Text
-> P.Prop [PactValue]
-> P.Prop ModuleName
-> P.Prop (PactEvent PactValue)
event n args modName = P.allTrue
[ P.fun _peName n
, P.fun _peArgs args
Expand Down

0 comments on commit 8c85cbd

Please sign in to comment.