Skip to content

Commit

Permalink
RemotePactTest.spvTest assertion and fix
Browse files Browse the repository at this point in the history
Needs to use the target chain to poll and send, not the source chain.
Also added an assertion that the events reflect an xchain transfer.
  • Loading branch information
edmundnoble committed Dec 14, 2024
1 parent 6cb88d0 commit f6fb09e
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/unit/Chainweb/Test/Pact5/RemotePactTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,24 @@ spvTest baseRdb = runResourceT $ do
$ set cbGasPrice (GasPrice 0.01)
$ set cbGasLimit (GasLimit (Gas 1_000))
$ defaultCmd
recvReqKey <- fmap NE.head $ sending v srcChain clientEnv (NE.singleton recv)
recvCr <- fmap (HashMap.! recvReqKey) $ polling v srcChain clientEnv (NE.singleton recvReqKey)
print recvCr
recvReqKey <- fmap NE.head $ sending v targetChain clientEnv (NE.singleton recv)
_ <- CutFixture.advanceAllChains v (fixture ^. cutFixture)
recvCr <- fmap (HashMap.! recvReqKey) $ polling v targetChain clientEnv (NE.singleton recvReqKey)
recvCr
& allTrue
[ pt _crResult ? match _PactResultOk something
, pt _crEvents ? predful
[ something
, allTrue
[ pt _peName ? equals "TRANSFER_XCHAIN_RECD"
, pt _peArgs ? traceFailShow ? equals
[PString "", PString "sender01", PDecimal 1.0, PString (chainIdToText srcChain)]
]
, pt _peName ? equals "X_RESUME"
, something
]
]


pure ()

Expand Down

0 comments on commit f6fb09e

Please sign in to comment.