File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -440,7 +440,14 @@ pub async fn print_traces(
440
440
441
441
/// Traverse the artifacts in the project to generate local signatures and merge them into the cache
442
442
/// file.
443
- pub fn cache_local_signatures ( output : & ProjectCompileOutput , cache_dir : & Path ) -> Result < ( ) > {
443
+ pub fn cache_local_signatures (
444
+ output : & ProjectCompileOutput ,
445
+ cache_dir : Option < PathBuf > ,
446
+ ) -> Result < ( ) > {
447
+ let Some ( cache_dir) = cache_dir else {
448
+ eyre:: bail!( "Failed to get `cache_dir` to generate local signatures." ) ;
449
+ } ;
450
+
444
451
let path = cache_dir. join ( "signatures" ) ;
445
452
let mut signatures = SignaturesCache :: load ( & path) ;
446
453
for ( _, artifact) in output. artifacts ( ) {
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl BuildArgs {
104
104
let output = compiler. compile ( & project) ?;
105
105
106
106
// Cache project selectors.
107
- cache_local_signatures ( & output, & Config :: foundry_cache_dir ( ) . unwrap ( ) ) ?;
107
+ cache_local_signatures ( & output, Config :: foundry_cache_dir ( ) ) ?;
108
108
109
109
if format_json && !self . names && !self . sizes {
110
110
sh_println ! ( "{}" , serde_json:: to_string_pretty( & output. output( ) ) ?) ?;
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ impl SelectorsSubcommands {
95
95
// compile the project to get the artifacts/abis
96
96
let project = build_args. project ( ) ?;
97
97
let outcome = ProjectCompiler :: new ( ) . quiet ( true ) . compile ( & project) ?;
98
- cache_local_signatures ( & outcome, & Config :: foundry_cache_dir ( ) . unwrap ( ) ) ?
98
+ cache_local_signatures ( & outcome, Config :: foundry_cache_dir ( ) ) ? ;
99
99
}
100
100
Self :: Upload { contract, all, project_paths } => {
101
101
let build_args = BuildOpts {
You can’t perform that action at this time.
0 commit comments