daml/libs-scala/scalatest-utils
Stephen Compall ddc4930f1a
explicit disclosure parameters for JSON API (#16529)
Adds a `disclosedContracts` optional list field to the `meta` argument
for `create`, `exercise` and `create-and-exercise` endpoints.

The argument is ignored in all cases but `exercise` (#16611 builds on
this PR to add `create-and-exercise` support). A single disclosed
contract looks more or less like follows:

    { 
      "contractId": "abcd", 
      "templateId": "Mod:Tmpl", 
      $argumentsJsonField, 
      "metadata": { 
        "createdAt": "2023-03-21T18:00:33.246813Z", 
        "contractKeyHash": "77656c6c2068656c6c6f", 
        "driverMetadata": "dGhlcmUgcmVhZGVy" 
      } 
    }

where `argumentsJsonField` may be either one of these, setting aside the
extra quotes added for these tests:

    "payload": {"owner": "Alice"}
    
    "payloadBlob": { 
      "typeUrl": "type.googleapis.com/com.daml.ledger.api.v1.Record", 
      "value": "Eg4KBW93bmVyEgVaA0JvYg==" 
    }

(Note that `typeUrl` is variable, not constant; use the actual blob's
`typeUrl` contents, **do not assume it is exactly the above example**.)

This PR uses base-64 for `payloadBlob.value` and
`metadata.driverMetadata`, and base-16 for `metadata.contractKeyHash`.
2023-03-30 20:41:36 +00:00
..
src explicit disclosure parameters for JSON API (#16529) 2023-03-30 20:41:36 +00:00
BUILD.bazel explicit disclosure parameters for JSON API (#16529) 2023-03-30 20:41:36 +00:00