@@ -41,10 +41,9 @@ struct ReplicaSettings {
41
41
}
42
42
43
43
#[ derive( Serialize , Deserialize , PartialEq , Eq ) ]
44
- #[ serde( tag = "type" , rename_all = "snake_case" ) ]
45
- enum BackendSettings < ' a > {
46
- Replica { settings : Cow < ' a , ReplicaSettings > } ,
47
- PocketIc ,
44
+ struct BackendSettings < ' a > {
45
+ settings : Cow < ' a , ReplicaSettings > ,
46
+ pocketic : bool ,
48
47
}
49
48
50
49
#[ derive( Serialize , Deserialize , PartialEq , Eq ) ]
@@ -60,11 +59,7 @@ pub fn get_settings_digest(
60
59
artificial_delay : u32 ,
61
60
pocketic : bool ,
62
61
) -> String {
63
- let backend = if pocketic {
64
- BackendSettings :: PocketIc
65
- } else {
66
- get_replica_backend_settings ( local_server_descriptor, artificial_delay)
67
- } ;
62
+ let backend = get_replica_backend_settings ( local_server_descriptor, artificial_delay, pocketic) ;
68
63
let settings = Settings {
69
64
ic_repo_commit : ic_repo_commit. into ( ) ,
70
65
backend,
@@ -77,6 +72,7 @@ pub fn get_settings_digest(
77
72
fn get_replica_backend_settings (
78
73
local_server_descriptor : & LocalServerDescriptor ,
79
74
artificial_delay : u32 ,
75
+ pocketic : bool ,
80
76
) -> BackendSettings {
81
77
let http_handler = HttpHandlerSettings {
82
78
port : if let Some ( port) = local_server_descriptor. replica . port {
@@ -105,7 +101,8 @@ fn get_replica_backend_settings(
105
101
. unwrap_or_default ( ) ,
106
102
artificial_delay,
107
103
} ;
108
- BackendSettings :: Replica {
104
+ BackendSettings {
109
105
settings : Cow :: Owned ( replica_settings) ,
106
+ pocketic,
110
107
}
111
108
}
0 commit comments