Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

2018 edition #75

Closed
wants to merge 5 commits into from
Closed

2018 edition #75

wants to merge 5 commits into from

Conversation

liamsi
Copy link
Contributor

@liamsi liamsi commented Jun 15, 2019

Very small PR that just makes the code 2018 edition compatible (followed this: https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html).

@tomtau: when I run cargo build, I see changes in the proto generated rust files (nothing relevant, only in file_descriptor_proto_data). Mind checking out that branch and run cargo build on your machine. Do you also see changes in the abci.rs, merkle.rs, types.rs?

ref: #60 #74 #70

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
    - [ ] Wrote tests
    - [ ] Updated relevant documentation (docs/)
    - [ ] Added a relevant changelog entry: clog add [section] [stanza] [message]
  • Reviewed Files changed in the github PR explorer
    - [ ] Bump Tendermint & ABCI version in README.md if version was updated

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@liamsi liamsi requested a review from tomtau June 15, 2019 10:01
@liamsi liamsi requested a review from zramsay June 15, 2019 10:42
@tomtau
Copy link
Contributor

tomtau commented Jun 16, 2019

@liamsi utACK
I'll check out the regenerated proto files tomorrow

@tomtau
Copy link
Contributor

tomtau commented Jun 17, 2019

@liamsi yes, when I run cargo build, it changed the descriptors in protobuf generated rust files:

diff --git a/src/messages/abci.rs b/src/messages/abci.rs
index 67398ee..3762859 100644
--- a/src/messages/abci.rs
+++ b/src/messages/abci.rs
@@ -11465,7 +11465,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     log\x18\x03\x20\x01(\tB\0\x12\x0e\n\x04info\x18\x04\x20\x01(\tB\0\x12\
     \x14\n\ngas_wanted\x18\x05\x20\x01(\x03B\0\x12\x12\n\x08gas_used\x18\x06\
     \x20\x01(\x03B\0\x124\n\x04tags\x18\x07\x20\x03(\x0b2\x0e.common.KVPairB\
-    \x16\xea\xde\x1f\x0etags,omitempty\xc8\xde\x1f\0\x12\x13\n\tcodespace\
+    \x16\xc8\xde\x1f\0\xea\xde\x1f\x0etags,omitempty\x12\x13\n\tcodespace\
     \x18\x08\x20\x01(\tB\0:\0\"\xbc\x01\n\x10ResponseEndBlock\x126\n\x11vali\
     dator_updates\x18\x01\x20\x03(\x0b2\x15.abci.ValidatorUpdateB\x04\xc8\
     \xde\x1f\0\x128\n\x17consensus_param_updates\x18\x02\x20\x01(\x0b2\x15.a\
@@ -11509,10 +11509,10 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \0:\0\"\xaa\x01\n\x08Evidence\x12\x0e\n\x04type\x18\x01\x20\x01(\tB\0\
     \x12(\n\tvalidator\x18\x02\x20\x01(\x0b2\x0f.abci.ValidatorB\x04\xc8\xde\
     \x1f\0\x12\x10\n\x06height\x18\x03\x20\x01(\x03B\0\x122\n\x04time\x18\
-    \x04\x20\x01(\x0b2\x1a.google.protobuf.TimestampB\x08\xc8\xde\x1f\0\x90\
-    \xdf\x1f\x01\x12\x1c\n\x12total_voting_power\x18\x05\x20\x01(\x03B\0:\0B\
-    \x1c\xd0\xe2\x1e\x01\xf8\xe1\x1e\x01\xb8\xe2\x1e\x01\xc8\xe2\x1e\x01\xe0\
-    \xe2\x1e\x01\xc0\xe3\x1e\x01\xa8\xe2\x1e\x01b\x06proto3\
+    \x04\x20\x01(\x0b2\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\
+    \xc8\xde\x1f\0\x12\x1c\n\x12total_voting_power\x18\x05\x20\x01(\x03B\0:\
+    \0B\x1c\xa8\xe2\x1e\x01\xc0\xe3\x1e\x01\xb8\xe2\x1e\x01\xd0\xe2\x1e\x01\
+    \xf8\xe1\x1e\x01\xc8\xe2\x1e\x01\xe0\xe2\x1e\x01b\x06proto3\
 ";

 static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
diff --git a/src/messages/merkle.rs b/src/messages/merkle.rs
index ed81e6f..6ee70b4 100644
--- a/src/messages/merkle.rs
+++ b/src/messages/merkle.rs
@@ -455,8 +455,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     rkle\":\n\x07ProofOp\x12\x0e\n\x04type\x18\x01\x20\x01(\tB\0\x12\r\n\x03\
     key\x18\x02\x20\x01(\x0cB\0\x12\x0e\n\x04data\x18\x03\x20\x01(\x0cB\0:\0\
     \"-\n\x05Proof\x12\"\n\x03ops\x18\x01\x20\x03(\x0b2\x0f.merkle.ProofOpB\
-    \x04\xc8\xde\x1f\0:\0B\x14\xc8\xe2\x1e\x01\xa8\xe2\x1e\x01\xe0\xe2\x1e\
-    \x01\xf8\xe1\x1e\x01\xd0\xe2\x1e\x01b\x06proto3\
+    \x04\xc8\xde\x1f\0:\0B\x14\xf8\xe1\x1e\x01\xc8\xe2\x1e\x01\xd0\xe2\x1e\
+    \x01\xe0\xe2\x1e\x01\xa8\xe2\x1e\x01b\x06proto3\
 ";

 static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
diff --git a/src/messages/types.rs b/src/messages/types.rs
index 8352a27..fd21388 100644
--- a/src/messages/types.rs
+++ b/src/messages/types.rs
@@ -440,9 +440,9 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n8github.com/tendermint/tendermint/libs/common/types.proto\x12\x06commo\
     n\"*\n\x06KVPair\x12\r\n\x03key\x18\x01\x20\x01(\x0cB\0\x12\x0f\n\x05val\
     ue\x18\x02\x20\x01(\x0cB\0:\0\",\n\x08KI64Pair\x12\r\n\x03key\x18\x01\
-    \x20\x01(\x0cB\0\x12\x0f\n\x05value\x18\x02\x20\x01(\x03B\0:\0B\x1c\xf8\
-    \xe1\x1e\x01\xb8\xe2\x1e\x01\xc0\xe3\x1e\x01\xd0\xe2\x1e\x01\xa8\xe2\x1e\
-    \x01\xe0\xe2\x1e\x01\xc8\xe2\x1e\x01b\x06proto3\
+    \x20\x01(\x0cB\0\x12\x0f\n\x05value\x18\x02\x20\x01(\x03B\0:\0B\x1c\xa8\
+    \xe2\x1e\x01\xc8\xe2\x1e\x01\xe0\xe2\x1e\x01\xc0\xe3\x1e\x01\xd0\xe2\x1e\
+    \x01\xf8\xe1\x1e\x01\xb8\xe2\x1e\x01b\x06proto3\
 ";

 static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {

@tomtau
Copy link
Contributor

tomtau commented Jun 17, 2019

@liamsi also, the compiler spits out a lot of warnings about the generated files.
I guess that should be fixed with stepancheg/rust-protobuf#414 ?

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

looks ok.
@liamsi I'm not yet sure about #70 -- perhaps Cargo.lock could still be .gitignored in top / library crate, but the "examples" could be moved to application example crates with Cargo.lock that would be also built, so that there's both flexibility allowed and some level of determinism checked?

@tomtau tomtau self-requested a review June 17, 2019 01:40
@tomtau
Copy link
Contributor

tomtau commented Jun 17, 2019

or commit the diff in generated files and have the top-level Cargo.lock for the mentioned tests: #36 ?

@tomtau
Copy link
Contributor

tomtau commented Jun 17, 2019

looks ok.
@liamsi I'm not yet sure about #70 -- perhaps Cargo.lock could still be .gitignored in top / library crate, but the "examples" could be moved to application example crates with Cargo.lock that would be also built, so that there's both flexibility allowed and some level of determinism checked?

could possibly be in a workspace?

@liamsi
Copy link
Contributor Author

liamsi commented Jun 27, 2019

We should merge #77 first and update this PR

@liamsi
Copy link
Contributor Author

liamsi commented Jun 27, 2019

I like the idea of having a separate crate for the examples (which contains a lock file) 👌

@tomtau
Copy link
Contributor

tomtau commented Aug 23, 2019

updated edition in #85

@tomtau tomtau closed this Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants