digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
Other
802 stars 204 forks source link

Match up display contract ids with Show instances in Daml Studio #8860

Open cocreature opened 3 years ago

cocreature commented 3 years ago

Currently, we remap contract ids in Daml Studio in the transaction view to event ids to have something shorter and nicer. However, the Show instances in LF >= 1.11 expose the underlying contract ids which are super long and ugly.

The mismatch is pretty confusing and we should fix that. There are two options:

  1. Fix the Show instance to match the current contract ids. We could either do this by always remapping when switching between on-ledger and off-ledger machine or we could make the behavior of SBToTextContractId configurable.
  2. We could switch away from remapping and move towards static contract id seeding. This leads to slightly unweildly long contract ids so to combat that, we should probably combine this with git-style shortening to the shortest unambiguous string.
dasormeter commented 3 years ago

@cocreature does this only affect the visual studio representation of contract ids, or also applies to daml script interpretation? In daml script i noticed contract ids are not returned at all ( is returned instead) but I believe you previously mentioned that this requires updating to latest and greatest DAML LF for the full contract id to be shown?

cocreature commented 3 years ago

This issue only applies to visual studio. Both visual studio and the command line thing only show contract ids in DAML-LF 1.11 (stable in SDK 1.10). Before you get <contract-id> which is pretty useless.