projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tag `KVStore` `(C-not exported)` as `Writeable` isn't mapped
[rust-lightning]
/
lightning
/
src
/
util
/
ser.rs
diff --git
a/lightning/src/util/ser.rs
b/lightning/src/util/ser.rs
index 366e6c8cb1efaef3767b0e8d4232c3763915eb20..77ee33c4fa099de78ef6bac9f7c1cfd210586f73 100644
(file)
--- a/
lightning/src/util/ser.rs
+++ b/
lightning/src/util/ser.rs
@@
-596,7
+596,7
@@
impl Readable for [u16; 8] {
r.read_exact(&mut buf)?;
let mut res = [0u16; 8];
for (idx, v) in res.iter_mut().enumerate() {
r.read_exact(&mut buf)?;
let mut res = [0u16; 8];
for (idx, v) in res.iter_mut().enumerate() {
- *v = (buf[idx
] as u16) << 8 | (buf[idx
+ 1] as u16)
+ *v = (buf[idx
*2] as u16) << 8 | (buf[idx*2
+ 1] as u16)
}
Ok(res)
}
}
Ok(res)
}
@@
-749,7
+749,7
@@
where T: Readable + Eq + Hash
}
// Vectors
}
// Vectors
-macro_rules! impl_for_vec {
+macro_rules! impl_
writeable_
for_vec {
($ty: ty $(, $name: ident)*) => {
impl<$($name : Writeable),*> Writeable for Vec<$ty> {
#[inline]
($ty: ty $(, $name: ident)*) => {
impl<$($name : Writeable),*> Writeable for Vec<$ty> {
#[inline]
@@
-761,7
+761,10
@@
macro_rules! impl_for_vec {
Ok(())
}
}
Ok(())
}
}
-
+ }
+}
+macro_rules! impl_readable_for_vec {
+ ($ty: ty $(, $name: ident)*) => {
impl<$($name : Readable),*> Readable for Vec<$ty> {
#[inline]
fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
impl<$($name : Readable),*> Readable for Vec<$ty> {
#[inline]
fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
@@
-777,6
+780,12
@@
macro_rules! impl_for_vec {
}
}
}
}
}
}
+macro_rules! impl_for_vec {
+ ($ty: ty $(, $name: ident)*) => {
+ impl_writeable_for_vec!($ty $(, $name)*);
+ impl_readable_for_vec!($ty $(, $name)*);
+ }
+}
impl Writeable for Vec<u8> {
#[inline]
impl Writeable for Vec<u8> {
#[inline]
@@
-805,6
+814,8
@@
impl Readable for Vec<u8> {
impl_for_vec!(ecdsa::Signature);
impl_for_vec!(crate::ln::channelmanager::MonitorUpdateCompletionAction);
impl_for_vec!((A, B), A, B);
impl_for_vec!(ecdsa::Signature);
impl_for_vec!(crate::ln::channelmanager::MonitorUpdateCompletionAction);
impl_for_vec!((A, B), A, B);
+impl_writeable_for_vec!(&crate::routing::router::BlindedTail);
+impl_readable_for_vec!(crate::routing::router::BlindedTail);
impl Writeable for Script {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
impl Writeable for Script {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {