package Ġnet . cord a . core . flows Ċ Ċ import Ġco . parallel universe . fib ers . Suspend able Ċ import Ġnet . cord a . core . contracts .* Ċ import Ġnet . cord a . core . identity . Party Ċ import Ġnet . cord a . core . internal . Resolve Transactions Flow Ċ import Ġnet . cord a . core . transactions . Signed Transaction Ċ import Ġnet . cord a . core . utilities . unwrap Ċ import Ġjava . security . Signature Exception Ċ Ċ /** Ċ Ġ* ĠThe Ġ[ Receive Transaction Flow ] Ġshould Ġbe Ġcalled Ġin Ġresponse Ġto Ġthe Ġ[ Send Transaction Flow ]. Ċ Ġ* Ċ Ġ* ĠThis Ġflow Ġis Ġa Ġcombination Ġof Ġ[ receive ], Ġresolve Ġand Ġ[ Signed Transaction . verify ]. ĠThis Ġflow Ġwill Ġreceive Ġthe Ġ[ Signed Transaction ] Ċ Ġ* Ġand Ġperform Ġthe Ġresolution Ġback - and - for th Ġrequired Ġto Ġcheck Ġthe Ġdependencies Ġand Ġdownload Ġany Ġmissing Ġattachments . Ċ Ġ* ĠThe Ġflow Ġwill Ġreturn Ġthe Ġ[ Signed Transaction ] Ġafter Ġit Ġis Ġresolved Ġand Ġthen Ġverified Ġusing Ġ[ Signed Transaction . verify ]. Ċ Ġ*/ Ċ class ĠReceive Transaction Flow Ċ @ Jvm Over loads Ċ constructor ( private Ġval Ġother Party : ĠParty , Ġprivate Ġval Ġcheck S ufficient Signatures : ĠBoolean Ġ= Ġtrue ) Ġ: ĠFlow Logic < Signed Transaction >() Ġ{ ĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġ@ Throws ( Signature Exception :: class , ĠAttachment Resolution Exception :: class , ĠTransaction Resolution Exception :: class , ĠTransaction Verification Exception :: class ) ĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠSigned Transaction Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġreceive < Signed Transaction >( other Party ). unwrap Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsub Flow ( Resolve Transactions Flow ( it , Ġother Party )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . verify ( service Hub , Ġcheck S ufficient Signatures ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠThe Ġ[ Receive State And Ref Flow ] Ġshould Ġbe Ġcalled Ġin Ġresponse Ġto Ġthe Ġ[ Send State And Ref Flow ]. Ċ Ġ* Ċ Ġ* ĠThis Ġflow Ġis Ġa Ġcombination Ġof Ġ[ receive ] Ġand Ġresolve . ĠThis Ġflow Ġwill Ġreceive Ġa Ġlist Ġof Ġ[ State And Ref ] Ċ Ġ* Ġand Ġperform Ġthe Ġresolution Ġback - and - for th Ġrequired Ġto Ġcheck Ġthe Ġdependencies . Ċ Ġ* ĠThe Ġflow Ġwill Ġreturn Ġthe Ġlist Ġof Ġ[ State And Ref ] Ġafter Ġit Ġis Ġresolved . Ċ Ġ*/ Ċ // Ġ@ Jvm Suppress W ild cards Ġis Ġused Ġto Ġsuppress Ġwild cards Ġin Ġreturn Ġtype Ġwhen Ġcalling Ġ` sub Flow ( new ĠReceive State And Ref < T >( other Party )) ` Ġin Ġjava . Ċ class ĠReceive State And Ref Flow < out ĠT Ġ: ĠContract State >( private Ġval Ġother Party : ĠParty ) Ġ: ĠFlow Logic < @ Jvm Suppress W ild cards ĠList < State And Ref < T >> >() Ġ{ ĊĠĠĠ Ġ@ Suspend able ĊĠĠĠ Ġoverride Ġfun Ġcall (): ĠList < State And Ref < T >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġreceive < List < State And Ref < T >> >( other Party ). unwrap Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsub Flow ( Resolve Transactions Flow ( it . map Ġ{ Ġit . ref . tx hash Ġ}. toSet (), Ġother Party )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ