poanetwork / hbbft

An implementation of the paper "Honey Badger of BFT Protocols" in Rust. This is a modular library of consensus.
Other
357 stars 96 forks source link

Make the main loop of the DynamicHoneyBadger test more readable #373

Open vkomenda opened 5 years ago

vkomenda commented 5 years ago

The main loop of net_dynamic_hb apparently has too many internal loops. Clippy throws an error cyclomatic_complexity if not is silenced. The loop has to be split into several functions accessing shared test state.

trendsetter37 commented 5 years ago

Is this issue outdated? It seems as though net_dynamic_hd has been updated/removed.

afck commented 5 years ago

It has been replaced/renamed, but it's still spaghetti code.

trendsetter37 commented 5 years ago

I'll take a wack at this.

trendsetter37 commented 5 years ago

@afck is do_drop_and_re_add function still invoked when running cargo test? I didn't get any errors/warnings when removing the clippy_cyclomatic_complexity flag. Also is there an IRC or slack channel associated with this project?

Edit: I see. I need to install clippy and use ci.sh file.

afck commented 5 years ago

Yes, that's a clippy lint. Also, cargo clippy doesn't check the test code. You need to use cargo clippy --tests or cargo clippy --all-targets for that.