commerceblock / mercurylayer

A Blinded implementation of mercury statechains
53 stars 9 forks source link

Test coverage #56

Open tomt1664 opened 1 month ago

tomt1664 commented 1 month ago

Additional testing scenarios to add to integration tests:

  1. Deposit, iterative self transfer. Client performs self transfer to itself iteratively until the locktime reaches the current blockheight, the withdraw.
  2. Deposit, repeat send. After deposit, client sends to new (randomly generated) ml address (repeats transfer-sender) 1000 times, then transfer-sender to same wallet and transfer-receiver.
  3. Transfer-sender after transfer-receiver: one wallet sends, second wallet receives. Original wallet tries transfer-sender again - should receive error.
  4. Interruption of transfer-sender.
  5. Interruption of transfer-reciever.
  6. Deposit of 1000 coins in same wallet, and transfer each one 1000 times.
tomt1664 commented 2 weeks ago

For coin expiry tests:

  1. Test send backup transaction before expiry (expect error).
  2. Transfer-sender of coin at expiry (locktime == blockheight) or expired (locktime < blockheight). Expect error.
  3. Transfer-receiver of coin at expiry (locktime == blockheight) or expired (locktime < blockheight). Expect error.
  4. Transfer sender of coin that will make it expired by sending (i.e. locktime + interval <= blockheight). Should give error.
tomt1664 commented 1 day ago

Tests for atomic swap:

Documentation for atomic swap process: https://docs.mercurylayer.com/docs/tutorial-extras/translate-your-site

Tests:

  1. Successful test - all transfers complete within batch_time complete.
  2. One party doesn't compete transfer-receiver before the timeout. Both wallets should be able to repeat transfer-sender and transfer-receiver back to new addresses without error, after the timeout.
  3. Second party performs transfer-sender with incorrect or missing batch-id. First party should still receive OK.
  4. First party performs transfer-sender without batch_id.