-
Notifications
You must be signed in to change notification settings - Fork 295
Conversation
Signed-off-by: Andrei Lebedev <[email protected]>
Signed-off-by: Andrei Lebedev <[email protected]>
Signed-off-by: Andrei Lebedev <[email protected]>
@@ -35,15 +36,19 @@ namespace iroha { | |||
* apply the missing blocks | |||
*/ | |||
SynchronizationEvent downloadMissingBlocks( | |||
std::shared_ptr<shared_model::interface::Block> commit_message, | |||
const shared_model::interface::types::PublicKeyCollectionType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe pass VoteOther to avoid specifying all parameters in functions?
void init() { | ||
gate = std::make_shared<YacGateImpl>(std::move(hash_gate), | ||
std::move(peer_orderer), | ||
EXPECT_CALL(*block_creator, on_block()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use ON_CALL so that we do not set any unnecessary invariants for tests?
// verify that yac gate emit expected block | ||
auto gate_wrapper = make_test_subscriber<CallExact>(gate->onOutcome(), 1); | ||
gate_wrapper.subscribe([actual_hash, actual_pubkey](auto outcome) { | ||
auto concete_outcome = boost::get<iroha::consensus::VoteOther>(outcome); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in variable name?
|
||
hash_gate = make_unique<MockHashGate>(); | ||
peer_orderer = make_unique<MockYacPeerOrderer>(); | ||
auto hash_gate_ptr = make_unique<MockHashGate>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using namespace std
😱 (not a pr issue)
Signed-off-by: Andrei Lebedev <[email protected]>
@@ -119,8 +119,19 @@ namespace iroha { | |||
PairValid{block, current_hash_.vote_round}); | |||
} | |||
log_->info("Voted for another block, waiting for sync"); | |||
auto public_keys = std::accumulate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use transform instead?
Signed-off-by: Andrei Lebedev <[email protected]>
Description of the Change
The information in VoteOther struct was not enough to handle block loading, so it is replaced with
Benefits
Can synchronize in case different block was committed
Possible Drawbacks
None?