Skip to content

Verify we calculate informees correctly in our scala code #6127

Description

@rautenrieth-da

We have various places where we need to get the informees of a contract from its payload. Among others, bugs in this calculation are problematic because Canton only enforces valid PartyId values for informees. All other PartyId fields may contain strings that are not valid PartyIds.

Recently this lead to ExpiredAmuletAllocationTrigger failing with

java.lang.IllegalArgumentException: Invalid unique identifier `counterparty` with missing namespace.
	at com.digitalasset.canton.topology.UniqueIdentifier$.$anonfun$tryFromProtoPrimitive$1(Identifier.scala:142)
	at cats.syntax.EitherOps$.valueOr$extension(either.scala:95)
	at com.digitalasset.canton.topology.UniqueIdentifier$.tryFromProtoPrimitive(Identifier.scala:142)
	at com.digitalasset.canton.topology.PartyId$.tryFromProtoPrimitive(Member.scala:488)
	at org.lfdecentralizedtrust.splice.sv.automation.delegatebased.ExpiredAmuletAllocationTrigger$$anonfun$$lessinit$greater$1.$anonfun$new$1(ExpiredAmuletAllocationTrigger.scala:50)

, see #6126.

Ideas:

I think ideally we would actually test everywhere that these lists match the stakeholders but I'm not quite sure how to set this up as we don't store stakeholder lists :thinking_face:
maybe a debug mode where we call queryEventById in tests on the ledger API?
the fact that we duplicate that informee computation is also a bit silly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions