farcaster-node icon indicating copy to clipboard operation
farcaster-node copied to clipboard

swap state: improve readability

Open zkao opened this issue 3 years ago • 6 comments

zkao avatar Aug 08 '22 12:08 zkao

Not a bug, because the first if case returns in any case, making the new behavior the same as the old behavior, but still better and more readable with this patch.

sedited avatar Aug 08 '22 13:08 sedited

_ No description provided. _

Not a bug, because the first if case returns in any case, making the new behavior the same as the old behavior, but still better and more readable with this patch.

general comment @zkao applicable here & elsewhere: it would be helpful if you could describe what you're fixing in a PR, or provide more detail on the features it's adding. I've often detected incorrect assumptions etc. in my thinking when I forced myself to spell out the logic. Incidentally, it's also more respectful of reviewers' time.

Lederstrumpf avatar Aug 08 '22 13:08 Lederstrumpf

Not a bug, because the first if case returns in any case, making the new behavior the same as the old behavior, but still better and more readable with this patch.

well I wouldn't call the same behavior, I'd call unreachable code

zkao avatar Aug 08 '22 14:08 zkao

oh, actually u r right, sorry, b_buy_tx_seen implies b_buy_sig

zkao avatar Aug 08 '22 14:08 zkao

actually reopening, hit that line again and thought it was a bug, to realise it was the same stuff

zkao avatar Aug 09 '22 15:08 zkao

Codecov Report

Merging #638 (eed490c) into main (5e179ed) will decrease coverage by 0.3%. The diff coverage is 0.0%.

@@           Coverage Diff           @@
##            main    #638     +/-   ##
=======================================
- Coverage    9.4%    9.1%   -0.3%     
=======================================
  Files         32      32             
  Lines      10476   10775    +299     
=======================================
  Hits         980     980             
- Misses      9496    9795    +299     
Impacted Files Coverage Δ
src/swapd/swap_state.rs 0.0% <0.0%> (ø)
src/syncerd/monero_syncer.rs 0.0% <0.0%> (ø)
src/syncerd/bitcoin_syncer.rs 0.0% <0.0%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 09 '22 16:08 codecov-commenter

This is outdated, if it still is an issue, please follow up with another PR.

sedited avatar Dec 14 '22 20:12 sedited