Use &[u8] instead of Cursor as Read
This commit is contained in:
parent
81ca10701a
commit
1a409ecc8e
|
@ -54,7 +54,7 @@ macro_rules! impl_psbtmap_deserialize {
|
||||||
($thing:ty) => {
|
($thing:ty) => {
|
||||||
impl $crate::psbt::serialize::Deserialize for $thing {
|
impl $crate::psbt::serialize::Deserialize for $thing {
|
||||||
fn deserialize(bytes: &[u8]) -> Result<Self, $crate::consensus::encode::Error> {
|
fn deserialize(bytes: &[u8]) -> Result<Self, $crate::consensus::encode::Error> {
|
||||||
let mut decoder = crate::io::Cursor::new(bytes);
|
let mut decoder = bytes;
|
||||||
Self::decode(&mut decoder)
|
Self::decode(&mut decoder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ use crate::prelude::*;
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
|
|
||||||
use crate::io::{self, Cursor};
|
use crate::io;
|
||||||
use crate::consensus::encode::{self, ReadExt, WriteExt, Decodable, Encodable, VarInt, serialize, deserialize, MAX_VEC_SIZE};
|
use crate::consensus::encode::{self, ReadExt, WriteExt, Decodable, Encodable, VarInt, serialize, deserialize, MAX_VEC_SIZE};
|
||||||
use crate::psbt::Error;
|
use crate::psbt::Error;
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ impl Serialize for Pair {
|
||||||
|
|
||||||
impl Deserialize for Pair {
|
impl Deserialize for Pair {
|
||||||
fn deserialize(bytes: &[u8]) -> Result<Self, encode::Error> {
|
fn deserialize(bytes: &[u8]) -> Result<Self, encode::Error> {
|
||||||
let mut decoder = Cursor::new(bytes);
|
let mut decoder = bytes;
|
||||||
Pair::decode(&mut decoder)
|
Pair::decode(&mut decoder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue