Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish witnesses and divulgences in scenario table view #6571

Merged
merged 2 commits into from
Jul 2, 2020

Conversation

hurryabit
Copy link
Contributor

@hurryabit hurryabit commented Jul 2, 2020

Currently, we display a "D" (for "Disclosure/Divulgence") in the table
view of the scenario view when a party can see a contract because they
have learnt about it via disclosure.

This change further refines this visibily indicators for disclosure:
We display a "W" for "Witness" (i.e. the party has witnessed the
creation of the contract) and "D" for "Divulgence".

Help for the reviewer: In the scenario service server, witnessing is
called explicit disclosure whereas divulgence is called implicit
disclosure.

CHANGELOG_BEGIN

  • [DAML Studio]
    When displaying scenario results in table view in DAML Studio, we now
    indicate why a party knows about the existence of a contract:
    • S means the party is a signatory.
    • O means the party is an observer.
    • W means the party has witnessed the creation of the contract.
    • D means the party has learned about the contract via divulgence.
      CHANGELOG_END

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.


This change is Reviewable

Currently, we display a "D" (for "Disclosure/Divulgence") in the table
view of the scenario view when a party can see a contract because they
have learnt about it via disclosure.

This change further refines this visibily indicators for disclosure:
We display a "W" for "Witness" (i.e. the party has witnessed the
creation of the contract) and "D" for "Divulgence".

Help for the reviewer: In the scenario service server, witnessing is
called explicit disclosure whereas divulgence is called implicit
disclosure.

CHANGELOG_BEGIN
* [DAML Studio]
  When displaying scenario results in table view in DAML Studio, we now
  indicate _why_ a party knows about the existence of a contract:
  - `S` means the party is a signatory.
  - `O` means the party is an observer.
  - `W` means the party has witnessed the creation of the contract.
  - `D` means the party has learned about the contract via divulgence.
CHANGELOG_END
@hurryabit
Copy link
Contributor Author

Screenshot 2020-07-02 at 08 05 31

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you!

@@ -83,7 +83,7 @@ object ScenarioLedger {
globalImplicitDisclosure: Relation[ContractId, Party],
failedAuthorizations: FailedAuthorizations,
) {
def disclosures(coidToEventId: ContractId => EventId): Relation[EventId, Party] =
def disclosures(coidToEventId: ContractId => EventId): Map[EventId, Set[Party]] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I’m not really a fan of synonyms it also seems a bit confusing to work with Relation.… in the body of this method but then not use the type synonym.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. That's a relic from a failed attempt to change some things. I'll bring it back to its original state. I should have self-reviewed my PR better. 😞

_.addDisclosures(witnesses.map(_ -> Disclosure(since = trId, explicit = true)).toMap))
}
richTr.globalImplicitDisclosure.foldLeft(cacheWithExplicitDisclosures) {
case (cacheP, (coid, witnesses)) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t witnesses be called divulgees here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea. Thanks. I blindly copied the old code...

@mergify mergify bot merged commit 3296f56 into master Jul 2, 2020
@mergify mergify bot deleted the table-view-disclogence branch July 2, 2020 07:58
garyverhaegen-da added a commit that referenced this pull request Jul 2, 2020
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
(which is the default), we display X's as before.
CHANGELOG_END
garyverhaegen-da added a commit that referenced this pull request Jul 2, 2020
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
garyverhaegen-da added a commit that referenced this pull request Jul 2, 2020
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
garyverhaegen-da added a commit that referenced this pull request Jul 3, 2020
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
garyverhaegen-da added a commit that referenced this pull request Jul 3, 2020
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).

CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
  checkbox (next to Show archived). When that checkbox is not checked
  (which is the default), we display X's as before.
CHANGELOG_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants