Skip to content
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
15 changes: 14 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
Expand All @@ -31,7 +32,19 @@ jobs:
- name: Run cargo build
run: |
cargo build


- name: Run cargo clippy
run: |
cargo clippy --all-targets --all-features --workspace -- -D warnings

- name: Run cargo fmt
run: |
cargo fmt --all -- --check

- name: Run cargo test
run: |
cargo test

docker-build:
name: Build Docker image
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions crates/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ where
{
match res {
Ok(result) => Json(
serde_json::to_value(&RpcSuccessResponse {
serde_json::to_value(RpcSuccessResponse {
id: req.id,
jsonrpc: "2.0".to_string(),
result: result,
result,
})
.unwrap(),
),
Err(error) => Json(
serde_json::to_value(&RpcErrorResponse {
serde_json::to_value(RpcErrorResponse {
id: req.id,
jsonrpc: "2.0".to_string(),
error: error.into(),
Expand Down
6 changes: 3 additions & 3 deletions crates/rpc/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ pub enum RpcErr {
MethodNotFound,
}

impl Into<RpcErrorMetadata> for RpcErr {
fn into(self) -> RpcErrorMetadata {
match self {
impl From<RpcErr> for RpcErrorMetadata {
fn from(value: RpcErr) -> Self {
match value {
RpcErr::MethodNotFound => RpcErrorMetadata {
code: -32601,
message: "Method not found".to_string(),
Expand Down