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

chore: JSON-RPC 2.0 spelling #1146

Merged
merged 1 commit into from
Aug 14, 2024
Merged
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
2 changes: 1 addition & 1 deletion crates/json-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "alloy-json-rpc"
description = "Core types for JSON-RPC2.0 clients"
description = "Core types for JSON-RPC 2.0 clients"

version.workspace = true
edition.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/json-rpc/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# alloy-json-rpc

Core types for JSON-RPC2.0 clients.
Core types for JSON-RPC 2.0 clients.

This crate includes data types and traits for JSON-RPC2.0 requests and
This crate includes data types and traits for JSON-RPC 2.0 requests and
responses, targeted at RPC client usage.

### Core Model

<!-- TODO: More links and real doctests -->

A JSON-RPC2.0 request is a JSON object containing an ID, a method name, and
A JSON-RPC 2.0 request is a JSON object containing an ID, a method name, and
an arbitrary parameters object. The parameters object may be omitted if empty.

Any object that may be Serialized and Cloned may be used as RPC Parameters.
Expand Down
4 changes: 2 additions & 2 deletions crates/json-rpc/src/response/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use serde::{
use serde_json::{value::RawValue, Value};
use std::{borrow::Borrow, fmt, marker::PhantomData};

/// A JSONRPC-2.0 error object.
/// A JSON-RPC 2.0 error object.
///
/// This response indicates that the server received and handled the request,
/// but that there was an error in the processing of it. The error should be
Expand Down Expand Up @@ -165,7 +165,7 @@ impl<'de, ErrData: Deserialize<'de>> Deserialize<'de> for ErrorPayload<ErrData>
type Value = ErrorPayload<Data>;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "a JSON-RPC2.0 error object")
write!(formatter, "a JSON-RPC 2.0 error object")
}

fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
Expand Down
4 changes: 2 additions & 2 deletions crates/json-rpc/src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ pub use error::{BorrowedErrorPayload, ErrorPayload};
mod payload;
pub use payload::{BorrowedResponsePayload, ResponsePayload};

/// A JSONRPC-2.0 response object containing a [`ResponsePayload`].
/// A JSON-RPC 2.0 response object containing a [`ResponsePayload`].
///
/// This object is used to represent a JSONRPC-2.0 response. It may contain
/// This object is used to represent a JSON-RPC 2.0 response. It may contain
/// either a successful result or an error. The `id` field is used to match
/// the response to the request that it is responding to, and should be
/// mirrored from the response.
Expand Down
4 changes: 2 additions & 2 deletions crates/json-rpc/src/response/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use serde::{de::DeserializeOwned, Deserialize};
use serde_json::value::RawValue;
use std::borrow::Borrow;

/// A JSONRPC-2.0 response payload.
/// A JSON-RPC 2.0 response payload.
///
/// This enum covers both the success and error cases of a JSONRPC-2.0
/// This enum covers both the success and error cases of a JSON-RPC 2.0
/// response. It is used to represent the `result` and `error` fields of a
/// response object.
///
Expand Down