@@ -11,9 +11,12 @@ pub struct NetworkInner {
1111 pub configuration : Option < Configuration > ,
1212}
1313
14+ /// A network definition for the project
1415#[ derive( Clone , Debug , PartialEq , JsonSchema ) ]
1516pub struct NetworkManifest {
1617 pub name : String ,
18+
19+ #[ schemars( with = "Option<Configuration>" ) ]
1720 pub configuration : Configuration ,
1821}
1922
@@ -82,12 +85,14 @@ mod tests {
8285 ) ?,
8386 NetworkManifest {
8487 name: "my-network" . to_string( ) ,
85- configuration: Configuration :: Managed ( Managed {
86- gateway: Gateway {
87- host: "localhost" . to_string( ) ,
88- port: Port :: Fixed ( 8000 ) ,
88+ configuration: Configuration :: Managed {
89+ managed: Managed {
90+ gateway: Gateway {
91+ host: "localhost" . to_string( ) ,
92+ port: Port :: Fixed ( 8000 ) ,
93+ }
8994 }
90- } )
95+ }
9196 } ,
9297 ) ;
9398
@@ -148,10 +153,12 @@ mod tests {
148153 ) ?,
149154 NetworkManifest {
150155 name: "my-network" . to_string( ) ,
151- configuration: Configuration :: Connected ( Connected {
152- url: "https://ic0.app" . to_string( ) ,
153- root_key: None ,
154- } )
156+ configuration: Configuration :: Connected {
157+ connected: Connected {
158+ url: "https://ic0.app" . to_string( ) ,
159+ root_key: None ,
160+ }
161+ }
155162 } ,
156163 ) ;
157164
@@ -171,10 +178,12 @@ mod tests {
171178 ) ?,
172179 NetworkManifest {
173180 name: "my-network" . to_string( ) ,
174- configuration: Configuration :: Connected ( Connected {
175- url: "https://ic0.app" . to_string( ) ,
176- root_key: Some ( "root-key" . to_string( ) ) ,
177- } )
181+ configuration: Configuration :: Connected {
182+ connected: Connected {
183+ url: "https://ic0.app" . to_string( ) ,
184+ root_key: Some ( "root-key" . to_string( ) ) ,
185+ }
186+ }
178187 } ,
179188 ) ;
180189
@@ -192,12 +201,14 @@ mod tests {
192201 ) ?,
193202 NetworkManifest {
194203 name: "my-network" . to_string( ) ,
195- configuration: Configuration :: Managed ( Managed {
196- gateway: Gateway {
197- host: "localhost" . to_string( ) ,
198- port: Port :: Fixed ( 8000 ) ,
204+ configuration: Configuration :: Managed {
205+ managed: Managed {
206+ gateway: Gateway {
207+ host: "localhost" . to_string( ) ,
208+ port: Port :: Fixed ( 8000 ) ,
209+ }
199210 }
200- } )
211+ }
201212 } ,
202213 ) ;
203214
@@ -218,12 +229,14 @@ mod tests {
218229 ) ?,
219230 NetworkManifest {
220231 name: "my-network" . to_string( ) ,
221- configuration: Configuration :: Managed ( Managed {
222- gateway: Gateway {
223- host: "my-host" . to_string( ) ,
224- port: Port :: Fixed ( 1234 ) ,
232+ configuration: Configuration :: Managed {
233+ managed: Managed {
234+ gateway: Gateway {
235+ host: "my-host" . to_string( ) ,
236+ port: Port :: Fixed ( 1234 ) ,
237+ }
225238 }
226- } )
239+ }
227240 } ,
228241 ) ;
229242
@@ -243,12 +256,14 @@ mod tests {
243256 ) ?,
244257 NetworkManifest {
245258 name: "my-network" . to_string( ) ,
246- configuration: Configuration :: Managed ( Managed {
247- gateway: Gateway {
248- host: "localhost" . to_string( ) ,
249- port: Port :: Random ,
259+ configuration: Configuration :: Managed {
260+ managed: Managed {
261+ gateway: Gateway {
262+ host: "localhost" . to_string( ) ,
263+ port: Port :: Random ,
264+ }
250265 }
251- } )
266+ }
252267 } ,
253268 ) ;
254269
0 commit comments