use ln::features::{ChannelFeatures, InitFeatures, NodeFeatures};
+use prelude::*;
use core::{cmp, fmt};
use core::fmt::Debug;
use std::io::Read;
}
mod fuzzy_internal_msgs {
+ use prelude::*;
use ln::PaymentSecret;
// These types aren't intended to be pub, but are exposed for direct fuzzing (as we deserialize
(2, HighZeroBytesDroppedVarInt(self.amt_to_forward)),
(4, HighZeroBytesDroppedVarInt(self.outgoing_cltv_value)),
(6, short_channel_id)
- });
+ }, { });
},
- OnionHopDataFormat::FinalNode { payment_data: Some(ref final_data) } => {
- if final_data.total_msat > MAX_VALUE_MSAT { panic!("We should never be sending infinite/overflow onion payments"); }
- encode_varint_length_prefixed_tlv!(w, {
- (2, HighZeroBytesDroppedVarInt(self.amt_to_forward)),
- (4, HighZeroBytesDroppedVarInt(self.outgoing_cltv_value)),
- (8, final_data)
- });
- },
- OnionHopDataFormat::FinalNode { payment_data: None } => {
+ OnionHopDataFormat::FinalNode { ref payment_data } => {
+ if let Some(final_data) = payment_data {
+ if final_data.total_msat > MAX_VALUE_MSAT { panic!("We should never be sending infinite/overflow onion payments"); }
+ }
encode_varint_length_prefixed_tlv!(w, {
(2, HighZeroBytesDroppedVarInt(self.amt_to_forward)),
(4, HighZeroBytesDroppedVarInt(self.outgoing_cltv_value))
+ }, {
+ (8, payment_data)
});
},
}
use bitcoin::secp256k1::key::{PublicKey,SecretKey};
use bitcoin::secp256k1::{Secp256k1, Message};
+ use prelude::*;
use std::io::Cursor;
#[test]