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