Я пытаюсь следовать руководству Corda, но не понимаю, в чем я ошибаюсь ... Модульный тест запускается успешно, но когда я пытаюсь выпустить новую долговую расписку через api, возникает исключение. Это мой рабочий код долгового обязательства. Исключение составляет заголовок, заранее спасибо.
//get notary reference
final Party notary = getServiceHub().getNetworkMapCache().getNotaryIdentities().get(0);
//builder
final TransactionBuilder builder = new TransactionBuilder(notary);
final List<PublicKey> partiesKey = this.state.getParticipants()
.stream().map(AbstractParty::getOwningKey)
.collect(Collectors.toList());
//create new issue command
final Command<IOUContract.Commands.Issue> cmd = new Command<>(
new IOUContract.Commands.Issue(), partiesKey
);
//create a transaction state
TransactionState<IOUState> txState = new TransactionState<>(this.state,
IOUContract.IOU_CONTRACT_ID, notary);
//add to builder command and state
builder.withItems(cmd, txState);
//verify sign it
builder.verify(getServiceHub());
// Sign the transaction.
final Party me = getOurIdentity();
final SignedTransaction ptx = getServiceHub().signInitialTransaction(builder, me.getOwningKey());
List<Party> otherParties = this.state.getParticipants().stream()
.filter(x -> x.getOwningKey() != me.getOwningKey())
.map(el -> (Party)el)
.collect(Collectors.toList());
//open flow session with other parties
List<FlowSession> sessions = otherParties.stream()
.map(el -> initiateFlow(el))
.collect(Collectors.toList());
SignedTransaction fullSign = subFlow(
new CollectSignaturesFlow(
ptx,
sessions,
ImmutableList.of(me.getOwningKey()),
CollectSignaturesFlow.Companion.tracker()
)
);
return subFlow(new FinalityFlow(fullSign, sessions));
Если я изменю код в последних 3 строках:
FROM
//open flow session with other parties
List<FlowSession> sessions = otherParties.stream()
.map(el -> initiateFlow(el))
.collect(Collectors.toList());
SignedTransaction fullSign = subFlow(
new CollectSignaturesFlow(
ptx,
sessions,
ImmutableList.of(me.getOwningKey()),
CollectSignaturesFlow.Companion.tracker()
)
);
return subFlow(new FinalityFlow(fullSign, sessions));
К
//open flow session with counter party
FlowSession lenderFlow = initiateFlow(state.getLender());
SignedTransaction fullSign = subFlow(
new CollectSignaturesFlow(
ptx,
ImmutableSet.of(lenderFlow),
ImmutableList.of(me.getOwningKey()),
CollectSignaturesFlow.Companion.tracker()
)
);
return subFlow(new FinalityFlow(fullSign, ImmutableSet.of(lenderFlow)));
Работает правильно, ПОЧЕМУ? какая разница?