Ensure NodeInfo derived properties informeesOfNode and requireAuthorizers always return (#4554)

Fail with a more explanatory message if `Fetch.actingParties` is `None`

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
fabiotudone-da 2020-03-04 08:18:05 +01:00 committed by GitHub
parent a3228bcea8
commit 85a10e5113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,8 +49,15 @@ object NodeInfo {
def stakeholders: Set[Party]
def actingParties: Option[Set[Party]]
final def requiredAuthorizers: Set[Party] = actingParties.get
final def informeesOfNode: Set[Party] = signatories | actingParties.get
final def requiredAuthorizers: Set[Party] =
actingPartiesOrThrow
final def informeesOfNode: Set[Party] =
signatories | actingPartiesOrThrow
private[this] def actingPartiesOrThrow: Set[Party] =
actingParties.fold(
throw new IllegalStateException(
"'Fetch.actingParties' should always be present but is 'None'"))(identity)
}
trait Exercise extends NodeInfo {