Skip to content

Commit

Permalink
chore(rpc): no_std support op-alloy-rpc-jsonrpsee (#356)
Browse files Browse the repository at this point in the history
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.

Bug fixes and new features should include tests.

Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md

The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->

<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->

## Motivation

Closes #355

## Solution

Adds `no_std` support `op-alloy-rpc-jsonrpsee`, and removes exclusion
from CI wasm check

## PR Checklist

- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
  • Loading branch information
emhane authored Jan 3, 2025
1 parent c7c417f commit 586115d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
cache-on-failure: true
- name: cargo hack
run: |
cargo hack build --workspace --target wasm32-wasi --exclude op-alloy-network --exclude op-alloy-rpc-types --exclude op-alloy-rpc-jsonrpsee --exclude op-alloy-provider
cargo hack build --workspace --target wasm32-wasi --exclude op-alloy-network --exclude op-alloy-rpc-types --exclude op-alloy-provider
no-std:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions crates/rpc-jsonrpsee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ alloy-primitives.workspace = true
jsonrpsee.workspace = true

[features]
default = ["std"]
std = [
"op-alloy-rpc-types/std",
"op-alloy-rpc-types-engine/std",
"alloy-eips/std",
"alloy-primitives/std",
]
client = [
"jsonrpsee/client",
"jsonrpsee/async-client",
Expand Down
3 changes: 3 additions & 0 deletions crates/rpc-jsonrpsee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]

extern crate alloc;

pub mod traits;
4 changes: 3 additions & 1 deletion crates/rpc-jsonrpsee/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

//! Rollup Node
use alloc::{boxed::Box, string::String, vec::Vec};
use core::net::IpAddr;

use alloy_eips::BlockNumberOrTag;
use alloy_primitives::{B256, U64};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use op_alloy_rpc_types::{
OutputResponse, PeerDump, PeerInfo, PeerStats, RollupConfig, SafeHeadResponse, SyncStatus,
};
use op_alloy_rpc_types_engine::{ProtocolVersion, SuperchainSignal};
use std::net::IpAddr;

/// Optimism specified rpc interface.
///
Expand Down

0 comments on commit 586115d

Please sign in to comment.