#[cfg_attr(test, derive(PartialEq))]
#[derive(Debug)]
- pub(super) struct $nameref<'a> {
+ pub(crate) struct $nameref<'a> {
$(
pub(super) $field: Option<tlv_record_ref_type!($fieldty)>,
)*
$($variant_id => {
// Because read_tlv_fields creates a labeled loop, we cannot call it twice
// in the same function body. Instead, we define a closure and call it.
- let f = || {
+ let mut f = || {
$crate::_init_and_read_len_prefixed_tlv_fields!(reader, {
$(($type, $field, $fieldty)),*
});
$($variant_id => {
// Because read_tlv_fields creates a labeled loop, we cannot call it twice
// in the same function body. Instead, we define a closure and call it.
- let f = || {
+ let mut f = || {
$crate::_init_and_read_len_prefixed_tlv_fields!(reader, {
$(($type, $field, $fieldty)),*
});
#[cfg(test)]
mod tests {
- use crate::io::{self, Cursor};
+ #[allow(unused_imports)]
use crate::prelude::*;
+
+ use crate::io::{self, Cursor};
use crate::ln::msgs::DecodeError;
use crate::util::ser::{Writeable, HighZeroBytesDroppedBigSize, VecWriter};
use bitcoin::hashes::hex::FromHex;