Deps: be compatible with ipaddr.3.0.0
This commit is contained in:
parent
b2844ff89f
commit
c574d91928
@ -50,7 +50,7 @@ let () =
|
||||
"The node is configured to listen on a public address (%a), \
|
||||
while only 'private' networks are authorised with `--sandbox`.
|
||||
See `%s run --help` on how to change the listening address."
|
||||
Ipaddr.V6.pp_hum addr Sys.argv.(0)
|
||||
Ipaddr.V6.pp addr Sys.argv.(0)
|
||||
end
|
||||
Data_encoding.(obj1 (req "addr" P2p_addr.encoding))
|
||||
(function Non_private_sandbox addr -> Some addr | _ -> None)
|
||||
|
@ -46,15 +46,15 @@ type port = int
|
||||
let pp ppf addr =
|
||||
match Ipaddr.v4_of_v6 addr with
|
||||
| Some addr ->
|
||||
Format.fprintf ppf "%a" Ipaddr.V4.pp_hum addr
|
||||
Format.fprintf ppf "%a" Ipaddr.V4.pp addr
|
||||
| None ->
|
||||
Format.fprintf ppf "[%a]" Ipaddr.V6.pp_hum addr
|
||||
Format.fprintf ppf "[%a]" Ipaddr.V6.pp addr
|
||||
|
||||
let of_string_opt str =
|
||||
Option.map (Ipaddr.of_string str) ~f:begin function
|
||||
| Ipaddr.V4 addr -> Ipaddr.v6_of_v4 addr
|
||||
| V6 addr -> addr
|
||||
end
|
||||
match Ipaddr.of_string str with
|
||||
| Ok (Ipaddr.V4 addr) -> Some (Ipaddr.v6_of_v4 addr)
|
||||
| Ok (V6 addr) -> Some addr
|
||||
| Error (`Msg _) -> None
|
||||
|
||||
let of_string_exn str =
|
||||
match of_string_opt str with
|
||||
|
@ -36,9 +36,9 @@ module Id = struct
|
||||
let pp ppf (addr, port) =
|
||||
match port with
|
||||
| None ->
|
||||
Format.fprintf ppf "[%a]:??" Ipaddr.V6.pp_hum addr
|
||||
Format.fprintf ppf "[%a]:??" Ipaddr.V6.pp addr
|
||||
| Some port ->
|
||||
Format.fprintf ppf "[%a]:%d" Ipaddr.V6.pp_hum addr port
|
||||
Format.fprintf ppf "[%a]:%d" Ipaddr.V6.pp addr port
|
||||
let pp_opt ppf = function
|
||||
| None -> Format.pp_print_string ppf "none"
|
||||
| Some point -> pp ppf point
|
||||
|
@ -36,9 +36,9 @@ module Id = struct
|
||||
let pp ppf (addr, port) =
|
||||
match Ipaddr.v4_of_v6 addr with
|
||||
| Some addr ->
|
||||
Format.fprintf ppf "%a:%d" Ipaddr.V4.pp_hum addr port
|
||||
Format.fprintf ppf "%a:%d" Ipaddr.V4.pp addr port
|
||||
| None ->
|
||||
Format.fprintf ppf "[%a]:%d" Ipaddr.V6.pp_hum addr port
|
||||
Format.fprintf ppf "[%a]:%d" Ipaddr.V6.pp addr port
|
||||
let pp_opt ppf = function
|
||||
| None -> Format.pp_print_string ppf "none"
|
||||
| Some point -> pp ppf point
|
||||
|
@ -16,7 +16,7 @@ depends: [
|
||||
"tezos-rpc"
|
||||
"calendar"
|
||||
"ezjsonm" { >= "0.5.0" }
|
||||
"ipaddr"
|
||||
"ipaddr" { >= "3.0.0" }
|
||||
"mtime" { >= "1.0.0" }
|
||||
"re" { >= "1.7.2" }
|
||||
]
|
||||
|
@ -111,7 +111,7 @@ module PatriciaTree(V:HashPtree.Value) = struct
|
||||
let lst = fold (fun p _ l -> p :: l) t [] in
|
||||
Format.fprintf ppf "@[<2>[%a]@]"
|
||||
Format.(pp_print_list ~pp_sep:(fun ppf () -> fprintf ppf ";@ ")
|
||||
Ipaddr.V6.Prefix.pp_hum)
|
||||
Ipaddr.V6.Prefix.pp)
|
||||
lst
|
||||
|
||||
end
|
||||
|
@ -110,12 +110,12 @@ let test_fold _ =
|
||||
|
||||
let print_pset ppf pset =
|
||||
PSet.iter (fun p ->
|
||||
Format.fprintf ppf "%a " Ipaddr.V6.Prefix.pp_hum p
|
||||
Format.fprintf ppf "%a " Ipaddr.V6.Prefix.pp p
|
||||
) pset
|
||||
|
||||
let print_list ppf l =
|
||||
List.iter (fun p ->
|
||||
Format.fprintf ppf "%a " Ipaddr.V6.Prefix.pp_hum p
|
||||
Format.fprintf ppf "%a " Ipaddr.V6.Prefix.pp p
|
||||
) l
|
||||
|
||||
let test_to_list _ =
|
||||
|
@ -285,8 +285,8 @@ module Socket = struct
|
||||
let handle_litteral_ipv6 host =
|
||||
(* To strip '[' and ']' when a litteral IPv6 is provided *)
|
||||
match Ipaddr.of_string host with
|
||||
| None -> host
|
||||
| Some ipaddr -> Ipaddr.to_string ipaddr
|
||||
| Error (`Msg _) -> host
|
||||
| Ok ipaddr -> Ipaddr.to_string ipaddr
|
||||
|
||||
let connect = function
|
||||
| Unix path ->
|
||||
|
@ -11,7 +11,7 @@ depends: [
|
||||
"tezos-base"
|
||||
"lwt" { >= "3.0.0" }
|
||||
"conf-libev"
|
||||
"ipaddr"
|
||||
"ipaddr" { >= "3.0.0" }
|
||||
]
|
||||
build: [
|
||||
[ "dune" "build" "-p" name "-j" jobs ]
|
||||
|
Loading…
Reference in New Issue
Block a user