package Ġnet . cord a . node . services Ċ Ċ import Ġnet . cord a . client . rpc . C ord a RPC Client Ċ import Ġnet . cord a . contracts . multiple . v ulner able . Mutable DataObject Ċ import Ġnet . cord a . contracts . multiple . v ulner able . V ulner able Payment Contract Ċ import Ġnet . cord a . core . messaging . start Flow Ċ import Ġnet . cord a . core . utilities . get OrThrow Ċ import Ġnet . cord a . flows . multiple . evil . Ev il Flow Ċ import Ġnet . cord a . node . Determin istic Sources Rule Ċ import Ġnet . cord a . node . internal . dj vm . Determin istic Verification Exception Ċ import Ġnet . cord a . testing . core . AL ICE _ NAME Ċ import Ġnet . cord a . testing . core . D UMMY _ NOT ARY _ NAME Ċ import Ġnet . cord a . testing . driver . Driver Parameters Ċ import Ġnet . cord a . testing . driver . driver Ċ import Ġnet . cord a . testing . driver . internal . incremental Port Allocation Ċ import Ġnet . cord a . testing . node . Not ary Spec Ċ import Ġnet . cord a . testing . node . User Ċ import Ġnet . cord a . testing . node . internal . cord app With Packages Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Class Rule Ċ import Ġorg . junit . Test Ċ import Ġkotlin . test . assert Fails With Ċ Ċ class ĠDetermin istic Ev il Contract Cannot Modify States Test Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġuser Ġ= ĠUser (" u ", Ġ" p ", Ġset Of ( Permissions . all ())) ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġev il Flow Cor D app Ġ= Ġc ord app With Packages (" net . cord a . flows . multiple . evil "). signed () ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġev il Contract Cor D app Ġ= Ġc ord app With Packages (" net . cord a . contracts . multiple . evil "). signed () ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġvulner able Contract Cor D app Ġ= Ġc ord app With Packages (" net . cord a . contracts . multiple . v ulner able "). signed () ĊĊĠĠĠĠĠĠĠ Ġprivate Ġval ĠNOT H ING Ġ= ĠMutable DataObject ( 0 ) ĊĊĠĠĠĠĠĠĠ Ġ@ Class Rule ĊĠĠĠĠĠĠĠ Ġ@ Jvm Field ĊĠĠĠĠĠĠĠ Ġval Ġd jvm Sources Ġ= ĠDetermin istic Sources Rule () ĊĊĠĠĠĠĠĠĠ Ġfun Ġdriver Parameters ( run In Process : ĠBoolean ): ĠDriver Parameters Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠDriver Parameters ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġport Allocation Ġ= Ġincremental Port Allocation (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstart Nodes In Process Ġ= Ġrun In Process , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnot ary Specs Ġ= ĠlistOf ( Not ary Spec ( D UMMY _ NOT ARY _ NAME , Ġstart In Process Ġ= Ġrun In Process , Ġvalidating Ġ= Ġtrue )), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġc ord apps ForAll Nodes Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvulner able Contract Cor D app , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġev il Contract Cor D app , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġev il Flow Cor D app ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġd jvm Bootstrap Source Ġ= Ġd jvm Sources . bootstrap , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġd jvm C ord a Source Ġ= Ġd jvm Sources . cord a ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ( timeout Ġ= Ġ 3 0 0 _ 0 0 0 ) ĊĠĠĠ Ġfun Ġtest Contract That T ries To Modify States () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġev il Data Ġ= ĠMutable DataObject ( 5 0 0 0 ) ĊĠĠĠĠĠĠĠ Ġdriver ( driver Parameters ( run In Process Ġ= Ġfalse )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġalice Ġ= Ġstart Node ( provided Name Ġ= ĠA LIC E _ NAME , Ġrpc Users Ġ= ĠlistOf ( user )). get OrThrow () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġex Ġ= Ġassert Fails With < Determin istic Verification Exception > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠC ord a RPC Client ( host And Port Ġ= Ġalice . rpc Address ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. start ( user . username , Ġuser . password ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. use Ġ{ Ġclient Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclient . proxy . start Flow (:: Ev il Flow , Ġev il Data ). returnValue . get OrThrow () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( ex ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Starting With (" sandbox . net . cord a . core . contracts . Transaction Verification Exception \$ Contract Rejection Ġ-> Ġ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" ĠContract Ġverification Ġfailed : ĠFailed Ġrequirement : ĠPurchase Ġpayment Ġof Ġ$ NOTH ING Ġshould Ġbe Ġat Ġleast Ġ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (", Ġcontract : Ġsandbox .${ V ulner able Payment Contract :: class . java . name }, Ġ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ