X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Futil%2Fser.rs;h=1b10a393090e43ebda7e85a8478c8176401328e5;hb=b031bdf9d835a2410efc6c4b9ffd515689987b55;hp=84cfa8d1633f98e78a996792d53c146d981be61a;hpb=8cc3be9eab9ff322d543e989f28c775a69d6b78f;p=rust-lightning diff --git a/src/util/ser.rs b/src/util/ser.rs index 84cfa8d1..1b10a393 100644 --- a/src/util/ser.rs +++ b/src/util/ser.rs @@ -6,12 +6,13 @@ use std::io::{Read, Write}; use std::collections::HashMap; use std::hash::Hash; -use secp256k1::{Secp256k1, Signature}; +use secp256k1::Signature; use secp256k1::key::{PublicKey, SecretKey}; -use bitcoin::util::hash::Sha256dHash; use bitcoin::blockdata::script::Script; +use bitcoin_hashes::sha256d::Hash as Sha256dHash; use std::marker::Sized; use ln::msgs::DecodeError; +use ln::channelmanager::{PaymentPreimage, PaymentHash}; use util::byte_utils; use util::byte_utils::{be64_to_array, be48_to_array, be32_to_array, be16_to_array, slice_to_be16, slice_to_be32, slice_to_be48, slice_to_be64}; @@ -202,6 +203,10 @@ macro_rules! impl_array { } //TODO: performance issue with [u8; size] with impl_array!() +impl_array!(3); // for rgb +impl_array!(4); // for IPv4 +impl_array!(10); // for OnionV2 +impl_array!(16); // for IPv6 impl_array!(32); // for channel id & hmac impl_array!(33); // for PublicKey impl_array!(64); // for Signature @@ -301,29 +306,6 @@ impl Readable for Script { } } -impl Writeable for Option