diff --git a/Cargo.lock b/Cargo.lock index f0f0acbf..399ccf6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,9 +257,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" [[package]] -name = "embedded-io-cursor" +name = "embedded-io-extras" version = "0.0.1" -source = "git+https://github.com/lightsail-network/embedded-io-cursor?rev=0b7ff9270d7ec1d3204375650f04cb0258ac1ada#0b7ff9270d7ec1d3204375650f04cb0258ac1ada" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c151a27502f81447537f6dd1a11fe1162b66ebd4a27da09003f976de9af41fe" dependencies = [ "embedded-io", ] @@ -553,8 +554,7 @@ dependencies = [ "base64 0.13.0", "clap", "crate-git-revision", - "embedded-io", - "embedded-io-cursor", + "embedded-io-extras", "escape-bytes", "hex", "schemars", diff --git a/Cargo.toml b/Cargo.toml index 04e9d032..8b036c9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" version = "22.0.0" edition = "2021" -rust-version = "1.74.0" +rust-version = "1.81.0" [[bin]] name = "stellar-xdr" @@ -30,9 +30,7 @@ clap = { version = "4.2.4", default-features = false, features = ["std", "derive serde_json = { version = "1.0.89", optional = true } thiserror = { version = "1.0.37", optional = true } schemars = { version = "0.8.16", optional = true } -embedded-io = { version = "0.6.1", default-features = false, optional = true } -embedded-io-cursor = { git = "https://github.com/lightsail-network/embedded-io-cursor", rev = "0b7ff9270d7ec1d3204375650f04cb0258ac1ada", default-features = false, features = ["alloc"], optional = true } -# TODO: embedded-io-cursor not published yet. +embedded-io-extras = { version = "0.0.1", default-features = false, features = ["alloc"], optional = true } [dev-dependencies] serde_json = "1.0.89" @@ -40,7 +38,7 @@ serde_json = "1.0.89" [features] default = ["std", "curr"] std = ["alloc"] -alloc = ["dep:hex", "dep:stellar-strkey", "dep:embedded-io", "dep:embedded-io-cursor", "escape-bytes/alloc", "hex/alloc"] +alloc = ["dep:hex", "dep:stellar-strkey", "dep:embedded-io-extras", "escape-bytes/alloc", "hex/alloc"] curr = [] next = [] diff --git a/Makefile b/Makefile index e84da7be..40467731 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CARGO_HACK_ARGS=--feature-powerset --exclude-features default --group-features b CARGO_DOC_ARGS?=--open # TODO: Update this after https://github.com/stellar/xdrgen/pull/205 is merged -XDRGEN_VERSION=ecf547f1bca98545378e55c7e55aa0ef3cf4e66a +XDRGEN_VERSION=3bac661688af0615a7192271b79ced8cd30e9dd4 # XDRGEN_LOCAL=1 XDRGEN_TYPES_CUSTOM_STR_IMPL_CURR=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12,ClaimableBalanceId XDRGEN_TYPES_CUSTOM_STR_IMPL_NEXT=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId,ScAddress,AssetCode,AssetCode4,AssetCode12,ClaimableBalanceId diff --git a/src/curr/generated.rs b/src/curr/generated.rs index eceae393..6136d639 100644 --- a/src/curr/generated.rs +++ b/src/curr/generated.rs @@ -109,9 +109,7 @@ use std::{ }; #[cfg(all(not(feature = "std"), feature = "alloc"))] -use embedded_io::{Error as _, ErrorType, Read, Write}; -#[cfg(all(not(feature = "std"), feature = "alloc"))] -use embedded_io_cursor::Cursor; +use embedded_io_extras::{Cursor, Error as _, ErrorType, Read, Write}; /// Error contains all errors returned by functions in this crate. It can be /// compared via `PartialEq`, however any contained IO errors will only be @@ -129,7 +127,7 @@ pub enum Error { #[cfg(feature = "std")] Io(io::Error), #[cfg(all(not(feature = "std"), feature = "alloc"))] - Io(embedded_io::ErrorKind), + Io(embedded_io_extras::ErrorKind), DepthLimitExceeded, #[cfg(feature = "serde_json")] Json(serde_json::Error), @@ -154,21 +152,23 @@ impl PartialEq for Error { } #[cfg(all(not(feature = "std"), feature = "alloc"))] -impl embedded_io::Error for Error { - fn kind(&self) -> embedded_io::ErrorKind { +impl embedded_io_extras::Error for Error { + fn kind(&self) -> embedded_io_extras::ErrorKind { match self { Self::Io(e) => *e, - _ => embedded_io::ErrorKind::Other, + _ => embedded_io_extras::ErrorKind::Other, } } } #[cfg(all(not(feature = "std"), feature = "alloc"))] -impl From> for Error { - fn from(value: embedded_io::ReadExactError) -> Self { +impl From> for Error { + fn from(value: embedded_io_extras::ReadExactError) -> Self { match value { - embedded_io::ReadExactError::UnexpectedEof => Error::Io(embedded_io::ErrorKind::Other), - embedded_io::ReadExactError::Other(e) => e, + embedded_io_extras::ReadExactError::UnexpectedEof => { + Error::Io(embedded_io_extras::ErrorKind::Other) + } + embedded_io_extras::ReadExactError::Other(e) => e, } } } diff --git a/src/next/generated.rs b/src/next/generated.rs index 854ebaf4..f226e787 100644 --- a/src/next/generated.rs +++ b/src/next/generated.rs @@ -109,9 +109,7 @@ use std::{ }; #[cfg(all(not(feature = "std"), feature = "alloc"))] -use embedded_io::{Error as _, ErrorType, Read, Write}; -#[cfg(all(not(feature = "std"), feature = "alloc"))] -use embedded_io_cursor::Cursor; +use embedded_io_extras::{Cursor, Error as _, ErrorType, Read, Write}; /// Error contains all errors returned by functions in this crate. It can be /// compared via `PartialEq`, however any contained IO errors will only be @@ -129,7 +127,7 @@ pub enum Error { #[cfg(feature = "std")] Io(io::Error), #[cfg(all(not(feature = "std"), feature = "alloc"))] - Io(embedded_io::ErrorKind), + Io(embedded_io_extras::ErrorKind), DepthLimitExceeded, #[cfg(feature = "serde_json")] Json(serde_json::Error), @@ -154,21 +152,23 @@ impl PartialEq for Error { } #[cfg(all(not(feature = "std"), feature = "alloc"))] -impl embedded_io::Error for Error { - fn kind(&self) -> embedded_io::ErrorKind { +impl embedded_io_extras::Error for Error { + fn kind(&self) -> embedded_io_extras::ErrorKind { match self { Self::Io(e) => *e, - _ => embedded_io::ErrorKind::Other, + _ => embedded_io_extras::ErrorKind::Other, } } } #[cfg(all(not(feature = "std"), feature = "alloc"))] -impl From> for Error { - fn from(value: embedded_io::ReadExactError) -> Self { +impl From> for Error { + fn from(value: embedded_io_extras::ReadExactError) -> Self { match value { - embedded_io::ReadExactError::UnexpectedEof => Error::Io(embedded_io::ErrorKind::Other), - embedded_io::ReadExactError::Other(e) => e, + embedded_io_extras::ReadExactError::UnexpectedEof => { + Error::Io(embedded_io_extras::ErrorKind::Other) + } + embedded_io_extras::ReadExactError::Other(e) => e, } } }