-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ECR-1627] TODO cleanup pt.4 #869
Conversation
* Update rand to 0.5.4 - Bump version in all dependent crates - Replace removed next_u32() with gen::<u32>() (ditto for u64) - Seed of XorShiftRng is now [u8; 16] instead of [u32; 4], fix the types and generate some new seed values - Rng trait got split into Rng and RngCore, add latter where necessary to get access to methods like fill_bytes() - Replace deprecated gen_ascii_chars() with recommended usage of Alphanumeric distribution with sample_iter() - Replace deprecated gen_iter() usage with fill_bytes() and sample_iter() as approriate - Replace deprecated Rand usage with Standard distribution - Replace initialization on XorShiftRng from implicitly converted rand::random() into an explicit initialization from seed as From/Into conversion has been removed * Update snow to 0.3.1 - Resolvers are not reexported now, import them explicitly - NoiseBuilder is now called just Builder - Some functions now return SnowError instead of failure::Error, implement a conversion to NoiseError for this type - CryptoResolver now does not have Send requirement for returned types - Dh trait now expects a Result to be returned - Fix the implementation to return Ok or Err as appropriate, this allows us to get rid of a TODO - Update the tests as well to unwrap the result, this is needed to avoid compiler warnings about unused Results - Returning an Err from Dh::dh() produces a different error so update test expectations to match that * Update proptest to 0.8.4 - Strategy::Value has been changed in 0.8.0 to contain the actual value produced by the strategy instead of strategy value tree (which is now stored in Stragery::Tree). Fix the associate type usage and drop now unnecessary import of U8BinarySearch. * Update tokio-io to 0.1.7 - tokio_io::AsyncRead::framed is deprecated since 0.1.7, use Decoder from tokio_codec instead * Update tokio-retry to 0.2.0 - Retry::spawn() no longer needs event loop handle * Update cspell to 3.1.3 - Use "npm install" to install dependencies from package.json file instead of specifying version in two places * Mention updates in CHANGELOG
2664441
to
3eb2407
Compare
Can you append a brief summary of this pull request, and update title. |
@vldm But... The title is the brief summary of this pull request already. |
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.
The changes look technically okay to me.
But I agree with @vldm that the pull request title could get some more love. For example, it's way more common to put [ECR-1234]
references at the end of the title (119 vs 4 in git history). It also could be a bit more imperative and detailed like Cleanup outdated TODOs
. But I'd keep it as is this time because there are three already merged PRs with the same title pattern.
exonum-dictionary.txt
Outdated
@@ -86,8 +86,10 @@ postvote | |||
precheck | |||
precommit | |||
precommits | |||
precommiters |
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.
<span class="grammarnazi">It is precommitters, with double t.</span>
@@ -76,8 +75,7 @@ fn ignore_propose_from_non_leader() { | |||
|
|||
let propose = ProposeBuilder::new(&sandbox) | |||
.with_validator(ValidatorId(3)) //without this line Prevote would have been broadcast | |||
.with_duration_since_sandbox_time(PROPOSE_TIMEOUT) | |||
.build(); | |||
.build(); |
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.
There's some weird extra indentation here and there. Shouldn't rustfmt
complain about this?..
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.
looks like bug in rustfmt
@@ -1230,8 +1197,7 @@ fn handle_full_propose_wrong_state_hash() { | |||
|
|||
sandbox.assert_state(Height(1), Round(1)); | |||
// let tmp_propose = ProposeBuilder::new(&sandbox) | |||
// .with_duration_since_sandbox_time(PROPOSE_TIMEOUT) | |||
// .build(); | |||
// // .build(); |
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.
Duplicate //
here looks weird.
And... do we need this code? Keeping commented out code is not a good practice.
@@ -1561,8 +1516,7 @@ fn commit_as_leader_send_propose_round_timeout() { | |||
sandbox.check_broadcast_status(new_height, &block.hash()); | |||
|
|||
let propose = ProposeBuilder::new(&sandbox) | |||
.with_duration_since_sandbox_time(PROPOSE_TIMEOUT) | |||
// .with_tx_hashes(&[tx.hash()]) //ordinary propose, but with this unreceived tx | |||
// .with_tx_hashes(&[tx.hash()]) //ordinary propose, but with this unreceived tx |
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.
I'd remove this commented out line entirely then.
) -> Self { | ||
self.duration_since_sandbox_time = Some(duration_since_sandbox_time); | ||
self | ||
} |
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.
Was with_duration_since_sandbox_time()
removed because this field was set but never actually used or verified anywhere?
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.
commit message for 7ba7306 will explain this
Are there any rules? Cause arguments like "it's way more common..." are not arguments at all. |
@ponimas fix typo pls |
Dead code removed from the sandbox.
Implemented proposed test scenarios.
Outdated TODOs were removed.