-
Notifications
You must be signed in to change notification settings - Fork 204
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: subscribe to multiple parties #1360
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
07be140
refactor figuring the TransactionFilter to give to API
S11001001 a4e4965
replace ExtractorConfig#party with parties
S11001001 c0050f2
adjust remainder of extractor main code to handle multiple parties
S11001001 2827193
previous extractor tests pass
S11001001 976e131
Merge commit '0771f5d5d30fe334ba08610fefafcbbd53b10d94' into 1353-ext…
S11001001 9faad38
factor dar production for extractor tests
S11001001 5d79b8a
configureExtractor to change ExtractorConfig elements
S11001001 4c3723c
test that party-set extracts the inclusive union of visible contracts…
S11001001 c83072f
release note for extractor multi-party support
S11001001 ff2af79
Merge commit '9e1c1c82ec40aafbaf177ca1dde9962d1a540cc1' into 1353-ext…
S11001001 b78174d
test faithfulness of --party splitting, including with spaces
S11001001 e9f811c
remove unused mixins from MultiPartySpec
S11001001 1c2cb89
update --party's help text regarding multiple parties
S11001001 690dcf4
report malformed party errors at extractor cmdline option parse time
S11001001 b7e19bc
Merge commit 'c0f4585033a559f75e84778e68713e2621299ef3' into 1353-ext…
S11001001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
extractor/src/test/suite/scala/com/digitalasset/extractor/MultiPartySpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package com.digitalasset.extractor | ||
|
||
import com.digitalasset.extractor.config.ExtractorConfig | ||
import com.digitalasset.extractor.services.{CustomMatchers, ExtractorFixtureAroundAll} | ||
import com.digitalasset.ledger.api.testing.utils.SuiteResourceManagementAroundAll | ||
import com.digitalasset.platform.sandbox.persistence.PostgresAroundAll | ||
|
||
import org.scalatest._ | ||
import java.io.File | ||
|
||
import scalaz._ | ||
import scalaz.std.list._ | ||
import scalaz.std.option._ | ||
import scalaz.syntax.foldable._ | ||
|
||
@SuppressWarnings(Array("org.wartremover.warts.Any")) | ||
class MultiPartySpec | ||
extends FlatSpec | ||
with Suite | ||
with PostgresAroundAll | ||
with SuiteResourceManagementAroundAll | ||
with ExtractorFixtureAroundAll | ||
with Inside | ||
with Matchers | ||
with CustomMatchers { | ||
|
||
override protected def darFile = new File("extractor/RecordsAndVariants.dar") | ||
|
||
override def scenario: Option[String] = Some("RecordsAndVariants:multiParty") | ||
|
||
override def configureExtractor(ec: ExtractorConfig): ExtractorConfig = { | ||
val ec2 = super.configureExtractor(ec) | ||
ec2.copy(parties = OneAnd("Alice", ec2.parties.toList)) | ||
} | ||
|
||
"Contracts" should "contain the visible contracts" in { | ||
val ticks = getContracts.map { ct => | ||
for { | ||
o <- ct.create_arguments.asObject | ||
tick <- o("tick") | ||
n <- tick.asNumber | ||
i <- n.toInt | ||
} yield i | ||
} | ||
|
||
val expected = List(1, 2, 4, 5, 7).map(some) | ||
|
||
ticks should contain theSameElementsAs expected | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@leo-da This is the splitting you were looking for; I have a weak preference for doing as little parsing into
CliParams
as possible, but do you want me to add moar type safety forCliParams
?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.
nah, it is fine... but my main concern was documentation, the help screen. Plus the thing that @bitonic wanted you need
unbounded
option configuration, to support multiple party options.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.
Docced in 1c2cb89