Guziec-Lobuziec / ECMarket

0 stars 1 forks source link

Agreement Manager - agreement A1.3 implementation #16

Open Guziec-Lobuziec opened 6 years ago

Guziec-Lobuziec commented 6 years ago

Scenario:

  1. S creates sets price, maxNumOfRenegotiations, securityDeposit1 (k1 for short) and securityDeposit2 (k2 for short)
  2. B joins and sends price + k1
  3. S accepts B and sends k2
  4. B concludes and withdraws k1
  5. S concludes and withdraws k2 + price

3a. B rejects and offers newPrice (renegotiationsCount++) 4aa. S concludes and withdraws newPrice + k2 5aa. B concludes and withdraws price - newPrice + k1

4ab. S rejects and offers newPrice2 (renegotiationsCount++) 5ab. B concludes and withdraws price - newPrice2 + k1 6ab. S concludes and withdraws newPrice2 + k2

if renegotiationsCount > maxNumOfRenegotiations (renegotiationsCount+3)a. S/B rejects - system confiscates k1 and k2 (renegotiationsCount+4)a. S concludes and withdraws price (renegotiationsCount+5)a*. B concludes

Custom properties: price, securityDeposit1, securityDeposit2, maxNumOfRenegotiations, renegotiationsCount