File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,24 +127,16 @@ impl MuxConfig {
127127
128128 match loader {
129129 MuxKeysLoader :: File ( path_buf) => {
130- ensure ! (
131- path_buf. try_exists( ) . is_ok_and( |exists| exists) ,
132- "path doesn't exist: {:?}" ,
133- path_buf
134- ) ;
135-
136- ensure ! (
137- path_buf. extension( ) . is_some_and( |ext| ext == "json" ) ,
138- "file doesn't have a .json extension: {:?}" ,
139- path_buf
140- ) ;
141-
142130 let Some ( path) = path_buf. to_str ( ) else {
143131 bail ! ( "invalid path: {:?}" , path_buf) ;
144132 } ;
145133
146- let internal_path = get_mux_path ( & self . id ) ;
134+ let file = load_file ( path) ?;
135+ // make sure we can load the pubkeys correctly
136+ let _: Vec < BlsPublicKey > =
137+ serde_json:: from_str ( & file) . wrap_err ( "failed to parse mux keys file" ) ?;
147138
139+ let internal_path = get_mux_path ( & self . id ) ;
148140 Ok ( Some ( ( get_mux_env ( & self . id ) , path. to_owned ( ) , internal_path) ) )
149141 }
150142 MuxKeysLoader :: HTTP { .. } => Ok ( None ) ,
You can’t perform that action at this time.
0 commit comments