@@ -19,7 +19,7 @@ import type {
1919 SubscriptionConfig ,
2020} from "@nomicfoundation/edr" ;
2121import { privateToAddress } from "@ethereumjs/util" ;
22- import { precompileP256Verify } from "@nomicfoundation/edr" ;
22+ import { ContractDecoder , precompileP256Verify } from "@nomicfoundation/edr" ;
2323import picocolors from "picocolors" ;
2424import debug from "debug" ;
2525import { EventEmitter } from "events" ;
@@ -137,10 +137,6 @@ export class EdrProviderWrapper
137137 extends EventEmitter
138138 implements EIP1193Provider
139139{
140- private _addedCompilationResults : Array <
141- [ string , CompilerInput , CompilerOutput ]
142- > = [ ] ;
143-
144140 private _failedStackTraces = 0 ;
145141
146142 // temporarily added to make smock work with HH+EDR
@@ -154,8 +150,7 @@ export class EdrProviderWrapper
154150 private _node : {
155151 _vm : MinimalEthereumJsVm ;
156152 } ,
157- private readonly _subscriptionConfig : SubscriptionConfig ,
158- private readonly _tracingConfig : TracingConfigWithBuffers
153+ private readonly _subscriptionConfig : SubscriptionConfig
159154 ) {
160155 super ( ) ;
161156 }
@@ -297,13 +292,15 @@ export class EdrProviderWrapper
297292
298293 const edrTracingConfig = tracingConfig ?? { } ;
299294
295+ const contractDecoder = ContractDecoder . withContracts ( edrTracingConfig ) ;
296+
300297 const context = await getGlobalEdrContext ( ) ;
301298 const provider = await context . createProvider (
302299 GENERIC_CHAIN_TYPE ,
303300 edrProviderConfig ,
304301 edrLoggerConfig ,
305302 edrSubscriptionConfig ,
306- edrTracingConfig
303+ contractDecoder
307304 ) ;
308305
309306 const minimalEthereumJsNode = {
@@ -315,8 +312,7 @@ export class EdrProviderWrapper
315312 edrProviderConfig ,
316313 edrLoggerConfig ,
317314 minimalEthereumJsNode ,
318- edrSubscriptionConfig ,
319- edrTracingConfig
315+ edrSubscriptionConfig
320316 ) ;
321317
322318 // Pass through all events from the provider
@@ -479,17 +475,9 @@ export class EdrProviderWrapper
479475 output : CompilerOutput
480476 ) : Promise < boolean > {
481477 try {
482- const success = await this . _provider . addCompilationResult (
483- solcVersion ,
484- input ,
485- output
486- ) ;
478+ await this . _provider . addCompilationResult ( solcVersion , input , output ) ;
487479
488- if ( success ) {
489- this . _addedCompilationResults . push ( [ solcVersion , input , output ] ) ;
490- }
491-
492- return success ;
480+ return true ;
493481 } catch ( error : any ) {
494482 // eslint-disable-next-line @nomicfoundation/hardhat-internal-rules/only-hardhat-error
495483 throw new InternalError ( error ) ;
@@ -523,15 +511,9 @@ export class EdrProviderWrapper
523511 this . _providerConfig ,
524512 this . _loggerConfig ,
525513 this . _subscriptionConfig ,
526- this . _tracingConfig
514+ this . _provider . contractDecoder ( )
527515 ) ;
528516
529- for ( const [ solcVersion , input , output ] of this . _addedCompilationResults ) {
530- // This should succeed as only successful compilation results are added
531- // to the provider. Therefore, we don't need to handle errors here.
532- await provider . addCompilationResult ( solcVersion , input , output ) ;
533- }
534-
535517 const minimalEthereumJsNode = {
536518 _vm : getMinimalEthereumJsVm ( provider ) ,
537519 } ;
0 commit comments