diff --git a/tezt/tests/cloud/dal.ml b/tezt/tests/cloud/dal.ml index b216d705908e3795f694a00a57eebce921dde786..d83bce9d09f505003d0a7be085437ba7195c154a 100644 --- a/tezt/tests/cloud/dal.ml +++ b/tezt/tests/cloud/dal.ml @@ -126,9 +126,9 @@ module Node = struct ~name network cloud agent = toplog "Inititializing an L1 node for %s" name ; match network with - | (`Mainnet | `Ghostnet | `Nextnet _ | `Weeklynet _ | `Rionet) as network - -> ( - (* For public networks deployments, we listen on all interfaces on both + | #Network.public -> ( + let network = Network.to_public network in + (* for public networks deployments, we listen on all interfaces on both ipv4 and ipv6 *) let net_addr = "[::]" in match data_dir with @@ -239,7 +239,7 @@ module Node = struct let* () = Node.wait_for_synchronisation ~statuses:["synced"] node in toplog "Node is bootstrapped" ; Lwt.return node) - | `Sandbox -> ( + | _ (* private network *) -> ( (* For sandbox deployments, we only listen on local interface, hence no connection could be made to us from outside networks *) let net_addr = "127.0.0.1" in @@ -3200,7 +3200,7 @@ let obtain_some_node_rpc_endpoint agent network (bootstrap : bootstrap) (bakers : baker list) (producers : producer list) (observers : observer list) etherlink = match (agent, network) with - | None, (`Mainnet | `Ghostnet | `Nextnet _ | `Weeklynet _) -> ( + | None, #Network.public -> ( match (bakers, producers, observers, etherlink) with | baker :: _, _, _, _ -> Node.as_rpc_endpoint baker.node | [], producer :: _, _, _ -> Node.as_rpc_endpoint producer.node @@ -3276,7 +3276,8 @@ let init ~(configuration : configuration) etherlink_configuration cloud configuration ?etherlink_configuration bootstrap_agent - | (`Ghostnet | `Nextnet _ | `Mainnet | `Weeklynet _ | `Rionet) as network -> + | #Network.public -> + let network = Network.to_public configuration.network in init_public_network cloud configuration diff --git a/tezt/tests/cloud/network.ml b/tezt/tests/cloud/network.ml index 1bdc691c624ef46f3a32c1e463a3158ba7c91941..f39bb25dedcf1885628550e6803ad62fbf3c612d 100644 --- a/tezt/tests/cloud/network.ml +++ b/tezt/tests/cloud/network.ml @@ -10,6 +10,10 @@ type public = type t = [public | `Sandbox] +let to_public = function + | `Sandbox -> failwith "Sandbox is not public" + | #public as p -> p + let to_string = function | `Mainnet -> "mainnet" | `Ghostnet -> "ghostnet" diff --git a/tezt/tests/cloud/network.mli b/tezt/tests/cloud/network.mli index 68f02ffa44ff8b4634a286281f229c2c351b55d3..e510d9c6024a97587609ba40aeb4e7187d69293c 100644 --- a/tezt/tests/cloud/network.mli +++ b/tezt/tests/cloud/network.mli @@ -21,7 +21,9 @@ type public = type t = [public | `Sandbox] -(** ["mainnet" | "ghostnet" | "nextnet-%s" | "weeklynet-%s" | "sandbox"] *) +val to_public : t -> public + +(** ["mainnet" | "ghostnet" | "rionet" | "nextnet-%s" | "weeklynet-%s" | "sandbox"] *) val to_string : t -> string (** Known protocol used by the network *)