package Ġcom . h ml r . contracts Ċ Ċ import Ġcom . h ml r . Abstract Contracts States TestUtils Ċ import Ġcom . h ml r . model .* Ċ import Ġcom . h ml r . states . Land Title State Ċ import Ġnet . cord a . core . contracts . Type Only Command Data Ċ import Ġnet . cord a . testing . node . Mock Services Ċ import Ġnet . cord a . testing . node . ledger Ċ import Ġorg . junit . Test Ċ Ċ class ĠIssue Pro posed Charge And Restriction Tests Ġ: ĠAbstract Contracts States TestUtils () Ġ{ ĊĊĠĠĠ Ġclass ĠDummy Command Ġ: ĠType Only Command Data () ĊĠĠĠ Ġprivate Ġvar Ġledger Services Ġ= ĠMock Services ( listOf (" com . h ml r . contracts ")) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` must ĠInclude ĠIssue Ġproposed Ġcharge Ġand Ġrestriction ĠCommand `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠIssue Pro posed Charge And Restriction Tests . Dummy Command ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` must ĠInclude ĠExact ly ĠOne ĠInput ĠState Ġ` () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠRemove Ġan Ġinput Ġstate ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠAdd Ġan Ġinput Ġstate ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` must ĠInclude ĠExact ly ĠThree ĠOutput ĠStates `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` status ĠOf ĠIssue ĠPro posed Ġcharge Ġand Ġrestriction Ġstate ĠShould ĠBe ĠSet ĠTo ĠIss ued `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( status Ġ= ĠD TC Consent Status . CON SENT _ FOR _ DIS CHAR GE )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` list Ġof Ġcharges Ġand Ġrestrictions Ġmust Ġbe Ġequal Ġin Ġtitle Ġstate Ġas Ġwell Ġas Ġproposed Ġcharges Ġand Ġrestriction Ġstate `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( charges Ġ= Ġset Of ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( re strictions Ġ= Ġset Of ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( charges Ġ= Ġset Of () Ġ, re strictions Ġ= Ġset Of ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` re strictions Ġmust Ġnot Ġhave Ġany Ġcons ents Ġwhen Ġissued Ġon Ġthe Ġledger `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( add New Charge Consent ed Ġ= Ġtrue )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( dis charge Consent ed Ġ= Ġtrue )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( dis charge Consent ed Ġ= Ġtrue , Ġadd New Charge Consent ed Ġ= Ġtrue )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġrestriction Ġ= ĠCharge Restriction (" CB CR ", Ġrestriction Text , ĠL ENDER 1 . party , ĠAction On Restriction . ADD _ RE STRI CTION , Ġfalse , Ġcharge ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( re strictions Ġ= Ġset Of ( restriction ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` re strictions Ġshould Ġhave Ġcorrect Ġconsent ing Ġparties `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġoutput Iss u ance Request State Ġ= Ġrequest Iss u ance State . copy ( status Ġ= ĠRequest Iss u ance Status . APPRO VED ) ĊĠĠĠĠĠĠĠ Ġledger Services . ledger Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġrestriction Ġ= ĠCharge Restriction (" CB CR ", Ġrestriction Text , ĠCHAR LI E . party , ĠAction On Restriction . NO _ ACTION , Ġfalse , Ġcharge ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State . copy ( re strictions Ġ= Ġset Of ( restriction ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . fails () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtransaction Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġrequest Iss u ance State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Request Iss u ance Contract . REQUEST _ IS SU ANCE _ CONTRACT _ ID , Ġoutput Iss u ance Request State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Land Title Contract . LAND _ TITLE _ CONTRACT _ ID , Ġland Title State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoutput ( Pro posed Charge And Restriction Contract . PRO POSE D _ CHAR GE _ RE STRI CTION _ CONTRACT _ ID , Ġproposed Charge Or Restriction State ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠRequest Iss u ance Contract . Commands . Approve Request ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠLand Title Contract . Commands . Issue Land Title ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcommand ( listOf ( AL ICE . publicKey ), ĠPro posed Charge And Restriction Contract . Commands . Issue Pro posed Charge And Restriction ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis . ver ifies () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }