-
Notifications
You must be signed in to change notification settings - Fork 199
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
Extractor: only store contracts if a party is a stakeholder #4586
Conversation
CHANGELOG_BEGIN - [Extractor (experimental)]: Contracts visible to a party without being a stakeholder are not stored anymore. - [Extractor (experimental)]: Along with the previous change, the column ``contract.witness_parties`` has been renamed to ``contract.stakeholders``. CHANGELOG_END Contributes to #3498.
extractor/src/main/scala/com/digitalasset/extractor/Extractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/com/digitalasset/extractor/helpers/TransactionTreeTrimmer.scala
Outdated
Show resolved
Hide resolved
Thanks @S11001001. I pushed the fixes. |
parties: Set[String], | ||
templateIds: Set[Identifier]): TransactionTree => TransactionTree = { | ||
val shouldKeep: TreeEvent.Kind => Boolean = event => | ||
(templateIds.isEmpty || containsTemplateId(templateIds.map(asTuple))(event)) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that templateIds.isEmpty
does not change the existing behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you moved this check from streamTransactions
. So, it is all right.
@@ -42,6 +46,7 @@ class Extractor[T](config: ExtractorConfig, target: T)( | |||
extends StrictLogging { | |||
|
|||
private val tokenHolder = config.accessTokenFile.map(new TokenHolder(_)) | |||
private val parties: Set[String] = config.parties.toSet.map[String, Set[String]](identity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is probably a way to do it statically, without the iteration, using scalaz.Liskov
or scalaz.Leibniz
... but I have not fully understood those yet :) so I will leave it for @S11001001 .... but in any case this is a constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha... I see the above thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there is widen
as suggested by @S11001001 in an earlier comment. But unfortunately it triggers the wartremover Any
check. Since it's only a single iteration over the parties it's not a big deal, albeit using widen
would be more elegant of course.
Contributes to #3498.
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.