From 0b55d420d7c9176a7121888cb773ede35b5bbe1d Mon Sep 17 00:00:00 2001 From: Carl Pulley Date: Wed, 14 Jan 2026 15:24:51 +0000 Subject: [PATCH 1/2] Remove replicated party code from daml-script --- .../daml/Daml/Script/Internal.daml | 4 --- .../Script/Internal/Questions/Packages.daml | 16 ++-------- .../Internal/Questions/PartyManagement.daml | 32 +++++-------------- 3 files changed, 10 insertions(+), 42 deletions(-) diff --git a/sdk/daml-script/daml/Daml/Script/Internal.daml b/sdk/daml-script/daml/Daml/Script/Internal.daml index b97d036e9eaf..3c1ffea3f876 100644 --- a/sdk/daml-script/daml/Daml/Script/Internal.daml +++ b/sdk/daml-script/daml/Daml/Script/Internal.daml @@ -21,10 +21,6 @@ module Daml.Script.Internal , unvetPackages , unvetPackagesOnParticipant - , -- Party Management - allocateReplicatedPartyOn - , allocateReplicatedPartyWithHintOn - -- Exceptions , throwAnyException diff --git a/sdk/daml-script/daml/Daml/Script/Internal/Questions/Packages.daml b/sdk/daml-script/daml/Daml/Script/Internal/Questions/Packages.daml index 15b8a2c210cf..2c2a94fd967f 100644 --- a/sdk/daml-script/daml/Daml/Script/Internal/Questions/Packages.daml +++ b/sdk/daml-script/daml/Daml/Script/Internal/Questions/Packages.daml @@ -47,29 +47,21 @@ instance Show PackageName where -- | MOVE Daml.Script.Internal -- Vet a set of packages on all participants. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. vetPackages : HasCallStack => [PackageName] -> Script () vetPackages packages = vetPackagesInternal packages None -- | MOVE Daml.Script.Internal -- Vet a set of packages on a single participant. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. vetPackagesOnParticipant : HasCallStack => [PackageName] -> ParticipantName -> Script () vetPackagesOnParticipant packages participant = vetPackagesInternal packages (Some participant) -- | MOVE Daml.Script.Internal -- Unvet a set of packages on all participants. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. unvetPackages : HasCallStack => [PackageName] -> Script () unvetPackages packages = unvetPackagesInternal packages None -- | MOVE Daml.Script.Internal -- Unvet a set of packages on a single participant. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. unvetPackagesOnParticipant : HasCallStack => [PackageName] -> ParticipantName -> Script () unvetPackagesOnParticipant packages participant = unvetPackagesInternal packages (Some participant) @@ -82,15 +74,11 @@ unvetPackagesInternal : HasCallStack => [PackageName] -> Optional ParticipantNam unvetPackagesInternal packages mParticipantName = lift $ UnvetPackages packages (participantName <$> mParticipantName) -- | MOVE Daml.Script.Internal --- Lists the vetted packages on the default participant --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. +-- Lists the vetted packages on the default participant. listVettedPackages : HasCallStack => Script [PackageName] listVettedPackages = lift ListVettedPackages -- | MOVE Daml.Script.Internal --- Lists all packages (vetted and unvetted) on the default participant --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. +-- Lists all packages (vetted and unvetted) on the default participant. listAllPackages : HasCallStack => Script [PackageName] listAllPackages = lift ListAllPackages diff --git a/sdk/daml-script/daml/Daml/Script/Internal/Questions/PartyManagement.daml b/sdk/daml-script/daml/Daml/Script/Internal/Questions/PartyManagement.daml index 5e0126bc64e8..301966715ebe 100644 --- a/sdk/daml-script/daml/Daml/Script/Internal/Questions/PartyManagement.daml +++ b/sdk/daml-script/daml/Daml/Script/Internal/Questions/PartyManagement.daml @@ -58,34 +58,18 @@ allocatePartyByHint (PartyIdHint idHint) = lift $ AllocateParty with -- Allocate a party with the given display name -- on the specified participant using the party management service. allocatePartyOn : Text -> ParticipantName -> Script Party -allocatePartyOn requestedName participantName = allocatePartyWithHintOn requestedName (PartyIdHint "") participantName +allocatePartyOn requestedName (ParticipantName participant) = lift $ AllocateParty with + requestedName = requestedName + idHint = "" + participants = [participant] {-# DEPRECATED allocatePartyWithHintOn "Daml 3.3 compatibility helper, use 'allocatePartyByHintOn' instead of 'allocatePartyWithHintOn'" #-} -- | MOVE Daml.Script allocatePartyWithHintOn : Text -> PartyIdHint -> ParticipantName -> Script Party -allocatePartyWithHintOn requestedName idHint participant = - allocateReplicatedPartyWithHintOn requestedName idHint participant [] - --- TODO(https://github.com/digital-asset/daml/issues/21035): rework allocateParty to avoid the proliferation of variants --- | MOVE Daml.Script.Internal --- Allocate a party with the given display name on the specified main participant using the party management service --- and replicates it to the specified (possibly empty) list of additional participants. Commands submitted by the --- allocated party will be routed to the main participant. -allocateReplicatedPartyOn : Text -> ParticipantName -> [ParticipantName] -> Script Party -allocateReplicatedPartyOn requestedName mainParticipant additionalParticipants = - allocateReplicatedPartyWithHintOn requestedName (PartyIdHint "") mainParticipant additionalParticipants - --- TODO(https://github.com/digital-asset/daml/issues/21035): rework allocateParty to avoid the proliferation of variants --- | MOVE Daml.Script.Internal --- Allocate a party with the given display name and id hint on the specified main participant using the party --- management service and replicates it to the specified (possibly empty) list of additional participants. Commands --- submitted by the allocated party will be routed to the main participant. -allocateReplicatedPartyWithHintOn : Text -> PartyIdHint -> ParticipantName -> [ParticipantName] -> Script Party -allocateReplicatedPartyWithHintOn requestedName (PartyIdHint idHint) mainParticipant additionalParticipants = - lift $ AllocateParty with - requestedName = requestedName - idHint = idHint - participants = map participantName (mainParticipant :: additionalParticipants) +allocatePartyWithHintOn requestedName (PartyIdHint idHint) (ParticipantName participant) = lift $ AllocateParty with + requestedName = requestedName + idHint = idHint + participants = [participant] -- | MOVE Daml.Script -- Allocate a party with the given id hint From 1f67b89b994aef2a9416629d4a2d671fc77fdf89 Mon Sep 17 00:00:00 2001 From: Carl Pulley Date: Wed, 14 Jan 2026 16:29:03 +0000 Subject: [PATCH 2/2] sync docs --- .../sharable/hoogle/daml-script-hoogle.txt | 28 ++------------- .../daml-script/api/Daml-Script-Internal.rst | 34 ++----------------- 2 files changed, 4 insertions(+), 58 deletions(-) diff --git a/sdk/docs/sharable/hoogle/daml-script-hoogle.txt b/sdk/docs/sharable/hoogle/daml-script-hoogle.txt index c751db950e3f..af43ae77cbf6 100644 --- a/sdk/docs/sharable/hoogle/daml-script-hoogle.txt +++ b/sdk/docs/sharable/hoogle/daml-script-hoogle.txt @@ -1162,53 +1162,29 @@ liftFailedCommandToFailureStatus :: Script a -> Script a isNotActive :: ContractNotFoundAdditionalInfo -> Optional AnyContractId -- | Vet a set of packages on all participants. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-packages-vetpackages-16211 vetPackages :: (HasCallStack) => [PackageName] -> Script () -- | Vet a set of packages on a single participant. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-packages-vetpackagesonparticipant-8324 vetPackagesOnParticipant :: (HasCallStack) => [PackageName] -> ParticipantName -> Script () -- | Unvet a set of packages on all participants. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-packages-unvetpackages-80050 unvetPackages :: (HasCallStack) => [PackageName] -> Script () -- | Unvet a set of packages on a single participant. --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-packages-unvetpackagesonparticipant-47459 unvetPackagesOnParticipant :: (HasCallStack) => [PackageName] -> ParticipantName -> Script () --- | Lists the vetted packages on the default participant --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. +-- | Lists the vetted packages on the default participant. @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-packages-listvettedpackages-3001 listVettedPackages :: (HasCallStack) => Script [PackageName] --- | Lists all packages (vetted and unvetted) on the default participant --- Note that the Admin API port must be provided when using this with a Canton Ledger --- Use ``--admin-port`` with the `daml script` CLI tool. +-- | Lists all packages (vetted and unvetted) on the default participant. @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-packages-listallpackages-50063 listAllPackages :: (HasCallStack) => Script [PackageName] --- | Allocate a party with the given display name on the specified main participant using the party management service --- and replicates it to the specified (possibly empty) list of additional participants. Commands submitted by the --- allocated party will be routed to the main participant. -@url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-partymanagement-allocatereplicatedpartyon-96671 -allocateReplicatedPartyOn :: Text -> ParticipantName -> [ParticipantName] -> Script Party - --- | Allocate a party with the given display name and id hint on the specified main participant using the party --- management service and replicates it to the specified (possibly empty) list of additional participants. Commands --- submitted by the allocated party will be routed to the main participant. -@url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-partymanagement-allocatereplicatedpartywithhinton-30144 -allocateReplicatedPartyWithHintOn :: Text -> PartyIdHint -> ParticipantName -> [ParticipantName] -> Script Party - -- | Throws an ``AnyException``, note that this function discards the stacktrace @url https://docs.daml.com/daml-script/api/Daml-Script-Internal.html#function-daml-script-internal-questions-exceptions-throwanyexception-70957 throwAnyException :: AnyException -> Script t diff --git a/sdk/docs/sharable/sdk/reference/daml-script/api/Daml-Script-Internal.rst b/sdk/docs/sharable/sdk/reference/daml-script/api/Daml-Script-Internal.rst index faba2310ef89..578a4016aab3 100644 --- a/sdk/docs/sharable/sdk/reference/daml-script/api/Daml-Script-Internal.rst +++ b/sdk/docs/sharable/sdk/reference/daml-script/api/Daml-Script-Internal.rst @@ -163,8 +163,6 @@ Functions \: `HasCallStack `_ \=\> \[`PackageName `_\] \-\> :ref:`Script ` () Vet a set of packages on all participants\. - Note that the Admin API port must be provided when using this with a Canton Ledger - Use ``--admin-port`` with the ``daml script`` CLI tool\. .. _function-daml-script-internal-questions-packages-vetpackagesonparticipant-8324: @@ -172,8 +170,6 @@ Functions \: `HasCallStack `_ \=\> \[`PackageName `_\] \-\> :ref:`ParticipantName ` \-\> :ref:`Script ` () Vet a set of packages on a single participant\. - Note that the Admin API port must be provided when using this with a Canton Ledger - Use ``--admin-port`` with the ``daml script`` CLI tool\. .. _function-daml-script-internal-questions-packages-unvetpackages-80050: @@ -181,8 +177,6 @@ Functions \: `HasCallStack `_ \=\> \[`PackageName `_\] \-\> :ref:`Script ` () Unvet a set of packages on all participants\. - Note that the Admin API port must be provided when using this with a Canton Ledger - Use ``--admin-port`` with the ``daml script`` CLI tool\. .. _function-daml-script-internal-questions-packages-unvetpackagesonparticipant-47459: @@ -190,44 +184,20 @@ Functions \: `HasCallStack `_ \=\> \[`PackageName `_\] \-\> :ref:`ParticipantName ` \-\> :ref:`Script ` () Unvet a set of packages on a single participant\. - Note that the Admin API port must be provided when using this with a Canton Ledger - Use ``--admin-port`` with the ``daml script`` CLI tool\. .. _function-daml-script-internal-questions-packages-listvettedpackages-3001: `listVettedPackages `_ \: `HasCallStack `_ \=\> :ref:`Script ` \[`PackageName `_\] - Lists the vetted packages on the default participant - Note that the Admin API port must be provided when using this with a Canton Ledger - Use ``--admin-port`` with the ``daml script`` CLI tool\. + Lists the vetted packages on the default participant\. .. _function-daml-script-internal-questions-packages-listallpackages-50063: `listAllPackages `_ \: `HasCallStack `_ \=\> :ref:`Script ` \[`PackageName `_\] - Lists all packages (vetted and unvetted) on the default participant - Note that the Admin API port must be provided when using this with a Canton Ledger - Use ``--admin-port`` with the ``daml script`` CLI tool\. - -.. _function-daml-script-internal-questions-partymanagement-allocatereplicatedpartyon-96671: - -`allocateReplicatedPartyOn `_ - \: `Text `_ \-\> :ref:`ParticipantName ` \-\> \[:ref:`ParticipantName `\] \-\> :ref:`Script ` `Party `_ - - Allocate a party with the given display name on the specified main participant using the party management service - and replicates it to the specified (possibly empty) list of additional participants\. Commands submitted by the - allocated party will be routed to the main participant\. - -.. _function-daml-script-internal-questions-partymanagement-allocatereplicatedpartywithhinton-30144: - -`allocateReplicatedPartyWithHintOn `_ - \: `Text `_ \-\> :ref:`PartyIdHint ` \-\> :ref:`ParticipantName ` \-\> \[:ref:`ParticipantName `\] \-\> :ref:`Script ` `Party `_ - - Allocate a party with the given display name and id hint on the specified main participant using the party - management service and replicates it to the specified (possibly empty) list of additional participants\. Commands - submitted by the allocated party will be routed to the main participant\. + Lists all packages (vetted and unvetted) on the default participant\. .. _function-daml-script-internal-questions-exceptions-throwanyexception-70957: