Skip to content

Commit 4272158

Browse files
committed
fix suspendable issue in FlowTests
1 parent 154b1e2 commit 4272158

File tree

2 files changed

+10
-16
lines changed
  • Features/confidentialidentity-whistleblower/workflows/src

2 files changed

+10
-16
lines changed

Features/confidentialidentity-whistleblower/workflows/src/main/java/net/corda/examples/whistleblower/flows/BlowWhistleFlow.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ public ProgressTracker getProgressTracker() {
8383
public SignedTransaction call() throws FlowException {
8484
progressTracker.setCurrentStep(GENERATE_CONFIDENTIAL_IDS);
8585
FlowSession investigatorSession = initiateFlow(investigator);
86-
Pair<AnonymousParty, AnonymousParty> confidentialPairMeAndInvestigator = generateConfidentialIdentities(investigatorSession);
87-
AnonymousParty anonymousMe = confidentialPairMeAndInvestigator.getFirst();
88-
AnonymousParty anonymousInvestigator = confidentialPairMeAndInvestigator.getSecond();
86+
87+
/** Generates confidential identities for the whistle-blower and the investigator. */
88+
LinkedHashMap<Party, AnonymousParty> confidentialIdentities = subFlow(new SwapIdentitiesFlow(
89+
investigatorSession,
90+
GENERATE_CONFIDENTIAL_IDS.childProgressTracker()
91+
));
92+
93+
AnonymousParty anonymousMe = confidentialIdentities.get(getOurIdentity());
94+
AnonymousParty anonymousInvestigator = confidentialIdentities.get(investigator);
8995

9096
progressTracker.setCurrentStep(BUILD_TRANSACTION);
9197
BlowWhistleState output = new BlowWhistleState(badCompany, anonymousMe, anonymousInvestigator);
@@ -111,16 +117,4 @@ public SignedTransaction call() throws FlowException {
111117
progressTracker.setCurrentStep(FINALISE_TRANSACTION);
112118
return subFlow(new FinalityFlow(ftx, ImmutableList.of(investigatorSession), FINALISE_TRANSACTION.childProgressTracker()));
113119
}
114-
115-
/** Generates confidential identities for the whistle-blower and the investigator. */
116-
@Suspendable
117-
private Pair<AnonymousParty, AnonymousParty> generateConfidentialIdentities(FlowSession counterpartySession) throws FlowException {
118-
LinkedHashMap<Party, AnonymousParty> confidentialIdentities = subFlow(new SwapIdentitiesFlow(
119-
counterpartySession,
120-
GENERATE_CONFIDENTIAL_IDS.childProgressTracker()
121-
));
122-
AnonymousParty anonymousMe = confidentialIdentities.get(getOurIdentity());
123-
AnonymousParty anonymousInvestigator = confidentialIdentities.get(counterpartySession.getCounterparty());
124-
return new Pair<AnonymousParty, AnonymousParty>(anonymousMe, anonymousInvestigator);
125-
}
126120
}

Features/confidentialidentity-whistleblower/workflows/src/test/java/net/corda/examples/whistleblower/FlowTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void setUp() throws Exception {
3535

3636
@After
3737
public void tearDown() {
38-
// network.stopNodes();
38+
network.stopNodes();
3939
}
4040

4141
//simple unit test to check the public keys that used in the transaction

0 commit comments

Comments
 (0)