Skip to content

Commit

Permalink
Update serde versions
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Dec 1, 2021
1 parent 65553c5 commit 10f0989
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ version = "1"
version = "0.27"

[dependencies.serde]
version = "1.0.130"
version = "1"

[dependencies.serde_json]
version = "1.0.72"
version = "1"
features = [ "arbitrary_precision" ]

[dependencies.structopt]
Expand Down
40 changes: 16 additions & 24 deletions src/rpc/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
use crate::{
helpers::Status,
rpc::{rpc_impl::RpcImpl, rpc_trait::RpcFunctions},
Environment,
LedgerReader,
Peers,
ProverRouter,
Environment, LedgerReader, Peers, ProverRouter,
};
use snarkvm::dpc::Network;

Expand All @@ -35,7 +32,7 @@ use hyper::{
use json_rpc_types as jrt;
use jsonrpc_core::{Metadata, Params};
use serde::{Deserialize, Serialize};
use std::{convert::Infallible, net::SocketAddr, str::FromStr, sync::Arc};
use std::{convert::Infallible, net::SocketAddr, sync::Arc};
use tokio::sync::oneshot;

/// Defines the authentication format for accessing private endpoints on the RPC server.
Expand Down Expand Up @@ -409,8 +406,7 @@ fn result_to_response<T: Serialize>(
) -> jrt::Response<serde_json::Value, String> {
match result {
Ok(res) => {
let candidate_string = serde_json::to_string(&res).unwrap_or_default();
let result = serde_json::Value::from_str(&candidate_string).unwrap_or_default();
let result = serde_json::to_value(&res).unwrap_or_default();

jrt::Response::result(jrt::Version::V2, result, request.id.clone())
}
Expand Down Expand Up @@ -968,14 +964,12 @@ mod tests {
let actual: <Testnet2 as Network>::RecordCiphertext = process_response(response).await;

// Check the ciphertext.
assert!(
Testnet2::genesis_block()
.transactions()
.first()
.unwrap()
.ciphertexts()
.any(|expected| *expected == actual)
);
assert!(Testnet2::genesis_block()
.transactions()
.first()
.unwrap()
.ciphertexts()
.any(|expected| *expected == actual));
}

#[tokio::test]
Expand Down Expand Up @@ -1163,15 +1157,13 @@ mod tests {
let actual: Transition<Testnet2> = process_response(response).await;

// Check the transition.
assert!(
Testnet2::genesis_block()
.transactions()
.first()
.unwrap()
.transitions()
.iter()
.any(|expected| *expected == actual)
);
assert!(Testnet2::genesis_block()
.transactions()
.first()
.unwrap()
.transitions()
.iter()
.any(|expected| *expected == actual));
}

#[tokio::test]
Expand Down
4 changes: 2 additions & 2 deletions storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ version = "0.17"
optional = true

[dependencies.serde]
version = "1.0.130"
version = "1"

[dependencies.serde_json]
version = "1.0.72"
version = "1"

[dependencies.tracing]
version = "0.1"
Expand Down

0 comments on commit 10f0989

Please sign in to comment.