Skip to content

Commit

Permalink
Merge pull request #3294 from oasisprotocol/ptrus/feature/bump-serde
Browse files Browse the repository at this point in the history
rust: bump serde crates
  • Loading branch information
ptrus authored Sep 21, 2020
2 parents f19387e + 70bdca0 commit 81a4143
Show file tree
Hide file tree
Showing 40 changed files with 61 additions and 68 deletions.
7 changes: 7 additions & 0 deletions .changelog/3294.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rust: Bump serde crates

- `[email protected]` -> `[email protected]`

- `[email protected]` -> `[email protected]`

- `[email protected]` -> `[email protected]`
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ updates:
# version, remove it from the ignore list.
- dependency-name: futures
- dependency-name: grpcio
# Wait with update until https://github.com/Amanieu/intrusive-rs/pull/51
# is merged and released, so we can continue using `intrusive_adapter!`
# macro in`lru_cache.rs`.
- dependency-name: intrusive-collections
- dependency-name: serde
- dependency-name: serde_bytes
- dependency-name: serde_cbor
22 changes: 10 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ edition = "2018"

[dependencies]
oasis-core-runtime = { path = "../runtime" }
serde = "1.0.71"
serde_bytes = "~0.10"
serde_derive = "1.0"
serde_cbor = "0.10.2"
serde = { version = "1.0.116", features = ["derive"] }
serde_bytes = "0.11.5"
serde_cbor = "0.11.1"
anyhow = "1.0"
thiserror = "1.0"
futures = "0.1.25"
Expand Down
2 changes: 1 addition & 1 deletion client/src/enclave_rpc/api/enclaverpc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Client for service defined in go/runtime/enclaverpc/api.
use grpcio::{CallOption, Channel, Client, ClientUnaryReceiver, Result};
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;
use serde_derive::{Deserialize, Serialize};

use oasis_core_runtime::common::runtime::RuntimeId;

Expand Down
2 changes: 1 addition & 1 deletion client/src/enclave_rpc/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Transport for GrpcTransport {
};

match self.grpc_client.call_enclave(&req, Default::default()) {
Ok(rsp) => Box::new(rsp.map(|r| r.into()).map_err(|error| error.into())),
Ok(rsp) => Box::new(rsp.map(|r| r.into_vec()).map_err(|error| error.into())),
Err(error) => Box::new(future::err(error.into())),
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/transaction/api/client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Client for service defined in go/runtime/client/api.
use grpcio::{CallOption, Channel, Client, ClientSStreamReceiver, ClientUnaryReceiver, Result};
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;
use serde_derive::{Deserialize, Serialize};

use oasis_core_runtime::{
common::{
Expand Down
2 changes: 1 addition & 1 deletion client/src/transaction/api/storage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Client for service defined in go/storage/api.
use grpcio::{CallOption, Channel, Client, Result};
use serde::{Deserialize, Serialize};
use serde_cbor::value::Value;
use serde_derive::{Deserialize, Serialize};

use oasis_core_runtime::{
common::{crypto::hash::Hash, roothash::Namespace},
Expand Down
2 changes: 1 addition & 1 deletion client/src/transaction/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl TxnClient {
Ok(resp) => Box::new(
resp.map(|r| {
drop(span);
r.into()
r.into_vec()
})
.map_err(|error| TxnClientError::CallFailed(format!("{}", error)).into()),
),
Expand Down
5 changes: 2 additions & 3 deletions keymanager-api-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ edition = "2018"
oasis-core-runtime = { path = "../runtime" }

base64 = "0.12.3"
serde = "1.0.71"
serde_derive = "1.0"
serde_bytes = "~0.10"
serde = { version = "1.0.116", features = ["derive"] }
serde_bytes = "0.11.5"
rustc-hex = "2.0.1"
anyhow = "1.0"
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion keymanager-api-common/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use base64;
use rand::{rngs::OsRng, Rng};
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use x25519_dalek;

Expand Down
7 changes: 3 additions & 4 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ slog = "2.4.1"
slog-json = "2.3.0"
slog-scope = "4.1.1"
slog-stdlog = "4.0.0"
serde = "1.0.71"
serde_derive = "1.0"
serde_cbor = "0.10.2"
serde = { version = "1.0.116", features = ["derive"] }
serde_cbor = "0.11.1"
serde_json = "1.0.39"
serde_bytes = "~0.10"
serde_bytes = "0.11.5"
serde_repr = "0.1.5"
lazy_static = "1.3.0"
crossbeam = "0.7.1"
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/common/crypto/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use anyhow::Result;
use byteorder::{LittleEndian, ReadBytesExt};
use ed25519_dalek::{self, ed25519::signature::Signature as _, Signer as _, Verifier};
use rand::rngs::OsRng;
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use thiserror::Error;
use zeroize::Zeroize;

Expand Down
2 changes: 1 addition & 1 deletion runtime/src/common/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{
super::storage::mkvs::WriteLog,
crypto::{hash, signature::SignatureBundle},
};
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};

/// Runtime genesis information that is used to initialize runtime state in the first block.
#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/common/roothash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! This **MUST** be kept in sync with go/roothash/api/block.
//!
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use serde_repr::*;

use super::{
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/common/sgx/avr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use byteorder::{LittleEndian, ReadBytesExt};
use chrono::prelude::*;
use pem::parse_many;
use percent_encoding;
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use serde_json;
use sgx_isa::{AttributesFlags, Report};
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/enclave_rpc/demux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Demux {
let id = frame.session.clone();
let untrusted_plaintext = frame.untrusted_plaintext.clone();

if let Some(enriched_session) = self.sessions.get_mut(&id) {
if let Some(enriched_session) = self.sessions.get_mut(&id.into()) {
match enriched_session
.session
.process_data(frame.payload, writer)
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/enclave_rpc/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::{collections::HashSet, io::Write, mem, sync::Arc};

use anyhow::Result;
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use snow;
use thiserror::Error;

Expand Down
3 changes: 1 addition & 2 deletions runtime/src/enclave_rpc/types.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! RPC protocol types.
use rand::{rngs::OsRng, Rng};
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};

use crate::common::cbor::Value;

Expand All @@ -25,7 +25,6 @@ impl SessionID {
/// Frame.
#[derive(Debug, Serialize, Deserialize)]
pub struct Frame {
#[serde(with = "serde_bytes")]
pub session: SessionID,
// The `untrusted_plaintext` field is only a temporary workaround until
// the snow library supports encrypting the payload with authenticated
Expand Down
1 change: 0 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ extern crate crossbeam;
extern crate lazy_static;
extern crate serde_bytes;
extern crate serde_cbor;
extern crate serde_derive;
extern crate serde_json;
extern crate serde_repr;
extern crate slog_json;
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/storage/mkvs/interop/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use grpcio::{CallOption, Channel, Client, Error, Marshaller, Method, MethodType, Result};
use serde::{de::DeserializeOwned, Serialize};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_cbor::Value;
use serde_derive::{Deserialize, Serialize};

use crate::{
common::{cbor, crypto::hash::Hash, roothash::Namespace},
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/storage/mkvs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use std::ops::{Deref, DerefMut};
use anyhow::Result;
use base64;
use io_context::Context;
use serde::{self, ser::SerializeSeq, Serializer};
use serde::{self, ser::SerializeSeq, Deserialize, Serialize, Serializer};
use serde_bytes::Bytes;
use serde_derive::{Deserialize, Serialize};

use crate::common::{crypto::hash::Hash, roothash::Namespace};

Expand Down
2 changes: 1 addition & 1 deletion runtime/src/storage/mkvs/sync/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::ops::{Deref, DerefMut};
use anyhow::{anyhow, Result};
use arbitrary::Arbitrary;
use io_context::Context;
use serde::{Deserialize, Serialize};
use serde_bytes;
use serde_derive::{Deserialize, Serialize};

use crate::{
common::crypto::hash::Hash,
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/storage/mkvs/sync/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::any::Any;

use anyhow::Result;
use io_context::Context;
use serde::{Deserialize, Serialize};
use serde_bytes;
use serde_derive::{Deserialize, Serialize};

use crate::{
common::crypto::hash::Hash,
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/storage/mkvs/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
use std::fmt;

use base64;
use serde;
use serde_derive::Deserialize;
use serde::{self, Deserialize};

/// Tree operation kind.
#[derive(Clone, Debug, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/storage/mkvs/tree/node.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cell::RefCell, rc::Rc};

use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};

use crate::{
common::{crypto::hash::Hash, roothash::Namespace},
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/transaction/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ impl Dispatcher for MethodDispatcher {
#[cfg(test)]
mod tests {
use io_context::Context as IoContext;
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};

use crate::common::{cbor, roothash::Header};

Expand Down
2 changes: 1 addition & 1 deletion runtime/src/transaction/rwset.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Read/write set.
use serde::{Deserialize, Serialize};
use serde_bytes;
use serde_derive::{Deserialize, Serialize};

/// A coarsened key prefix that represents any key that starts with
/// this prefix.
Expand Down
3 changes: 1 addition & 2 deletions runtime/src/transaction/tree.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! Transaction I/O tree.
use anyhow::{anyhow, Result};
use io_context::Context;
use serde::{self, ser::SerializeSeq, Serializer};
use serde::{self, ser::SerializeSeq, Deserialize, Serializer};
use serde_bytes::{self, Bytes};
use serde_derive::Deserialize;

use super::tags::Tags;
use crate::{
Expand Down
5 changes: 3 additions & 2 deletions runtime/src/transaction/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
ops::{Deref, DerefMut},
};

use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};

use super::rwset::ReadWriteSet;
use crate::common::cbor::Value;
Expand Down Expand Up @@ -58,7 +58,8 @@ mod batch_serialize {
where
D: Deserializer<'de>,
{
Vec::<ByteBuf>::deserialize(deserializer).map(|v| v.into_iter().map(|e| e.into()).collect())
Vec::<ByteBuf>::deserialize(deserializer)
.map(|v| v.into_iter().map(ByteBuf::into_vec).collect())
}
}

Expand Down
3 changes: 1 addition & 2 deletions runtime/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Types used by the worker-host protocol.
use serde::{self, Deserializer, Serializer};
use serde::{self, Deserialize, Deserializer, Serialize, Serializer};
use serde_bytes;
use serde_derive::{Deserialize, Serialize};

use crate::{
common::{
Expand Down
1 change: 1 addition & 0 deletions tests/clients/simple-keyvalue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ grpcio = "0.4.6"
io-context = "0.2.0"
rand = "0.7.3"
tokio = "0.1.17"
serde_bytes = "0.11.5"
Loading

0 comments on commit 81a4143

Please sign in to comment.