corda / accounts

Accounts on Corda
Other
36 stars 38 forks source link

Made SendKeyForAccountFlow return the created key too. #96

Open xavierlepretre opened 4 years ago

xavierlepretre commented 4 years ago

Added tests too.

Unlike ProvideKeyFlow, SendKeyForAccountFlow does not return the created key. This pull request fixes that.

The use case is where both ends of the flow come to agreement about which key to use.

Because both ends need to know the key created, it was not possible to use RequestKeyForAccountFlow, and instead RequestKeyFlow was used.

xavierlepretre commented 4 years ago

@roastario

  1. I thought that with a FlowException thrown in the responder, it was propagated back to the initiator, which is waiting for a reply.
  2. If I reinstate the found / not found state, the responder will have to return a PublicKey? while the initiator can return a PublicKey. Unless the responder sends back "not found" and then throws (not sure about the implications of this double action). Is any ok?