Sword-Smith / Sword

Sword — A financial derivative language for the blockchain
MIT License
29 stars 2 forks source link

Test plan for 'pay' #30

Open Sword-Smith opened 3 years ago

Sword-Smith commented 3 years ago
Sword-Smith commented 3 years ago

Test where pay pays to tokenId != 0, and payout < maxFactor Test where pay pays to tokenId == 0 where payout belongs to a scale factor that was lower than maxFactor, but non-zero

solved in 5d5fda13e56f450b4237e583c5855942a2aba701 in geth_tools

Sword-Smith commented 3 years ago

Test where pay pays to tokenId == 0 where payout belongs to a dead (not-taken) branch in an if-within Test where pay pays to tokenId == 0 where payout belongs to a scale factor that was zero (and thus lower than maxFactor) Test where contract is ready for execution but is called by a party that only has tokenId == 0 assets, and where the other party token payouts have not yet been calculated. tokenId == 0 must be able to get their money, so this evaluation must calculate the payouts for tokenId != 0

Solved in the commits 1369abec6725051c723a15c02c6130c721a9c5e0, 264496d467b705f94e73be69609db26729a7494c, 3dbdb189c343d3fdf7b253692c2d5af81832c3b5 in geth_tools.

Sword-Smith commented 3 years ago

Test where tokenId == N and tokenId == N + p, p > 1 are in the money but the rest have value zero. This tests that the encounter of a zero payout value does not interrupt payouts for tokenIds treated later in the pay() execution.

and

Call pay() multiple times and verify that it is an idempotent operation.

Solved in commit 6e1a058af11fc0c73ff5e9905dee7a169c693c0b to geth_tools.