@@ -46,7 +46,7 @@ import {
46
46
getContractArtifact ,
47
47
getDuplicatedContractNamesDeclarationFile ,
48
48
} from "./artifacts.js" ;
49
- import { Cache } from "./cache.js" ;
49
+ import { ObjectCache } from "./cache.js" ;
50
50
import { CompilationJobImplementation } from "./compilation-job.js" ;
51
51
import { downloadConfiguredCompilers , getCompiler } from "./compiler/index.js" ;
52
52
import { buildDependencyGraph } from "./dependency-graph-building.js" ;
@@ -76,13 +76,13 @@ export interface SolidityBuildSystemOptions {
76
76
77
77
export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
78
78
readonly #options: SolidityBuildSystemOptions ;
79
- readonly #compilerOutputCache: Cache ;
79
+ readonly #compilerOutputCache: ObjectCache < CompilerOutput > ;
80
80
readonly #defaultConcurrency = Math . max ( os . cpus ( ) . length - 1 , 1 ) ;
81
81
#downloadedCompilers = false ;
82
82
83
83
constructor ( options : SolidityBuildSystemOptions ) {
84
84
this . #options = options ;
85
- this . #compilerOutputCache = new Cache (
85
+ this . #compilerOutputCache = new ObjectCache < CompilerOutput > (
86
86
options . cachePath ,
87
87
"hardhat.core.solidity.build-system.compiler-output" ,
88
88
"v1" ,
@@ -141,7 +141,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
141
141
142
142
if ( runCompilationJobOptions ?. force !== true ) {
143
143
const cachedCompilerOutput =
144
- await this . #compilerOutputCache. getJson < CompilerOutput > ( buildId ) ;
144
+ await this . #compilerOutputCache. get ( buildId ) ;
145
145
if ( cachedCompilerOutput !== undefined ) {
146
146
log ( `Using cached compiler output for build ${ buildId } ` ) ;
147
147
return {
@@ -180,7 +180,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
180
180
// will only care about the result of these operations in subsequent runs
181
181
void Promise . all (
182
182
uncachedSuccessfulResults . map ( async ( result ) => {
183
- return this . #compilerOutputCache. setJson (
183
+ return this . #compilerOutputCache. set (
184
184
result . compilationJob . getBuildId ( ) ,
185
185
result . compilerOutput ,
186
186
) ;
0 commit comments