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(celestia-grpc-macros): Fix standalone build for celestia-grpc-macros, add CI #470

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Run clippy for native
run: cargo clippy --all --all-targets -- -D warnings

- name: Run clippy for celestia-grpc-macros
run: cargo clippy -p celestia-grpc-macros --all-targets -- -D warnings

- name: Run clippy for wasm32
run: cargo clippy --all --all-targets --target=wasm32-unknown-unknown -- -D warnings

Expand Down
8 changes: 7 additions & 1 deletion grpc/grpc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
name = "celestia-grpc-macros"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
description = "Helper crate for grpc_method macro for creating gRPC client, used by celestia-grpc"
authors = ["Eiger <[email protected]>"]
homepage = "https://www.eiger.co"
repository = "https://github.com/eigerco/lumina"
readme = "README.md"

Copy link
Member

Choose a reason for hiding this comment

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

could you please extend package metadata with missing stuff?
https://github.com/eigerco/lumina/actions/runs/12119063228/job/33784860143#step:6:447

manifest has no description, license, license-file, documentation, homepage or repository.

[dependencies]
quote = "1.0.37"
syn = "2.0.87"
syn = { version = "2.0.87", features = ["full", "extra-traits"]}
proc-macro2 = "1.0.89"

[lib]
Expand Down
26 changes: 26 additions & 0 deletions grpc/grpc-macros/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Helper crate for grpc_method macro for creating a tonic gRPC client, used by [celestia-grpc](https://docs.rs/celestia-grpc/latest/celestia_grpc/).

# Example

```rust,ignore
use celestia_proto::cosmos::auth::v1beta1::query_client::QueryClient;
use tonic::service::Interceptor;
use tonic::transport::Channel;

pub struct GrpcClient<I>
where
I: Interceptor,
{
grpc_channel: Channel,
auth_interceptor: I,
}

impl<I> GrpcClient<I>
where
I: Interceptor + Clone,
{
/// Get auth params
#[grpc_method(AuthQueryClient::params)]
async fn get_auth_params(&mut self) -> Result<AuthParams, Error>;
}
```
26 changes: 1 addition & 25 deletions grpc/grpc-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
//! Helper crate for grpc_method macro for creating gRPC methods
//!
//! # Example
//! ```rust,ignore
//! use celestia_proto::cosmos::auth::v1beta1::query_client::QueryClient;
//! # use tonic::service::Interceptor;
//! # use tonic::transport::Channel;
//! #
//! # pub struct GrpcClient<I>
//! # where
//! # I: Interceptor,
//! # {
//! # grpc_channel: Channel,
//! # auth_interceptor: I,
//! # }
//!
//! impl<I> GrpcClient<I>
//! where
//! I: Interceptor + Clone,
//! {
//! /// Get auth params
//! #[grpc_method(AuthQueryClient::params)]
//! async fn get_auth_params(&mut self) -> Result<AuthParams, Error>;
//! }
//! ```
#![doc = include_str!("../README.md")]

extern crate proc_macro;

Expand Down
Loading