digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
797 stars 201 forks source link

[BUG] - LedgerId not deprecated in CommandSubmissionClient in 2.0.0 #13519

Closed francescobenintende closed 2 years ago

francescobenintende commented 2 years ago

I confirm that, if this is a bug that has security implications, I already contacted security@digitalasset.com and followed the responsible disclosure policy.

I confirm that this is not a question or a request for technical support by the community, for which the Daml forum is available.

Affected Daml version

2.0.0

Bug description

CommandSubmissionClient has its ledgerId as a @NonNull argument even though the ledgerId is optional from 2.0.0 (Command submission service docs).

To reproduce

  1. Instantiate CommandSubmissionClient without ledgerId in constructor
  2. see error

Expected behavior

CommandSubmissionClient is instantiated.

Additional context

image

stefanobaghino-da commented 2 years ago
  1. Despite the client being publicly visible, the command submission client is not really meant to be used directly, but rather through the DamlLedgerClient. Is there a specific reason why you are instantiating the command submission client directly?
  2. At this low level, the client relies on Protobuf's behavior by which an empty string is the default empty value. Hence, you can instantiate the client by passing an empty string. If this causes issues, please re-open this ticket adding the information about the failure.