File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 55
66module DA.ContractKeys where
77
8- import DA.Internal.Template.Functions as DA
8+ --import DA.Internal.Template.Functions as DA
9+ import DA.Internal.Template.Functions (queryNByKey)
910
1011#ifdef DAML_NUCK
11- queryNByKey : forall t k. HasQueryNByKey t k => Int -> k -> Update [(ContractId t, t)]
12- queryNByKey = DA.queryNByKey
12+ libqueryNByKey : forall t k. HasQueryNByKey t k => Int -> k -> Update [(ContractId t, t)]
13+ --queryNByKey = DA.queryNByKey
14+ libqueryNByKey = queryNByKey
1315
1416queryAllByKey : forall t k. HasQueryNByKey t k => k -> Update [(ContractId t, t)]
15- queryAllByKey = queryNByKey (maxBound @Int)
17+ queryAllByKey = libqueryNByKey (maxBound @Int)
1618#endif
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import DA.Action.State
1313import DA.Assert
1414import DA.BigNumeric
1515import DA.Bifunctor
16+ import DA.ContractKeys
1617import DA.Crypto.Text
1718import DA.Date
1819import DA.Either
Original file line number Diff line number Diff line change 55
66module QueryNByKey where
77
8- -- import Daml.Script
8+ import DA.ContractKeys
99
1010template WithKey
1111 with
@@ -28,14 +28,14 @@ template Helper
2828 pure ()
2929 [] ->
3030 abort "Assertion failed: queryNByKey returned an empty list."
31- -- choice PerformQueryAllByKey : ()
32- -- controller p
33- -- do contracts <- queryAllByKey @WithKey p
34- -- case contracts of
35- -- (contract :: _) -> do
36- -- pure ()
37- -- [] ->
38- -- abort "Assertion failed: queryAllByKey returned an empty list."
31+ choice PerformQueryAllByKey : ()
32+ controller p
33+ do contracts <- queryAllByKey @WithKey p
34+ case contracts of
35+ (contract :: _) -> do
36+ pure ()
37+ [] ->
38+ abort "Assertion failed: queryAllByKey returned an empty list."
3939
4040-- Test just here to assert that queryNByKey compiles
4141-- When we have an ledger implementation, assert things actually run
You can’t perform that action at this time.
0 commit comments