hardhat 2.9.2 → 2.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builtin-tasks/compile.js +18 -10
- package/builtin-tasks/compile.js.map +1 -1
- package/builtin-tasks/node.js +4 -3
- package/builtin-tasks/node.js.map +1 -1
- package/internal/artifacts.d.ts.map +1 -1
- package/internal/artifacts.js +2 -1
- package/internal/artifacts.js.map +1 -1
- package/internal/cli/HelpPrinter.js +6 -6
- package/internal/cli/HelpPrinter.js.map +1 -1
- package/internal/cli/analytics.d.ts.map +1 -1
- package/internal/cli/analytics.js +2 -2
- package/internal/cli/analytics.js.map +1 -1
- package/internal/cli/cli.js +8 -8
- package/internal/cli/cli.js.map +1 -1
- package/internal/cli/project-creation.js +1 -1
- package/internal/core/config/config-loading.d.ts +5 -2
- package/internal/core/config/config-loading.d.ts.map +1 -1
- package/internal/core/config/config-loading.js +1 -1
- package/internal/core/config/config-loading.js.map +1 -1
- package/internal/core/errors-list.d.ts +7 -0
- package/internal/core/errors-list.d.ts.map +1 -1
- package/internal/core/errors-list.js +10 -3
- package/internal/core/errors-list.js.map +1 -1
- package/internal/core/providers/http.d.ts +1 -1
- package/internal/core/providers/http.d.ts.map +1 -1
- package/internal/core/providers/http.js +3 -3
- package/internal/core/providers/http.js.map +1 -1
- package/internal/core/runtime-environment.d.ts +3 -2
- package/internal/core/runtime-environment.d.ts.map +1 -1
- package/internal/core/runtime-environment.js +2 -1
- package/internal/core/runtime-environment.js.map +1 -1
- package/internal/hardhat-network/jsonrpc/handler.js +12 -3
- package/internal/hardhat-network/jsonrpc/handler.js.map +1 -1
- package/internal/hardhat-network/jsonrpc/server.d.ts.map +1 -1
- package/internal/hardhat-network/jsonrpc/server.js +2 -2
- package/internal/hardhat-network/jsonrpc/server.js.map +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.d.ts +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.d.ts.map +1 -1
- package/internal/hardhat-network/provider/BlockchainBase.js +2 -2
- package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -1
- package/internal/hardhat-network/provider/BlockchainData.d.ts +2 -1
- package/internal/hardhat-network/provider/BlockchainData.d.ts.map +1 -1
- package/internal/hardhat-network/provider/BlockchainData.js +4 -2
- package/internal/hardhat-network/provider/BlockchainData.js.map +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.d.ts +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.d.ts.map +1 -1
- package/internal/hardhat-network/provider/HardhatBlockchain.js +2 -2
- package/internal/hardhat-network/provider/HardhatBlockchain.js.map +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.d.ts.map +1 -1
- package/internal/hardhat-network/provider/TransactionQueue.js.map +1 -1
- package/internal/hardhat-network/provider/TxPool.js +3 -3
- package/internal/hardhat-network/provider/TxPool.js.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -1
- package/internal/hardhat-network/provider/fork/ForkBlockchain.js +3 -3
- package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.d.ts +3 -0
- package/internal/hardhat-network/provider/modules/eth.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.js +20 -17
- package/internal/hardhat-network/provider/modules/eth.js.map +1 -1
- package/internal/hardhat-network/provider/modules/evm.js +2 -2
- package/internal/hardhat-network/provider/modules/evm.js.map +1 -1
- package/internal/hardhat-network/provider/modules/logger.d.ts.map +1 -1
- package/internal/hardhat-network/provider/modules/logger.js +10 -4
- package/internal/hardhat-network/provider/modules/logger.js.map +1 -1
- package/internal/hardhat-network/provider/node.d.ts.map +1 -1
- package/internal/hardhat-network/provider/node.js +8 -8
- package/internal/hardhat-network/provider/node.js.map +1 -1
- package/internal/hardhat-network/provider/output.js +1 -1
- package/internal/hardhat-network/provider/output.js.map +1 -1
- package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts +1 -1
- package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +1 -10
- package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
- package/internal/lib/hardhat-lib.d.ts.map +1 -1
- package/internal/lib/hardhat-lib.js +2 -2
- package/internal/lib/hardhat-lib.js.map +1 -1
- package/internal/solidity/compilation-job.d.ts.map +1 -1
- package/internal/solidity/compilation-job.js.map +1 -1
- package/internal/util/download.js +1 -1
- package/internal/util/download.js.map +1 -1
- package/internal/util/lazy.d.ts.map +1 -1
- package/internal/util/lazy.js +6 -4
- package/internal/util/lazy.js.map +1 -1
- package/internal/util/wei-values.js +1 -1
- package/internal/util/wei-values.js.map +1 -1
- package/package.json +14 -8
- package/register.js +2 -2
- package/register.js.map +1 -1
- package/src/builtin-tasks/compile.ts +30 -14
- package/src/builtin-tasks/node.ts +5 -2
- package/src/common/bigInt.ts +106 -0
- package/src/common/index.ts +2 -0
- package/src/internal/artifacts.ts +3 -2
- package/src/internal/cli/HelpPrinter.ts +6 -6
- package/src/internal/cli/analytics.ts +4 -1
- package/src/internal/cli/cli.ts +17 -13
- package/src/internal/cli/project-creation.ts +1 -1
- package/src/internal/core/config/config-loading.ts +7 -3
- package/src/internal/core/errors-list.ts +11 -3
- package/src/internal/core/providers/http.ts +6 -2
- package/src/internal/core/runtime-environment.ts +3 -1
- package/src/internal/hardhat-network/jsonrpc/handler.ts +15 -3
- package/src/internal/hardhat-network/jsonrpc/server.ts +2 -1
- package/src/internal/hardhat-network/provider/BlockchainBase.ts +4 -2
- package/src/internal/hardhat-network/provider/BlockchainData.ts +6 -2
- package/src/internal/hardhat-network/provider/HardhatBlockchain.ts +4 -2
- package/src/internal/hardhat-network/provider/TransactionQueue.ts +3 -1
- package/src/internal/hardhat-network/provider/TxPool.ts +3 -3
- package/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts +7 -3
- package/src/internal/hardhat-network/provider/modules/eth.ts +22 -17
- package/src/internal/hardhat-network/provider/modules/evm.ts +2 -2
- package/src/internal/hardhat-network/provider/modules/logger.ts +10 -4
- package/src/internal/hardhat-network/provider/node.ts +9 -8
- package/src/internal/hardhat-network/provider/output.ts +1 -1
- package/src/internal/hardhat-network/provider/types/HardhatBlockchainInterface.ts +2 -1
- package/src/internal/hardhat-network/stack-traces/vm-debug-tracer.ts +1 -11
- package/src/internal/lib/hardhat-lib.ts +4 -3
- package/src/internal/solidity/compilation-job.ts +3 -1
- package/src/internal/util/download.ts +1 -1
- package/src/internal/util/lazy.ts +21 -5
- package/src/internal/util/wei-values.ts +1 -1
- package/src/register.ts +4 -3
- package/src/types/runtime.ts +2 -1
- package/types/runtime.d.ts +2 -1
- package/types/runtime.d.ts.map +1 -1
- package/src/tsconfig.json +0 -10
|
@@ -365,6 +365,9 @@ export class EthModule {
|
|
|
365
365
|
await this._runHardhatNetworkMessageTraceHooks(trace, true);
|
|
366
366
|
|
|
367
367
|
if (error !== undefined && this._throwOnCallFailures) {
|
|
368
|
+
const callReturnData = trace?.returnData.toString("hex") ?? "";
|
|
369
|
+
(error as any).data = `0x${callReturnData}`;
|
|
370
|
+
|
|
368
371
|
throw error;
|
|
369
372
|
}
|
|
370
373
|
|
|
@@ -438,6 +441,9 @@ export class EthModule {
|
|
|
438
441
|
error
|
|
439
442
|
);
|
|
440
443
|
|
|
444
|
+
const callReturnData = trace?.returnData.toString("hex") ?? "";
|
|
445
|
+
(error as any).data = `0x${callReturnData}`;
|
|
446
|
+
|
|
441
447
|
throw error;
|
|
442
448
|
}
|
|
443
449
|
|
|
@@ -979,8 +985,9 @@ export class EthModule {
|
|
|
979
985
|
}
|
|
980
986
|
|
|
981
987
|
if (error.message.includes("The chain ID does not match")) {
|
|
988
|
+
const chainId = this._common.chainIdBN().toString();
|
|
982
989
|
throw new InvalidArgumentsError(
|
|
983
|
-
`Trying to send a raw transaction with an invalid chainId. The expected chainId is ${
|
|
990
|
+
`Trying to send a raw transaction with an invalid chainId. The expected chainId is ${chainId}`,
|
|
984
991
|
error
|
|
985
992
|
);
|
|
986
993
|
}
|
|
@@ -1015,7 +1022,7 @@ export class EthModule {
|
|
|
1015
1022
|
!transactionRequest.chainId.eq(expectedChainId)
|
|
1016
1023
|
) {
|
|
1017
1024
|
throw new InvalidArgumentsError(
|
|
1018
|
-
`Invalid chainId ${transactionRequest.chainId.toString()} provided, expected ${expectedChainId} instead.`
|
|
1025
|
+
`Invalid chainId ${transactionRequest.chainId.toString()} provided, expected ${expectedChainId.toString()} instead.`
|
|
1019
1026
|
);
|
|
1020
1027
|
}
|
|
1021
1028
|
|
|
@@ -1512,12 +1519,13 @@ export class EthModule {
|
|
|
1512
1519
|
result = [result];
|
|
1513
1520
|
}
|
|
1514
1521
|
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1522
|
+
const trace = await this._handleMineBlockResults(result, tx);
|
|
1523
|
+
|
|
1524
|
+
if (trace.error !== undefined && this._throwOnTransactionFailures) {
|
|
1525
|
+
const e = trace.error;
|
|
1526
|
+
|
|
1527
|
+
const returnData = trace.trace?.returnData.toString("hex") ?? "";
|
|
1528
|
+
(e as any).data = `0x${returnData}`;
|
|
1521
1529
|
(e as any).transactionHash = bufferToRpcData(tx.hash());
|
|
1522
1530
|
|
|
1523
1531
|
throw e;
|
|
@@ -1526,10 +1534,13 @@ export class EthModule {
|
|
|
1526
1534
|
return bufferToRpcData(tx.hash());
|
|
1527
1535
|
}
|
|
1528
1536
|
|
|
1537
|
+
/**
|
|
1538
|
+
* Returns the trace of the sent tx
|
|
1539
|
+
*/
|
|
1529
1540
|
private async _handleMineBlockResults(
|
|
1530
1541
|
results: MineBlockResult[],
|
|
1531
1542
|
sentTx: TypedTransaction
|
|
1532
|
-
) {
|
|
1543
|
+
): Promise<GatherTracesResult> {
|
|
1533
1544
|
const singleTransactionMined =
|
|
1534
1545
|
results.length === 1 && results[0].block.transactions.length === 1;
|
|
1535
1546
|
|
|
@@ -1540,10 +1551,7 @@ export class EthModule {
|
|
|
1540
1551
|
const trace = results[0].traces[0];
|
|
1541
1552
|
await this._logSingleTransaction(tx, block, txGasUsed, trace);
|
|
1542
1553
|
|
|
1543
|
-
|
|
1544
|
-
if (txError !== undefined && this._throwOnTransactionFailures) {
|
|
1545
|
-
throw txError;
|
|
1546
|
-
}
|
|
1554
|
+
return trace;
|
|
1547
1555
|
} else {
|
|
1548
1556
|
// this happens when automine is enabled, a tx is sent, and there are
|
|
1549
1557
|
// pending txs in the mempool
|
|
@@ -1575,10 +1583,7 @@ export class EthModule {
|
|
|
1575
1583
|
);
|
|
1576
1584
|
}
|
|
1577
1585
|
|
|
1578
|
-
|
|
1579
|
-
if (sentTxError !== undefined && this._throwOnTransactionFailures) {
|
|
1580
|
-
throw sentTxError;
|
|
1581
|
-
}
|
|
1586
|
+
return sentTxTrace;
|
|
1582
1587
|
}
|
|
1583
1588
|
}
|
|
1584
1589
|
|
|
@@ -90,7 +90,7 @@ export class EvmModule {
|
|
|
90
90
|
);
|
|
91
91
|
if (increment.lte(new BN(0))) {
|
|
92
92
|
throw new InvalidInputError(
|
|
93
|
-
`Timestamp ${timestamp} is lower than or equal to previous block's timestamp` +
|
|
93
|
+
`Timestamp ${timestamp.toString()} is lower than or equal to previous block's timestamp` +
|
|
94
94
|
` ${new BN(latestBlock.header.timestamp).toNumber()}`
|
|
95
95
|
);
|
|
96
96
|
}
|
|
@@ -132,7 +132,7 @@ export class EvmModule {
|
|
|
132
132
|
);
|
|
133
133
|
if (increment.lte(new BN(0))) {
|
|
134
134
|
throw new InvalidInputError(
|
|
135
|
-
`Timestamp ${timestamp} is lower than previous block's timestamp` +
|
|
135
|
+
`Timestamp ${timestamp.toString()} is lower than previous block's timestamp` +
|
|
136
136
|
` ${new BN(latestBlock.header.timestamp).toNumber()}`
|
|
137
137
|
);
|
|
138
138
|
}
|
|
@@ -331,7 +331,9 @@ export class ModulesLogger {
|
|
|
331
331
|
if (isEmpty) {
|
|
332
332
|
this._log(
|
|
333
333
|
`Mined empty block #${blockNumber}${
|
|
334
|
-
baseFeePerGas !== undefined
|
|
334
|
+
baseFeePerGas !== undefined
|
|
335
|
+
? ` with base fee ${baseFeePerGas.toString()}`
|
|
336
|
+
: ""
|
|
335
337
|
}`
|
|
336
338
|
);
|
|
337
339
|
|
|
@@ -365,7 +367,7 @@ export class ModulesLogger {
|
|
|
365
367
|
|
|
366
368
|
private _logBaseFeePerGas(block: Block) {
|
|
367
369
|
if (block.header.baseFeePerGas !== undefined) {
|
|
368
|
-
this._log(`Base fee: ${block.header.baseFeePerGas}`);
|
|
370
|
+
this._log(`Base fee: ${block.header.baseFeePerGas.toString()}`);
|
|
369
371
|
}
|
|
370
372
|
}
|
|
371
373
|
|
|
@@ -413,7 +415,9 @@ export class ModulesLogger {
|
|
|
413
415
|
if (isEmpty) {
|
|
414
416
|
this._print(
|
|
415
417
|
`Mined empty block #${blockNumber}${
|
|
416
|
-
baseFeePerGas !== undefined
|
|
418
|
+
baseFeePerGas !== undefined
|
|
419
|
+
? ` with base fee ${baseFeePerGas.toString()}`
|
|
420
|
+
: ""
|
|
417
421
|
}`,
|
|
418
422
|
{
|
|
419
423
|
collapseIntervalMinedBlock: true,
|
|
@@ -441,7 +445,9 @@ export class ModulesLogger {
|
|
|
441
445
|
|
|
442
446
|
this._log(
|
|
443
447
|
`Mined empty block #${blockNumber}${
|
|
444
|
-
baseFeePerGas !== undefined
|
|
448
|
+
baseFeePerGas !== undefined
|
|
449
|
+
? ` with base fee ${baseFeePerGas.toString()}`
|
|
450
|
+
: ""
|
|
445
451
|
}`,
|
|
446
452
|
{
|
|
447
453
|
collapseHardhatMinedBlock: true,
|
|
@@ -563,7 +563,8 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
563
563
|
remainingBlockCount.subn(1),
|
|
564
564
|
interval,
|
|
565
565
|
await this._stateManager.getStateRoot(),
|
|
566
|
-
await this.getBlockTotalDifficulty(latestBlock)
|
|
566
|
+
await this.getBlockTotalDifficulty(latestBlock),
|
|
567
|
+
(await this.getLatestBlock()).header.baseFeePerGas
|
|
567
568
|
);
|
|
568
569
|
|
|
569
570
|
await mineBlock();
|
|
@@ -1031,7 +1032,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
1031
1032
|
this.setNextBlockTimestamp(snapshot.nextBlockTimestamp);
|
|
1032
1033
|
this._txPool.revert(snapshot.txPoolSnapshotId);
|
|
1033
1034
|
|
|
1034
|
-
if (snapshot.userProvidedNextBlockBaseFeePerGas) {
|
|
1035
|
+
if (snapshot.userProvidedNextBlockBaseFeePerGas !== undefined) {
|
|
1035
1036
|
this.setUserProvidedNextBlockBaseFeePerGas(
|
|
1036
1037
|
snapshot.userProvidedNextBlockBaseFeePerGas
|
|
1037
1038
|
);
|
|
@@ -1675,7 +1676,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
1675
1676
|
const nextPendingNonce = await this._txPool.getNextPendingNonce(sender);
|
|
1676
1677
|
const txNonce = new BN(tx.nonce);
|
|
1677
1678
|
|
|
1678
|
-
const expectedNonceMsg = `Expected nonce to be ${nextPendingNonce} but got ${txNonce}.`;
|
|
1679
|
+
const expectedNonceMsg = `Expected nonce to be ${nextPendingNonce.toString()} but got ${txNonce.toString()}.`;
|
|
1679
1680
|
if (txNonce.gt(nextPendingNonce)) {
|
|
1680
1681
|
throw new InvalidInputError(
|
|
1681
1682
|
`Nonce too high. ${expectedNonceMsg} Note that transactions can't be queued when automining.`
|
|
@@ -1691,7 +1692,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
1691
1692
|
);
|
|
1692
1693
|
if (txPriorityFee.lt(this._minGasPrice)) {
|
|
1693
1694
|
throw new InvalidInputError(
|
|
1694
|
-
`Transaction gas price is ${txPriorityFee}, which is below the minimum of ${this._minGasPrice}`
|
|
1695
|
+
`Transaction gas price is ${txPriorityFee.toString()}, which is below the minimum of ${this._minGasPrice.toString()}`
|
|
1695
1696
|
);
|
|
1696
1697
|
}
|
|
1697
1698
|
|
|
@@ -1701,13 +1702,13 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
1701
1702
|
if ("maxFeePerGas" in tx) {
|
|
1702
1703
|
if (nextBlockGasFee.gt(tx.maxFeePerGas)) {
|
|
1703
1704
|
throw new InvalidInputError(
|
|
1704
|
-
`Transaction maxFeePerGas (${tx.maxFeePerGas}) is too low for the next block, which has a baseFeePerGas of ${nextBlockGasFee}`
|
|
1705
|
+
`Transaction maxFeePerGas (${tx.maxFeePerGas.toString()}) is too low for the next block, which has a baseFeePerGas of ${nextBlockGasFee.toString()}`
|
|
1705
1706
|
);
|
|
1706
1707
|
}
|
|
1707
1708
|
} else {
|
|
1708
1709
|
if (nextBlockGasFee.gt(tx.gasPrice)) {
|
|
1709
1710
|
throw new InvalidInputError(
|
|
1710
|
-
`Transaction gasPrice (${tx.gasPrice}) is too low for the next block, which has a baseFeePerGas of ${nextBlockGasFee}`
|
|
1711
|
+
`Transaction gasPrice (${tx.gasPrice.toString()}) is too low for the next block, which has a baseFeePerGas of ${nextBlockGasFee.toString()}`
|
|
1711
1712
|
);
|
|
1712
1713
|
}
|
|
1713
1714
|
}
|
|
@@ -2125,7 +2126,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
2125
2126
|
if (block === undefined) {
|
|
2126
2127
|
// TODO handle this better
|
|
2127
2128
|
throw new Error(
|
|
2128
|
-
`Block with number ${blockNumberOrPending} doesn't exist. This should never happen.`
|
|
2129
|
+
`Block with number ${blockNumberOrPending.toString()} doesn't exist. This should never happen.`
|
|
2129
2130
|
);
|
|
2130
2131
|
}
|
|
2131
2132
|
|
|
@@ -2545,7 +2546,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
|
|
|
2545
2546
|
);
|
|
2546
2547
|
if (hardfork === undefined || blockNumber.ltn(activationBlock)) {
|
|
2547
2548
|
throw new InternalError(
|
|
2548
|
-
`Could not find a hardfork to run for block ${blockNumber}, after having looked for one in the HardhatNode's hardfork activation history, which was: ${JSON.stringify(
|
|
2549
|
+
`Could not find a hardfork to run for block ${blockNumber.toString()}, after having looked for one in the HardhatNode's hardfork activation history, which was: ${JSON.stringify(
|
|
2549
2550
|
hardforkHistory
|
|
2550
2551
|
)}. For more information, see https://hardhat.org/hardhat-network/reference/#config`
|
|
2551
2552
|
);
|
|
@@ -186,7 +186,7 @@ export function getRpcBlock(
|
|
|
186
186
|
uncles: block.uncleHeaders.map((uh: any) => bufferToRpcData(uh.hash())),
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
if (block.header.baseFeePerGas) {
|
|
189
|
+
if (block.header.baseFeePerGas !== undefined) {
|
|
190
190
|
output.baseFeePerGas = numberToRpcQuantity(block.header.baseFeePerGas);
|
|
191
191
|
}
|
|
192
192
|
|
|
@@ -11,7 +11,8 @@ export interface HardhatBlockchainInterface extends BlockchainInterface {
|
|
|
11
11
|
count: BN,
|
|
12
12
|
interval: BN,
|
|
13
13
|
previousBlockStateRoot: Buffer,
|
|
14
|
-
previousBlockTotalDifficulty: BN
|
|
14
|
+
previousBlockTotalDifficulty: BN,
|
|
15
|
+
previousBlockBaseFeePerGas: BN | undefined
|
|
15
16
|
): void;
|
|
16
17
|
deleteLaterBlocks(block: Block): void;
|
|
17
18
|
getBlockByTransactionHash(transactionHash: Buffer): Promise<Block | null>;
|
|
@@ -223,16 +223,6 @@ export class VMDebugTracer {
|
|
|
223
223
|
...structLog.storage,
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
// sometimes the memSize has the correct value
|
|
227
|
-
// for the memory length, in those cases we increase
|
|
228
|
-
// the memory to reflect this
|
|
229
|
-
if (structLog.memSize > structLog.memory.length) {
|
|
230
|
-
const wordsToAdd = structLog.memSize - structLog.memory.length;
|
|
231
|
-
for (let k = 0; k < wordsToAdd; k++) {
|
|
232
|
-
structLog.memory.push(EMPTY_MEMORY_WORD);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
226
|
if (i === 0) {
|
|
237
227
|
continue;
|
|
238
228
|
}
|
|
@@ -411,7 +401,7 @@ export class VMDebugTracer {
|
|
|
411
401
|
gasCost = constantGas + dynamicGas;
|
|
412
402
|
} else if (step.opcode.name === "CALLCODE") {
|
|
413
403
|
// finding an existing tx that uses CALLCODE or compiling a contract
|
|
414
|
-
// so that it uses
|
|
404
|
+
// so that it uses this opcode is hard,
|
|
415
405
|
// so we just throw
|
|
416
406
|
throw new InvalidInputError(
|
|
417
407
|
"Transactions that use CALLCODE are not supported by Hardhat's debug_traceTransaction"
|
|
@@ -37,14 +37,15 @@ if (HardhatContext.isCreated()) {
|
|
|
37
37
|
debug.enable("hardhat*");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const { resolvedConfig, userConfig } = loadConfigAndTasks(hardhatArguments);
|
|
41
41
|
|
|
42
42
|
env = new Environment(
|
|
43
|
-
|
|
43
|
+
resolvedConfig,
|
|
44
44
|
hardhatArguments,
|
|
45
45
|
ctx.tasksDSL.getTaskDefinitions(),
|
|
46
46
|
ctx.extendersManager.getExtenders(),
|
|
47
|
-
ctx.experimentalHardhatNetworkMessageTraceHooks
|
|
47
|
+
ctx.experimentalHardhatNetworkMessageTraceHooks,
|
|
48
|
+
userConfig
|
|
48
49
|
);
|
|
49
50
|
|
|
50
51
|
ctx.setHardhatRuntimeEnvironment(env);
|
|
@@ -153,7 +153,9 @@ export async function createCompilationJobsFromConnectedComponent(
|
|
|
153
153
|
|
|
154
154
|
if (isCompilationJobCreationError(compilationJobOrError)) {
|
|
155
155
|
log(
|
|
156
|
-
`'${file.absolutePath}' couldn't be compiled. Reason: '${
|
|
156
|
+
`'${file.absolutePath}' couldn't be compiled. Reason: '${
|
|
157
|
+
compilationJobOrError as any
|
|
158
|
+
}'`
|
|
157
159
|
);
|
|
158
160
|
errors.push(compilationJobOrError);
|
|
159
161
|
continue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import util from "util";
|
|
1
|
+
import util, { InspectOptions } from "util";
|
|
2
2
|
|
|
3
3
|
import { HardhatError } from "../core/errors";
|
|
4
4
|
import { ERRORS } from "../core/errors-list";
|
|
@@ -36,9 +36,17 @@ export function lazyObject<T extends object>(objectCreator: () => T): T {
|
|
|
36
36
|
return createLazyProxy(
|
|
37
37
|
objectCreator,
|
|
38
38
|
(getRealTarget) => ({
|
|
39
|
-
[inspect](
|
|
39
|
+
[inspect](
|
|
40
|
+
depth: number,
|
|
41
|
+
options: InspectOptions,
|
|
42
|
+
inspectFn: (
|
|
43
|
+
object: any,
|
|
44
|
+
options: InspectOptions
|
|
45
|
+
) => string = util.inspect
|
|
46
|
+
) {
|
|
40
47
|
const realTarget = getRealTarget();
|
|
41
|
-
|
|
48
|
+
const newOptions = { ...options, depth };
|
|
49
|
+
return inspectFn(realTarget, newOptions);
|
|
42
50
|
},
|
|
43
51
|
}),
|
|
44
52
|
(object) => {
|
|
@@ -64,9 +72,17 @@ export function lazyFunction<T extends Function>(functionCreator: () => T): T {
|
|
|
64
72
|
(getRealTarget) => {
|
|
65
73
|
function dummyTarget() {}
|
|
66
74
|
|
|
67
|
-
(dummyTarget as any)[inspect] = function (
|
|
75
|
+
(dummyTarget as any)[inspect] = function (
|
|
76
|
+
depth: number,
|
|
77
|
+
options: InspectOptions,
|
|
78
|
+
inspectFn: (
|
|
79
|
+
object: any,
|
|
80
|
+
options: InspectOptions
|
|
81
|
+
) => string = util.inspect
|
|
82
|
+
) {
|
|
68
83
|
const realTarget = getRealTarget();
|
|
69
|
-
|
|
84
|
+
const newOptions = { ...options, depth };
|
|
85
|
+
return inspectFn(realTarget, newOptions);
|
|
70
86
|
};
|
|
71
87
|
|
|
72
88
|
return dummyTarget;
|
package/src/register.ts
CHANGED
|
@@ -39,14 +39,15 @@ if (!HardhatContext.isCreated()) {
|
|
|
39
39
|
loadTsNode(hardhatArguments.tsconfig);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const { resolvedConfig, userConfig } = loadConfigAndTasks(hardhatArguments);
|
|
43
43
|
|
|
44
44
|
const env = new Environment(
|
|
45
|
-
|
|
45
|
+
resolvedConfig,
|
|
46
46
|
hardhatArguments,
|
|
47
47
|
ctx.tasksDSL.getTaskDefinitions(),
|
|
48
48
|
ctx.extendersManager.getExtenders(),
|
|
49
|
-
ctx.experimentalHardhatNetworkMessageTraceHooks
|
|
49
|
+
ctx.experimentalHardhatNetworkMessageTraceHooks,
|
|
50
|
+
userConfig
|
|
50
51
|
);
|
|
51
52
|
|
|
52
53
|
ctx.setHardhatRuntimeEnvironment(env);
|
package/src/types/runtime.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Artifacts } from "./artifacts";
|
|
2
|
-
import { HardhatConfig, NetworkConfig } from "./config";
|
|
2
|
+
import { HardhatConfig, HardhatUserConfig, NetworkConfig } from "./config";
|
|
3
3
|
import { EthereumProvider } from "./provider";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -186,6 +186,7 @@ export type RunTaskFunction = (
|
|
|
186
186
|
|
|
187
187
|
export interface HardhatRuntimeEnvironment {
|
|
188
188
|
readonly config: HardhatConfig;
|
|
189
|
+
readonly userConfig: HardhatUserConfig;
|
|
189
190
|
readonly hardhatArguments: HardhatArguments;
|
|
190
191
|
readonly tasks: TasksMap;
|
|
191
192
|
readonly run: RunTaskFunction;
|
package/types/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Artifacts } from "./artifacts";
|
|
2
|
-
import { HardhatConfig, NetworkConfig } from "./config";
|
|
2
|
+
import { HardhatConfig, HardhatUserConfig, NetworkConfig } from "./config";
|
|
3
3
|
import { EthereumProvider } from "./provider";
|
|
4
4
|
/**
|
|
5
5
|
* This class is used to dynamically validate task's argument types.
|
|
@@ -113,6 +113,7 @@ export interface TasksMap {
|
|
|
113
113
|
export declare type RunTaskFunction = (name: string, taskArguments?: TaskArguments) => Promise<any>;
|
|
114
114
|
export interface HardhatRuntimeEnvironment {
|
|
115
115
|
readonly config: HardhatConfig;
|
|
116
|
+
readonly userConfig: HardhatUserConfig;
|
|
116
117
|
readonly hardhatArguments: HardhatArguments;
|
|
117
118
|
readonly tasks: TasksMap;
|
|
118
119
|
readonly run: RunTaskFunction;
|
package/types/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/types/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/types/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AAEH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,IAAI,CAAC;CACrD;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IACzD;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,0BAA0B;IACzC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAA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