mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 04:45:57 +03:00
Improve divulgence warning message. (#10595)
Based on feedback from @bame-da on issue #9947 changelog_begin changelog_end
This commit is contained in:
parent
fd9d8724fc
commit
fb09b72f96
@ -693,14 +693,9 @@ main =
|
||||
]
|
||||
expectScriptSuccess rs (vr "testDivulge") $ \r ->
|
||||
matchRegex r $ T.concat
|
||||
|
||||
[ "Warnings: \n"
|
||||
, " Tried to fetch or exercise -homePackageId-:Test:T contract ContractId\\([0-9a-f]*\\) "
|
||||
, "but none of the reading parties actAs = Set\\(p2\\), readAs = Set\\(\\) are a stakeholder TreeSet\\(p1\\). "
|
||||
, "Use of divulged contracts is deprecated and incompatible with pruning\n"
|
||||
, " Tried to fetch or exercise -homePackageId-:Test:T contract ContractId\\([0-9a-f]*\\) "
|
||||
, "but none of the reading parties actAs = Set\\(p2\\), readAs = Set\\(\\) are a stakeholder TreeSet\\(p1\\). "
|
||||
, "Use of divulged contracts is deprecated and incompatible with pruning$"
|
||||
, " Tried to fetch or exercise -homePackageId-:Test:T on contract [0-9a-f]* but none of the reading parties \\[p2\\] are contract stakeholders \\[p1\\]. Use of divulged contracts is deprecated and incompatible with pruning. To remedy, add one of the readers \\[p2\\] as an observer to the contract.\n"
|
||||
, " Tried to fetch or exercise -homePackageId-:Test:T on contract [0-9a-f]* but none of the reading parties \\[p2\\] are contract stakeholders \\[p1\\]. Use of divulged contracts is deprecated and incompatible with pruning. To remedy, add one of the readers \\[p2\\] as an observer to the contract."
|
||||
],
|
||||
testCase "multi-party query" $ do
|
||||
rs <-
|
||||
|
@ -752,11 +752,13 @@ private[lf] object Speedy {
|
||||
onLedger.visibleToStakeholders(contract.stakeholders) match {
|
||||
case SVisibleToStakeholders.Visible => ()
|
||||
case SVisibleToStakeholders.NotVisible(actAs, readAs) =>
|
||||
val readers = (actAs union readAs).mkString(",")
|
||||
val stakeholders = contract.stakeholders.mkString(",")
|
||||
this.warningLog.add(
|
||||
Warning(
|
||||
commitLocation = onLedger.commitLocation,
|
||||
message =
|
||||
s"Tried to fetch or exercise ${contract.templateId} contract ${cid} but none of the reading parties actAs = ${actAs}, readAs = ${readAs} are a stakeholder ${contract.stakeholders}. Use of divulged contracts is deprecated and incompatible with pruning",
|
||||
s"Tried to fetch or exercise ${contract.templateId} on contract ${cid.coid} but none of the reading parties [${readers}] are contract stakeholders [${stakeholders}]. Use of divulged contracts is deprecated and incompatible with pruning. To remedy, add one of the readers [${readers}] as an observer to the contract.",
|
||||
)
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user