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

Fix cargo protoc error #44

Merged
merged 4 commits into from
Jul 21, 2021
Merged

Fix cargo protoc error #44

merged 4 commits into from
Jul 21, 2021

Conversation

DaviRain-Su
Copy link

@DaviRain-Su DaviRain-Su commented Jul 19, 2021

Fix : #43
Relate issue: #42

  • ensure ics23.rs can be regenerated via cargo protoc without breaking the build
  • Enable the api.rs tests in no-std mode as well

For api.rs also passes the test under no_std is problematic, due to the use of the File and IO libraries under the standard library. However, there is no core library in core, and alloc, so now it is possible to handle it in this way and only let it test under std.

@DaviRain-Su
Copy link
Author

@ethanfrey Hi, Can you review this PR?

@DaviRain-Su
Copy link
Author

Relate Rust no-std: https://justjjy.com/Rust-no-std

@tzemanovic
Copy link

Thanks for updating this. I think you also need to bump prost version in rust/Cargo.toml and regenerate the proto files with the rust/codegen

#[prost(bytes, tag = "1")]
pub key: alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks better. I need to test it locally

Copy link
Author

Choose a reason for hiding this comment

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

This looks better. I need to test it locally

enen, I tested it and it's OK.

@DaviRain-Su
Copy link
Author

DaviRain-Su commented Jul 20, 2021

Thanks for updating this. I think you also need to bump prost version in rust/Cargo.toml and regenerate the proto files with the rust/codegen

Ye, I have been update cargo.toml.

@ethanfrey
Copy link
Contributor

Looks good.

I checked out the code and all tests pass.

Running cargo protoc and cargo fmt will regenerate the same code.

@ethanfrey ethanfrey merged commit 5a0206f into cosmos:master Jul 21, 2021
@ethanfrey ethanfrey mentioned this pull request Jul 21, 2021
4 tasks
@DaviRain-Su DaviRain-Su deleted the no-std-cleanup branch July 30, 2021 10:13
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