Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit b7115ad

Browse files
Merge pull request #287 from digital-asset/fix-runaway-triggers
Fix runaway triggers
2 parents 4cb04b8 + 74c2572 commit b7115ad

File tree

18 files changed

+54
-43
lines changed

18 files changed

+54
-43
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ $(exberry_adapter_dir):
143143
rm -fr exberry_adapter/marketplace_exchange_adapter.egg-info
144144

145145
$(adapter_pid): |$(state_dir) $(exberry_adapter_dir)
146-
cd exberry_adapter && (DAML_LEDGER_URL=localhost:6865 poetry run python bot/exberry_adapter_bot.py > ../$(adapter_log) & echo "$$!" > ../$(adapter_pid))
146+
cd exberry_adapter && (DAML_LEDGER_URL=localhost:6865 $(PYTHON) bot/exberry_adapter_bot.py > ../$(adapter_log) & echo "$$!" > ../$(adapter_pid))
147147

148148
start_adapter: $(adapter_pid)
149149

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This can be done by rebuilding the project using `make clean && make package`.
4141
Alternatively, to only build the DAR file and regenerate the TypeScript bindings:
4242
```
4343
daml build
44-
daml codegen js .daml/dist/da-marketplace-0.1.17.dar -o daml.js
44+
daml codegen js .daml/dist/da-marketplace-0.1.18.dar -o daml.js
4545
cd ui
4646
yarn install --force --frozen-lockfile
4747
```

dabl-meta.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
catalog:
22
name: da-marketplace
3-
version: 0.1.17
3+
version: 0.1.18
44
short_description: DA Marketplace
55
description: A marketplace for issuing and trading digital tokens.
66
release_date: 2020-10-14
@@ -10,7 +10,7 @@ catalog:
1010
tags: [ dabl-sample-app, application ]
1111
icon_file: marketplace.svg
1212
subdeployments:
13-
- da-marketplace-model-0.1.17.dar
14-
- da-marketplace-triggers-0.1.17.dar
15-
- da-marketplace-exberry-adapter-0.1.17.tar.gz
16-
- da-marketplace-ui-0.1.17.zip
13+
- da-marketplace-model-0.1.18.dar
14+
- da-marketplace-triggers-0.1.18.dar
15+
- da-marketplace-exberry-adapter-0.1.18.tar.gz
16+
- da-marketplace-ui-0.1.18.zip

daml.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parties:
1414
- Exchange
1515
- Broker
1616
- Ccp
17-
version: 0.1.17
17+
version: 0.1.18
1818
dependencies:
1919
- daml-prim
2020
- daml-stdlib

daml/Marketplace/CentralCounterpartyCustomer.daml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ template CCPCustomerInvitation
3939
create DismissibleNotification with
4040
sender = ccpCustomer, senderRole = Some InvestorRole
4141
receiver = ccp, text = "CCP customer invitation accepted."
42-
create CCPCustomer with inGoodStanding = True, marginDepositCids = [], ..
42+
createOrLookup CCPCustomer with inGoodStanding = True, marginDepositCids = [], ..
4343

4444
CCPCustomerInvitation_Reject : ()
4545
do

daml/Marketplace/Custodian.daml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ template CustodianRelationshipRequest
4646
create DismissibleNotification with
4747
sender = custodian, senderRole = Some CustodianRole
4848
receiver = requester, text = "Relationship request accepted."
49-
create CustodianRelationship with party = requester, ..
49+
createOrLookup CustodianRelationship with party = requester, ..
5050

5151
CustodianRelationshipRequest_Reject : ()
5252
do
@@ -73,8 +73,8 @@ template CustodianInvitation
7373
name : Text
7474
location : Text
7575
do
76-
create RegisteredCustodian with ..
77-
create Custodian with investors = [], exchanges = [], brokers = [], issuers = [], ..
76+
createOrLookup RegisteredCustodian with ..
77+
createOrLookup Custodian with investors = [], exchanges = [], brokers = [], issuers = [], ..
7878

7979

8080
template Custodian

daml/Marketplace/Exchange.daml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ template ExchangeInvitation
3333
name : Text
3434
location : Text
3535
do
36-
create RegisteredExchange with ..
37-
create Exchange with tokenPairs = [], clearedMarkets = [], binOptions = [], participants = [], ..
36+
createOrLookup RegisteredExchange with ..
37+
createOrLookup Exchange with tokenPairs = [], clearedMarkets = [], binOptions = [], participants = [], ..
3838

3939

4040
-- |Request from an investor or broker to be added to the exchange
@@ -55,7 +55,7 @@ template ExchangeParticipantInvitationRequest
5555
sender = exchange, senderRole = Some ExchangeRole
5656
receiver = participant, text = "Exchange participant request accepted."
5757
exerciseByKey @Exchange (operator,exchange) Exchange_AddParticipant with exchParticipant = participant
58-
create ExchangeParticipant with exchParticipant = participant, ..
58+
createOrLookup ExchangeParticipant with exchParticipant = participant, ..
5959

6060
ExchangeInvtationRequest_Reject : ()
6161
do
@@ -86,13 +86,13 @@ template Exchange
8686
nonconsuming Exchange_RequestCustodianRelationship : ContractId CustodianRelationshipRequest
8787
with
8888
custodian : Party
89-
do create CustodianRelationshipRequest with requester = exchange, role = ExchangeRole, ..
89+
do createOrLookup CustodianRelationshipRequest with requester = exchange, role = ExchangeRole, ..
9090

9191
nonconsuming Exchange_RequestCCPRelationship : ContractId CCPExchangeRelationshipRequest
9292
with
9393
ccp : Party
9494
do
95-
create CCPExchangeRelationshipRequest with requester = exchange, party = ccp, requesterRole = ExchangeRole, ..
95+
createOrLookup CCPExchangeRelationshipRequest with requester = exchange, party = ccp, requesterRole = ExchangeRole, ..
9696

9797
Exchange_InviteParticipant : (ContractId Exchange, ContractId ExchangeParticipantInvitation)
9898
with

daml/Marketplace/ExchangeParticipant.daml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ template ExchangeParticipantInvitation
2525
create DismissibleNotification with
2626
sender = exchParticipant, senderRole = None
2727
receiver = exchange, text = "Exchange invitation accepted."
28-
create ExchangeParticipant with ..
28+
createOrLookup ExchangeParticipant with ..
2929

3030
ExchangeParticipantInvitation_Reject : ()
3131
do

daml/Marketplace/Investor.daml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ template InvestorInvitation
3030
name : Text
3131
location : Text
3232
do
33-
create RegisteredInvestor with ..
34-
create Investor with ..
33+
createOrLookup RegisteredInvestor with ..
34+
createOrLookup Investor with ..
3535

3636

3737
template Investor
@@ -50,13 +50,13 @@ template Investor
5050
nonconsuming Investor_RequestCustodianRelationship : ContractId CustodianRelationshipRequest
5151
with
5252
custodian : Party
53-
do create CustodianRelationshipRequest with requester = investor, role = InvestorRole, ..
53+
do createOrLookup CustodianRelationshipRequest with requester = investor, role = InvestorRole, ..
5454

5555
nonconsuming Investor_RequestExchangeParticipantInvitation : ContractId ExchangeParticipantInvitationRequest
5656
with
5757
exchange : Party
5858
do
59-
create ExchangeParticipantInvitationRequest with operator, exchange, participant = investor
59+
createOrLookup ExchangeParticipantInvitationRequest with operator, exchange, participant = investor
6060

6161
nonconsuming Investor_RequestDepositTransfer : ContractId DepositTransferRequest
6262
with

daml/Marketplace/Issuer.daml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ template IssuerInvitation
3131
title : Text
3232
issuerID : Text
3333
do
34-
create RegisteredIssuer with ..
35-
create Issuer with ..
34+
createOrLookup RegisteredIssuer with ..
35+
createOrLookup Issuer with ..
3636

3737

3838
template Issuer
@@ -57,7 +57,7 @@ template Issuer
5757
do
5858
let tokenId = Id with signatories = fromList [issuer], label = name, version = 0
5959
let tokenObservers = if isPublic then (public :: operator :: observers) else observers
60-
create Token with id = tokenId, observers = fromList tokenObservers, ..
60+
createOrLookup Token with id = tokenId, observers = fromList tokenObservers, ..
6161

6262
nonconsuming Issuer_IssueBinaryOption : ContractId BinaryOption
6363
with
@@ -70,7 +70,7 @@ template Issuer
7070
do
7171
let binOptionId = Id with signatories = fromList [issuer], label = name, version = 0
7272
let binOptionObservers = if isPublic then (public :: observers) else observers
73-
create BinaryOption with id = binOptionId, observers = fromList binOptionObservers, ..
73+
createOrLookup BinaryOption with id = binOptionId, observers = fromList binOptionObservers, ..
7474

7575
nonconsuming Issuer_IssueDerivative : (Id, ContractId Derivative)
7676
with
@@ -98,4 +98,4 @@ template Issuer
9898
nonconsuming Issuer_RequestCustodianRelationship : ContractId CustodianRelationshipRequest
9999
with
100100
custodian : Party
101-
do create CustodianRelationshipRequest with requester = issuer, role = IssuerRole, ..
101+
do createOrLookup CustodianRelationshipRequest with requester = issuer, role = IssuerRole, ..

0 commit comments

Comments
 (0)