LeastAuthority / wormhole-client

A magic-wormhole client in Haskell
GNU General Public License v3.0
6 stars 1 forks source link

check and abort connection if out of order packets are received #34

Closed vu3rdd closed 6 years ago

vu3rdd commented 6 years ago

Addresses #20. Refactor the decrypt and decryptC code for better handling of out-of-order packets. decryptC was reimplementing decrypt, which didn't seem like the right thing to do, making maintenance hard. Instead, now decryptC will make use of decrypt.

The fromMaybe and other partial functions should go away because they render our Exception mechanisms useless. These will be addressed across the code in another separate PR.


This change is Reviewable

vu3rdd commented 6 years ago

Thanks for the review. Just pushed a couple of tests.

vu3rdd commented 6 years ago

I guess the idea of hspec is that these things should read like English sentences (not sure I think this is a useful idea or not so feel free to ignore this if you want)

Yes, that is correct. I keep forgetting that. Going to push a change. (I could not figure out a way to reply just below your comment)..