From 716f15fe83ff595698e7dd701c07f6e94b6bd63a Mon Sep 17 00:00:00 2001 From: mattbradburyr3 Date: Sun, 29 Jan 2023 16:02:14 +0000 Subject: [PATCH] fixed UpdateChatFlow --- .../utxoexample/workflows/CreateNewChatFlow.java | 2 +- .../csdetemplate/utxoexample/workflows/UpdateChatFlow.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.java b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.java index 3082d0a..cb5bf45 100644 --- a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.java +++ b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/CreateNewChatFlow.java @@ -132,7 +132,7 @@ public class CreateNewChatFlow implements RPCStartableFlow { return flowEngine.subFlow(new FinalizeChatSubFlow(signedTransaction, otherMember.getName())); } catch (Exception e) { - log.warn("Failed to process utxo flow for request body '$requestBody' because:'${e.message}'"); + log.warn("Failed to process utxo flow for request body " + requestBody + " because: " + e.getMessage()); throw new CordaRuntimeException(e.getMessage()); } } diff --git a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java index 75d8da0..831275d 100644 --- a/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java +++ b/workflows/src/main/java/com/r3/developers/csdetemplate/utxoexample/workflows/UpdateChatFlow.java @@ -75,7 +75,7 @@ public class UpdateChatFlow implements RPCStartableFlow { List> chatStates = ledgerService.findUnconsumedStatesByType(ChatState.class); List> chatStatesWithId = chatStates.stream() - .filter(sar -> sar.getState().getContractState().getId() == flowArgs.getId()).collect(toList()); + .filter(sar -> sar.getState().getContractState().getId().equals(flowArgs.getId())).collect(toList()); if (chatStatesWithId.size() != 1) throw new CordaRuntimeException("Multiple or zero Chat states with id " + flowArgs.id + " found"); StateAndRef stateAndRef = chatStatesWithId.get(0); @@ -84,7 +84,7 @@ public class UpdateChatFlow implements RPCStartableFlow { ChatState state = stateAndRef.getState().getContractState(); List members = state.getParticipants().stream().map( - it -> requireNonNull(memberLookup.lookup(it), "Member not found from Key") + it -> requireNonNull(memberLookup.lookup(it), "Member not found from public Key "+ it + ".") ).collect(toList()); // Now we want to check that there is only one member other than ourselves in the chat. @@ -108,7 +108,7 @@ public class UpdateChatFlow implements RPCStartableFlow { return flowEngine.subFlow(new FinalizeChatSubFlow(signedTransaction, otherMember.getName())); } catch (Exception e) { - log.warn("Failed to process utxo flow for request body '$requestBody' because:'${e.message}'"); + log.warn("Failed to process utxo flow for request body " + requestBody + " because: " + e.getMessage()); throw e; } }