Skip to content

Commit 83d0c45

Browse files
committed
build: upgrade to @NomicFoundation/edr v0.12.0-next.7
1 parent deaca4a commit 83d0c45

File tree

3 files changed

+47
-65
lines changed

3 files changed

+47
-65
lines changed

packages/hardhat-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"dependencies": {
100100
"@ethereumjs/util": "^9.1.0",
101101
"@ethersproject/abi": "^5.1.2",
102-
"@nomicfoundation/edr": "^0.12.0-next.4",
102+
"@nomicfoundation/edr": "^0.12.0-next.7",
103103
"@nomicfoundation/solidity-analyzer": "^0.1.0",
104104
"@sentry/node": "^5.18.1",
105105
"adm-zip": "^0.4.16",

packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {
1919
SubscriptionConfig,
2020
} from "@nomicfoundation/edr";
2121
import { privateToAddress } from "@ethereumjs/util";
22-
import { precompileP256Verify } from "@nomicfoundation/edr";
22+
import { ContractDecoder, precompileP256Verify } from "@nomicfoundation/edr";
2323
import picocolors from "picocolors";
2424
import debug from "debug";
2525
import { 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
};

pnpm-lock.yaml

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)