Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nau committed Jul 3, 2020
1 parent 8d50721 commit 926339e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 3 additions & 2 deletions marlowe/src/Language/Marlowe/Client3.hs
Expand Up @@ -81,7 +81,8 @@ marloweContract2 :: forall e. (AsContractError e
)
=> Contract MarloweSchema e ()
marloweContract2 = do
create `select` apply {- <|> void sub -}
-- create `select` apply {- <|> void sub -}
(create `select` sub) >> apply
where
create = do
-- traceM "Here create"
Expand All @@ -100,7 +101,7 @@ marloweContract2 = do
-- traceM "Here apply"
(params, inputs) <- endpoint @"apply-inputs" @(MarloweParams, [Input]) @MarloweSchema
-- traceM $ "Here endpoint " <> show inputs
MarloweData{..} <- applyInputs params inputs
MarloweData{..} <- applyInputs params inputs
case marloweContract of
Close -> pure ()
_ -> void apply
Expand Down
10 changes: 4 additions & 6 deletions marlowe/test/Spec/Marlowe/Marlowe2.hs
Expand Up @@ -35,7 +35,7 @@ tests = testGroup "token account"
)
( callEndpoint @"create" w1 (defaultMarloweParams, Close)
>> handleBlockchainEvents w1 )
, -}zeroCouponBondTest
, -}zeroCouponBondTest1
]

zeroCouponBondTest :: TestTree
Expand Down Expand Up @@ -64,8 +64,8 @@ zeroCouponBondTest = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweCo
handleBlockchainEvents alice


{- zeroCouponBondTest :: TestTree
zeroCouponBondTest = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweContract2
zeroCouponBondTest1 :: TestTree
zeroCouponBondTest1 = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweContract2
(assertNoFailedTransactions
-- /\ emulatorLog (const False) ""
/\ assertDone w1 (const True) "contract should close"
Expand All @@ -87,6 +87,7 @@ zeroCouponBondTest = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweCo
[ Case (Deposit aliceAcc bobPk ada (Constant 1000_000_000)) Close] (Slot 200) Close
))] (Slot 100) Close
callEndpoint @"create" alice (params, zeroCouponBond)
callEndpoint @"sub" bob (params)
-- notifyInterestingAddresses alice
-- notifyInterestingAddresses bob
-- addBlocks 10
Expand All @@ -102,7 +103,6 @@ zeroCouponBondTest = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweCo
addBlocks 5
notifySlot alice
handleBlockchainEvents alice
handleUtxoQueries alice

callEndpoint @"apply-inputs" alice (params, [IDeposit aliceAcc alicePk ada 850_000_000])
addBlocks 3
Expand All @@ -119,7 +119,6 @@ zeroCouponBondTest = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweCo
-- notifySlot bob
-- callEndpoint @"sub" alice (alicePk)
-- callEndpoint @"sub" bob (alicePk)
callEndpoint @"sub" bob (params)
addBlocks 3
notifySlot bob
handleBlockchainEvents bob
Expand All @@ -131,7 +130,6 @@ zeroCouponBondTest = checkPredicate @MarloweSchema @MarloweError "ZCB" marloweCo
handleBlockchainEvents bob
-- callEndpoint @"apply-inputs" alice (params, [IDeposit aliceAcc bobPk ada 850_000_000])
-- handleBlockchainEvents bob
-}


w1, w2 :: Wallet
Expand Down

0 comments on commit 926339e

Please sign in to comment.