Skip to content

Commit 4ada4f6

Browse files
committed
fix cli test
1 parent 1d133c2 commit 4ada4f6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lightning/src/ln/msgs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use core::convert::TryInto;
4040
use core::fmt;
4141
use core::fmt::Debug;
4242
use core::str::FromStr;
43-
use std::net::{AddrParseError, Ipv4Addr, Ipv6Addr, SocketAddr};
4443
use crate::io::{self, Read};
4544
use crate::io_extras::read_to_end;
4645

@@ -895,19 +894,20 @@ impl Readable for NetAddress {
895894
}
896895
}
897896

897+
#[cfg(feature = "std")]
898898
impl FromStr for NetAddress {
899-
type Err = AddrParseError;
899+
type Err = std::net::AddrParseError;
900900

901901
fn from_str(s: &str) -> Result<Self, Self::Err> {
902-
match SocketAddr::from_str(s) {
902+
match std::net::SocketAddr::from_str(s) {
903903
Ok(addr) => {
904904
let port: u16 = addr.port();
905905
match addr {
906-
SocketAddr::V4(addr) => {
906+
std::net::SocketAddr::V4(addr) => {
907907
let addr = addr.ip().octets();
908908
return Ok(NetAddress::IPv4 { addr, port });
909909
},
910-
SocketAddr::V6(addr) => {
910+
std::net::SocketAddr::V6(addr) => {
911911
let addr = addr.ip().octets();
912912
return Ok(NetAddress::IPv6 { addr, port });
913913
},
@@ -2472,7 +2472,7 @@ impl_writeable_msg!(GossipTimestampFilter, {
24722472
timestamp_range,
24732473
}, {});
24742474

2475-
#[cfg(test)]
2475+
#[cfg(all(test, not(feature = "no-std")))]
24762476
mod tests {
24772477
use bitcoin::{Transaction, PackedLockTime, TxIn, Script, Sequence, Witness, TxOut};
24782478
use hex;

lightning/src/util/base32.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
// SOFTWARE.
2121
// (reference https://github.com/andreasots/base32/blob/master/LICENSE-MIT)
2222

23+
use crate::prelude::*;
24+
2325
/// Alphabet used for encoding and decoding.
2426
#[derive(Copy, Clone)]
2527
pub enum Alphabet {

0 commit comments

Comments
 (0)