corda-training-solutions icon indicating copy to clipboard operation
corda-training-solutions copied to clipboard

A testcase is missing for a full settlement to a partially settled IOU

Open ooharawork opened this issue 6 years ago • 0 comments

In excercise of IOUContract.kt, I had erroneously ignored paid amount on settlement contract, i.e.

// wrong
val amountOutstanding = inputIou.amount
// correct
val amountOutstanding = inputIou.amount  - inputIou.paid

IOUSettleTests.kt couldn't detect the error. We needed a test case where we will fully settle an IOU that was partially settled, e.g.

  1. Issue an IOU $10 -> output: one IOU (amount=10, paid=0)
  2. Then settle $5 -> output: one IOU (amount=10, paid=5)
  3. Then settle $5 -> no IOU output

ooharawork avatar Aug 15 '18 05:08 ooharawork