Skip to content
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

Enable integration tests + GitHub Actions Service for Tendermint node #183

Merged
merged 2 commits into from
Mar 16, 2020

Conversation

greg-szabo
Copy link
Member

@codecov-io
Copy link

codecov-io commented Mar 16, 2020

Codecov Report

Merging #183 into master will decrease coverage by 3.64%.
The diff coverage is 70%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #183      +/-   ##
=========================================
- Coverage   42.05%   38.4%   -3.65%     
=========================================
  Files          88      97       +9     
  Lines        3051    3497     +446     
  Branches      470     552      +82     
=========================================
+ Hits         1283    1343      +60     
- Misses       1431    1801     +370     
- Partials      337     353      +16
Impacted Files Coverage Δ
tendermint/src/rpc/endpoint/abci_query.rs 0% <ø> (ø) ⬆️
tendermint/src/genesis.rs 0% <0%> (ø) ⬆️
tendermint/src/rpc/endpoint/abci_info.rs 41.17% <77.77%> (+41.17%) ⬆️
tendermint/src/block/signed_header.rs 33.33% <0%> (-33.34%) ⬇️
tendermint/src/signature.rs 31.57% <0%> (-22.97%) ⬇️
tendermint/src/hash.rs 53.65% <0%> (-13.01%) ⬇️
tendermint/src/account.rs 46.03% <0%> (-8.69%) ⬇️
tendermint/src/vote/power.rs 11.11% <0%> (-5.56%) ⬇️
tendermint/src/vote.rs 36.2% <0%> (-5.31%) ⬇️
tendermint/src/chain/id.rs 58.73% <0%> (-5.07%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00f4390...eca3cc2. Read the comment docs.

@greg-szabo greg-szabo requested a review from liamsi March 16, 2020 04:30
tendermint/src/rpc/endpoint/abci_info.rs Show resolved Hide resolved
.github/workflows/rust.yml Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
tendermint/src/rpc/endpoint/abci_info.rs Outdated Show resolved Hide resolved
where
S: Serializer,
{
String::from_utf8(base64::encode(hash.as_bytes()))
String::from_utf8(base64::encode(hash.unwrap().as_bytes()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this panic if hash is None?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting point. The normal execution in serde is that if the parameter is missing or None and you have the Default trait implemented, then this serializer function is not run. The Default implementation takes over and assumes whatever value is defined there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is definitely something fishy about this 🤔 I think the method should err if hash is None which is possible. At least the type system allows that even if used as intended this won't happen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why we have the skip_serializing_if = "Option::is_none" added. If hash is None, serde will not call the function.

@@ -10,6 +10,7 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Request {
/// Path to the data
#[serde(skip_serializing_if = "Option::is_none")]
path: Option<Path>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprising that this can be empty. But yeah, in JSON everything seems possible :-D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the Tendermint Go code that's surprising in most of these cases. Some of their definitions don't seem to make sense to me, but if we want to be compatible with a full node, we have to follow them.

.github/workflows/rust.yml Show resolved Hide resolved
tendermint/src/rpc/endpoint/abci_info.rs Show resolved Hide resolved
)]
pub last_block_app_hash: Hash,
pub last_block_app_hash: Option<Hash>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above: This can only be empty on genesis, right? Maybe add a comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, abci_info doesn't print this over RPC.

tendermint/src/rpc/endpoint/abci_info.rs Show resolved Hide resolved
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to merge this as is and capture relevant comments in an issue.

Thanks a lot @greg-szabo !

@greg-szabo greg-szabo merged commit 50cd585 into master Mar 16, 2020
@greg-szabo greg-szabo deleted the greg/ci branch March 16, 2020 22:50
@liamsi
Copy link
Member

liamsi commented Mar 16, 2020

ref: #71

@greg-szabo greg-szabo mentioned this pull request Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants