hardhat 2.22.2 → 2.23.0-dev.0

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.
Files changed (183) hide show
  1. package/builtin-tasks/compile.js +2 -2
  2. package/builtin-tasks/compile.js.map +1 -1
  3. package/common/napi-rs.d.ts +2 -0
  4. package/common/napi-rs.d.ts.map +1 -0
  5. package/common/napi-rs.js +19 -0
  6. package/common/napi-rs.js.map +1 -0
  7. package/internal/core/errors-list.js +1 -1
  8. package/internal/core/errors-list.js.map +1 -1
  9. package/internal/core/params/argumentTypes.d.ts +6 -0
  10. package/internal/core/params/argumentTypes.d.ts.map +1 -1
  11. package/internal/core/params/argumentTypes.js +40 -1
  12. package/internal/core/params/argumentTypes.js.map +1 -1
  13. package/internal/core/tasks/task-definitions.d.ts +2 -2
  14. package/internal/core/tasks/task-definitions.js +2 -2
  15. package/internal/hardhat-network/provider/BlockchainBase.d.ts +29 -0
  16. package/internal/hardhat-network/provider/BlockchainBase.d.ts.map +1 -0
  17. package/internal/hardhat-network/provider/BlockchainBase.js +144 -0
  18. package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -0
  19. package/internal/hardhat-network/provider/BlockchainData.d.ts +58 -0
  20. package/internal/hardhat-network/provider/BlockchainData.d.ts.map +1 -0
  21. package/internal/hardhat-network/provider/BlockchainData.js +178 -0
  22. package/internal/hardhat-network/provider/BlockchainData.js.map +1 -0
  23. package/internal/hardhat-network/provider/HardhatBlockchain.d.ts +24 -0
  24. package/internal/hardhat-network/provider/HardhatBlockchain.d.ts.map +1 -0
  25. package/internal/hardhat-network/provider/HardhatBlockchain.js +73 -0
  26. package/internal/hardhat-network/provider/HardhatBlockchain.js.map +1 -0
  27. package/internal/hardhat-network/provider/PoolState.d.ts +26 -0
  28. package/internal/hardhat-network/provider/PoolState.d.ts.map +1 -0
  29. package/internal/hardhat-network/provider/PoolState.js +41 -0
  30. package/internal/hardhat-network/provider/PoolState.js.map +1 -0
  31. package/internal/hardhat-network/provider/TransactionQueue.d.ts +32 -0
  32. package/internal/hardhat-network/provider/TransactionQueue.d.ts.map +1 -0
  33. package/internal/hardhat-network/provider/TransactionQueue.js +130 -0
  34. package/internal/hardhat-network/provider/TransactionQueue.js.map +1 -0
  35. package/internal/hardhat-network/provider/TxPool.d.ts +83 -0
  36. package/internal/hardhat-network/provider/TxPool.d.ts.map +1 -0
  37. package/internal/hardhat-network/provider/TxPool.js +470 -0
  38. package/internal/hardhat-network/provider/TxPool.js.map +1 -0
  39. package/internal/hardhat-network/provider/ethereumjs-workarounds.d.ts +2 -0
  40. package/internal/hardhat-network/provider/ethereumjs-workarounds.d.ts.map +1 -0
  41. package/internal/hardhat-network/provider/ethereumjs-workarounds.js +15 -0
  42. package/internal/hardhat-network/provider/ethereumjs-workarounds.js.map +1 -0
  43. package/internal/hardhat-network/provider/filter.d.ts +29 -0
  44. package/internal/hardhat-network/provider/filter.d.ts.map +1 -0
  45. package/internal/hardhat-network/provider/filter.js +97 -0
  46. package/internal/hardhat-network/provider/filter.js.map +1 -0
  47. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts +33 -0
  48. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -0
  49. package/internal/hardhat-network/provider/fork/ForkBlockchain.js +272 -0
  50. package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -0
  51. package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts +51 -0
  52. package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts.map +1 -0
  53. package/internal/hardhat-network/provider/fork/ForkStateManager.js +300 -0
  54. package/internal/hardhat-network/provider/fork/ForkStateManager.js.map +1 -0
  55. package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts +4 -0
  56. package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts.map +1 -0
  57. package/internal/hardhat-network/provider/fork/rpcToBlockData.js +32 -0
  58. package/internal/hardhat-network/provider/fork/rpcToBlockData.js.map +1 -0
  59. package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts +10 -0
  60. package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts.map +1 -0
  61. package/internal/hardhat-network/provider/fork/rpcToTxData.js +29 -0
  62. package/internal/hardhat-network/provider/fork/rpcToTxData.js.map +1 -0
  63. package/internal/hardhat-network/provider/modules/base.d.ts +17 -0
  64. package/internal/hardhat-network/provider/modules/base.d.ts.map +1 -0
  65. package/internal/hardhat-network/provider/modules/base.js +127 -0
  66. package/internal/hardhat-network/provider/modules/base.js.map +1 -0
  67. package/internal/hardhat-network/provider/modules/debug.d.ts +12 -0
  68. package/internal/hardhat-network/provider/modules/debug.d.ts.map +1 -0
  69. package/internal/hardhat-network/provider/modules/debug.js +52 -0
  70. package/internal/hardhat-network/provider/modules/debug.js.map +1 -0
  71. package/internal/hardhat-network/provider/modules/eth.d.ts +107 -0
  72. package/internal/hardhat-network/provider/modules/eth.d.ts.map +1 -0
  73. package/internal/hardhat-network/provider/modules/eth.js +1034 -0
  74. package/internal/hardhat-network/provider/modules/eth.js.map +1 -0
  75. package/internal/hardhat-network/provider/modules/evm.d.ts +32 -0
  76. package/internal/hardhat-network/provider/modules/evm.d.ts.map +1 -0
  77. package/internal/hardhat-network/provider/modules/evm.js +180 -0
  78. package/internal/hardhat-network/provider/modules/evm.js.map +1 -0
  79. package/internal/hardhat-network/provider/modules/hardhat.d.ts +54 -0
  80. package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -0
  81. package/internal/hardhat-network/provider/modules/hardhat.js +309 -0
  82. package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -0
  83. package/internal/hardhat-network/provider/modules/net.d.ts +13 -0
  84. package/internal/hardhat-network/provider/modules/net.d.ts.map +1 -0
  85. package/internal/hardhat-network/provider/modules/net.js +47 -0
  86. package/internal/hardhat-network/provider/modules/net.js.map +1 -0
  87. package/internal/hardhat-network/provider/modules/personal.d.ts +9 -0
  88. package/internal/hardhat-network/provider/modules/personal.d.ts.map +1 -0
  89. package/internal/hardhat-network/provider/modules/personal.js +31 -0
  90. package/internal/hardhat-network/provider/modules/personal.js.map +1 -0
  91. package/internal/hardhat-network/provider/modules/web3.d.ts +11 -0
  92. package/internal/hardhat-network/provider/modules/web3.d.ts.map +1 -0
  93. package/internal/hardhat-network/provider/modules/web3.js +38 -0
  94. package/internal/hardhat-network/provider/modules/web3.js.map +1 -0
  95. package/internal/hardhat-network/provider/node.d.ts +197 -0
  96. package/internal/hardhat-network/provider/node.d.ts.map +1 -0
  97. package/internal/hardhat-network/provider/node.js +1866 -0
  98. package/internal/hardhat-network/provider/node.js.map +1 -0
  99. package/internal/hardhat-network/provider/provider.d.ts +1 -1
  100. package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
  101. package/internal/hardhat-network/provider/provider.js +34 -27
  102. package/internal/hardhat-network/provider/provider.js.map +1 -1
  103. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts +29 -0
  104. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts.map +1 -0
  105. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js +137 -0
  106. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js.map +1 -0
  107. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts +27 -0
  108. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts.map +1 -0
  109. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js +137 -0
  110. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js.map +1 -0
  111. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts +33 -0
  112. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts.map +1 -0
  113. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js +141 -0
  114. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js.map +1 -0
  115. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts +30 -0
  116. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts.map +1 -0
  117. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js +97 -0
  118. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js.map +1 -0
  119. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts +30 -0
  120. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts.map +1 -0
  121. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js +98 -0
  122. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js.map +1 -0
  123. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts +40 -0
  124. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts.map +1 -0
  125. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js +91 -0
  126. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js.map +1 -0
  127. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.d.ts +32 -0
  128. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.d.ts.map +1 -0
  129. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.js +87 -0
  130. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.js.map +1 -0
  131. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts +17 -0
  132. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts.map +1 -0
  133. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.js +3 -0
  134. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.js.map +1 -0
  135. package/internal/hardhat-network/provider/utils/convertToEdr.d.ts +1 -1
  136. package/internal/hardhat-network/provider/utils/convertToEdr.d.ts.map +1 -1
  137. package/internal/hardhat-network/provider/utils/convertToEdr.js +4 -0
  138. package/internal/hardhat-network/provider/utils/convertToEdr.js.map +1 -1
  139. package/internal/hardhat-network/provider/utils/makeFakeSignature.d.ts +7 -0
  140. package/internal/hardhat-network/provider/utils/makeFakeSignature.d.ts.map +1 -0
  141. package/internal/hardhat-network/provider/utils/makeFakeSignature.js +31 -0
  142. package/internal/hardhat-network/provider/utils/makeFakeSignature.js.map +1 -0
  143. package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts +4 -0
  144. package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts.map +1 -0
  145. package/internal/hardhat-network/provider/utils/makeStateTrie.js +20 -0
  146. package/internal/hardhat-network/provider/utils/makeStateTrie.js.map +1 -0
  147. package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts +8 -0
  148. package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts.map +1 -0
  149. package/internal/hardhat-network/provider/utils/putGenesisBlock.js +37 -0
  150. package/internal/hardhat-network/provider/utils/putGenesisBlock.js.map +1 -0
  151. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.d.ts +12 -0
  152. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.d.ts.map +1 -0
  153. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js +62 -0
  154. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js.map +1 -0
  155. package/internal/hardhat-network/provider/utils/txMapToArray.d.ts +3 -0
  156. package/internal/hardhat-network/provider/utils/txMapToArray.d.ts.map +1 -0
  157. package/internal/hardhat-network/provider/utils/txMapToArray.js +12 -0
  158. package/internal/hardhat-network/provider/utils/txMapToArray.js.map +1 -0
  159. package/internal/hardhat-network/provider/vm/exit.d.ts +1 -1
  160. package/internal/hardhat-network/provider/vm/exit.d.ts.map +1 -1
  161. package/internal/hardhat-network/provider/vm/exit.js +4 -0
  162. package/internal/hardhat-network/provider/vm/exit.js.map +1 -1
  163. package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts +46 -0
  164. package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -0
  165. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +421 -0
  166. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -0
  167. package/internal/hardhat-network/stack-traces/vm-tracer.d.ts +1 -1
  168. package/internal/hardhat-network/stack-traces/vm-tracer.d.ts.map +1 -1
  169. package/internal/solidity/parse.d.ts.map +1 -1
  170. package/internal/solidity/parse.js +5 -15
  171. package/internal/solidity/parse.js.map +1 -1
  172. package/package.json +8 -8
  173. package/recommended-gitignore.txt +3 -0
  174. package/src/builtin-tasks/compile.ts +2 -2
  175. package/src/common/napi-rs.ts +15 -0
  176. package/src/internal/core/errors-list.ts +1 -1
  177. package/src/internal/core/params/argumentTypes.ts +44 -0
  178. package/src/internal/core/tasks/task-definitions.ts +2 -2
  179. package/src/internal/hardhat-network/provider/provider.ts +52 -38
  180. package/src/internal/hardhat-network/provider/utils/convertToEdr.ts +14 -1
  181. package/src/internal/hardhat-network/provider/vm/exit.ts +15 -1
  182. package/src/internal/hardhat-network/stack-traces/vm-tracer.ts +1 -1
  183. package/src/internal/solidity/parse.ts +7 -16
@@ -0,0 +1,83 @@
1
+ /// <reference types="node" />
2
+ import { Common } from "@nomicfoundation/ethereumjs-common";
3
+ import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
4
+ import { StateManager } from "@nomicfoundation/ethereumjs-statemanager";
5
+ import { Address } from "@nomicfoundation/ethereumjs-util";
6
+ import { OrderedTransaction, SerializedTransaction } from "./PoolState";
7
+ export declare function serializeTransaction(tx: OrderedTransaction): SerializedTransaction;
8
+ export declare function deserializeTransaction(tx: SerializedTransaction, common: Common): OrderedTransaction;
9
+ export declare class TxPool {
10
+ private readonly _stateManager;
11
+ private _state;
12
+ private _snapshotIdToState;
13
+ private _nextSnapshotId;
14
+ private _nextOrderId;
15
+ private readonly _deserializeTransaction;
16
+ constructor(_stateManager: StateManager, blockGasLimit: bigint, common: Common);
17
+ addTransaction(tx: TypedTransaction): Promise<void>;
18
+ /**
19
+ * Remove transaction with the given hash from the mempool. Returns true
20
+ * if a transaction was removed, false otherwise.
21
+ */
22
+ removeTransaction(txHash: Buffer): boolean;
23
+ snapshot(): number;
24
+ revert(snapshotId: number): void;
25
+ getTransactionByHash(hash: Buffer): OrderedTransaction | undefined;
26
+ hasPendingTransactions(): boolean;
27
+ hasQueuedTransactions(): boolean;
28
+ isEmpty(): boolean;
29
+ getPendingTransactions(): Map<string, OrderedTransaction[]>;
30
+ getQueuedTransactions(): Map<string, OrderedTransaction[]>;
31
+ /**
32
+ * Returns the next available nonce for an address, taking into account
33
+ * its pending transactions.
34
+ */
35
+ getNextPendingNonce(accountAddress: Address): Promise<bigint>;
36
+ getBlockGasLimit(): bigint;
37
+ setBlockGasLimit(newLimit: bigint | number): void;
38
+ /**
39
+ * Updates the pending and queued list of all addresses
40
+ */
41
+ updatePendingAndQueued(): Promise<void>;
42
+ private _getSenderAddress;
43
+ private _removeSnapshotsAfter;
44
+ private _removeTx;
45
+ private _addPendingTransaction;
46
+ private _addQueuedTransaction;
47
+ private _validateTransaction;
48
+ private _knownTransaction;
49
+ private _transactionExists;
50
+ private _getTransactionsByHash;
51
+ private _getPending;
52
+ private _getQueued;
53
+ private _getPendingForAddress;
54
+ private _getQueuedForAddress;
55
+ private _setTransactionByHash;
56
+ private _setPending;
57
+ private _setQueued;
58
+ private _setPendingForAddress;
59
+ private _setQueuedForAddress;
60
+ private _setBlockGasLimit;
61
+ private _deleteTransactionByHash;
62
+ private _isTxValid;
63
+ /**
64
+ * Returns the next available nonce for an address, ignoring its
65
+ * pending transactions.
66
+ */
67
+ private _getNextConfirmedNonce;
68
+ /**
69
+ * Checks if some pending tx with the same nonce as `newTx` exists.
70
+ * If it exists, it replaces it with `newTx` and returns true.
71
+ * Otherwise returns false.
72
+ */
73
+ private _replacePendingTx;
74
+ /**
75
+ * Checks if some queued tx with the same nonce as `newTx` exists.
76
+ * If it exists, it replaces it with `newTx` and returns true.
77
+ * Otherwise returns false.
78
+ */
79
+ private _replaceQueuedTx;
80
+ private _replaceTx;
81
+ private _getMinNewFeePrice;
82
+ }
83
+ //# sourceMappingURL=TxPool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxPool.d.ts","sourceRoot":"","sources":["../../../src/internal/hardhat-network/provider/TxPool.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAEL,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EACL,OAAO,EAGR,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EAIL,kBAAkB,EAGlB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAQrB,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,kBAAkB,GACrB,qBAAqB,CAYvB;AAED,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,qBAAqB,EACzB,MAAM,EAAE,MAAM,GACb,kBAAkB,CAwCpB;AAED,qBAAa,MAAM;IAWf,OAAO,CAAC,QAAQ,CAAC,aAAa;IAVhC,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,kBAAkB,CAAiD;IAC3E,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,YAAY,CAAK;IAEzB,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAEhB;gBAGL,aAAa,EAAE,YAAY,EAC5C,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM;IAQH,cAAc,CAAC,EAAE,EAAE,gBAAgB;IAgBhD;;;OAGG;IACI,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAiD1C,QAAQ,IAAI,MAAM;IAMlB,MAAM,CAAC,UAAU,EAAE,MAAM;IAUzB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB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+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TxPool = exports.deserializeTransaction = exports.serializeTransaction = void 0;
27
+ const ethereumjs_tx_1 = require("@nomicfoundation/ethereumjs-tx");
28
+ const ethereumjs_util_1 = require("@nomicfoundation/ethereumjs-util");
29
+ const immutable_1 = require("immutable");
30
+ const errors_1 = require("../../core/providers/errors");
31
+ const BigIntUtils = __importStar(require("../../util/bigint"));
32
+ const PoolState_1 = require("./PoolState");
33
+ const FakeSenderAccessListEIP2930Transaction_1 = require("./transactions/FakeSenderAccessListEIP2930Transaction");
34
+ const FakeSenderTransaction_1 = require("./transactions/FakeSenderTransaction");
35
+ const reorganizeTransactionsLists_1 = require("./utils/reorganizeTransactionsLists");
36
+ const FakeSenderEIP1559Transaction_1 = require("./transactions/FakeSenderEIP1559Transaction");
37
+ /* eslint-disable @nomicfoundation/hardhat-internal-rules/only-hardhat-error */
38
+ function serializeTransaction(tx) {
39
+ const rlpSerialization = (0, ethereumjs_util_1.bufferToHex)(tx.data.serialize());
40
+ const isFake = tx.data instanceof FakeSenderTransaction_1.FakeSenderTransaction ||
41
+ tx.data instanceof FakeSenderAccessListEIP2930Transaction_1.FakeSenderAccessListEIP2930Transaction ||
42
+ tx.data instanceof FakeSenderEIP1559Transaction_1.FakeSenderEIP1559Transaction;
43
+ return (0, PoolState_1.makeSerializedTransaction)({
44
+ orderId: tx.orderId,
45
+ fakeFrom: isFake ? tx.data.getSenderAddress().toString() : undefined,
46
+ data: rlpSerialization,
47
+ txType: tx.data.type,
48
+ });
49
+ }
50
+ exports.serializeTransaction = serializeTransaction;
51
+ function deserializeTransaction(tx, common) {
52
+ const rlpSerialization = tx.get("data");
53
+ const fakeFrom = tx.get("fakeFrom");
54
+ let data;
55
+ if (fakeFrom !== undefined) {
56
+ const sender = ethereumjs_util_1.Address.fromString(fakeFrom);
57
+ const serialization = (0, ethereumjs_util_1.toBuffer)(rlpSerialization);
58
+ if (tx.get("txType") === 1) {
59
+ data =
60
+ FakeSenderAccessListEIP2930Transaction_1.FakeSenderAccessListEIP2930Transaction.fromSenderAndRlpSerializedTx(sender, serialization, { common });
61
+ }
62
+ else if (tx.get("txType") === 2) {
63
+ data = FakeSenderEIP1559Transaction_1.FakeSenderEIP1559Transaction.fromSenderAndRlpSerializedTx(sender, serialization, { common });
64
+ }
65
+ else {
66
+ data = FakeSenderTransaction_1.FakeSenderTransaction.fromSenderAndRlpSerializedTx(sender, serialization, { common });
67
+ }
68
+ }
69
+ else {
70
+ data = ethereumjs_tx_1.TransactionFactory.fromSerializedData((0, ethereumjs_util_1.toBuffer)(rlpSerialization), {
71
+ common,
72
+ disableMaxInitCodeSizeCheck: true,
73
+ });
74
+ }
75
+ return {
76
+ orderId: tx.get("orderId"),
77
+ data,
78
+ };
79
+ }
80
+ exports.deserializeTransaction = deserializeTransaction;
81
+ class TxPool {
82
+ constructor(_stateManager, blockGasLimit, common) {
83
+ this._stateManager = _stateManager;
84
+ this._snapshotIdToState = new Map();
85
+ this._nextSnapshotId = 0;
86
+ this._nextOrderId = 0;
87
+ this._state = (0, PoolState_1.makePoolState)({
88
+ blockGasLimit: BigIntUtils.toHex(blockGasLimit),
89
+ });
90
+ this._deserializeTransaction = (tx) => deserializeTransaction(tx, common);
91
+ }
92
+ async addTransaction(tx) {
93
+ const senderAddress = this._getSenderAddress(tx);
94
+ const nextConfirmedNonce = await this._getNextConfirmedNonce(senderAddress);
95
+ const nextPendingNonce = await this.getNextPendingNonce(senderAddress);
96
+ await this._validateTransaction(tx, senderAddress, nextConfirmedNonce);
97
+ const txNonce = tx.nonce;
98
+ if (txNonce > nextPendingNonce) {
99
+ this._addQueuedTransaction(tx);
100
+ }
101
+ else {
102
+ this._addPendingTransaction(tx);
103
+ }
104
+ }
105
+ /**
106
+ * Remove transaction with the given hash from the mempool. Returns true
107
+ * if a transaction was removed, false otherwise.
108
+ */
109
+ removeTransaction(txHash) {
110
+ const tx = this.getTransactionByHash(txHash);
111
+ if (tx === undefined) {
112
+ // transaction doesn't exist in the mempool
113
+ return false;
114
+ }
115
+ this._deleteTransactionByHash(txHash);
116
+ const serializedTx = serializeTransaction(tx);
117
+ const senderAddress = this._getSenderAddress(tx.data).toString();
118
+ const pendingForAddress = this._getPendingForAddress(senderAddress) ??
119
+ (0, immutable_1.List)();
120
+ const queuedForAddress = this._getQueuedForAddress(senderAddress) ??
121
+ (0, immutable_1.List)();
122
+ // if the tx to remove is in the pending state, remove it
123
+ // and move the following transactions to the queued list
124
+ const indexOfPendingTx = pendingForAddress.indexOf(serializedTx);
125
+ if (indexOfPendingTx !== -1) {
126
+ const newPendingForAddress = pendingForAddress.splice(indexOfPendingTx, pendingForAddress.size);
127
+ const newQueuedForAddress = queuedForAddress.concat(pendingForAddress.slice(indexOfPendingTx + 1));
128
+ this._setPendingForAddress(senderAddress, newPendingForAddress);
129
+ this._setQueuedForAddress(senderAddress, newQueuedForAddress);
130
+ return true;
131
+ }
132
+ // if the tx is in the queued state, we just remove it
133
+ const indexOfQueuedTx = queuedForAddress.indexOf(serializedTx);
134
+ if (indexOfQueuedTx !== -1) {
135
+ const newQueuedForAddress = queuedForAddress.splice(indexOfQueuedTx, 1);
136
+ this._setQueuedForAddress(senderAddress, newQueuedForAddress);
137
+ return true;
138
+ }
139
+ throw new Error("Tx should have existed in the pending or queued lists");
140
+ }
141
+ snapshot() {
142
+ const id = this._nextSnapshotId++;
143
+ this._snapshotIdToState.set(id, this._state);
144
+ return id;
145
+ }
146
+ revert(snapshotId) {
147
+ const state = this._snapshotIdToState.get(snapshotId);
148
+ if (state === undefined) {
149
+ throw new Error("There's no snapshot with such ID");
150
+ }
151
+ this._state = state;
152
+ this._removeSnapshotsAfter(snapshotId);
153
+ }
154
+ getTransactionByHash(hash) {
155
+ const tx = this._getTransactionsByHash().get((0, ethereumjs_util_1.bufferToHex)(hash));
156
+ if (tx !== undefined) {
157
+ return this._deserializeTransaction(tx);
158
+ }
159
+ return undefined;
160
+ }
161
+ hasPendingTransactions() {
162
+ const pendingMap = this._getPending();
163
+ return pendingMap.some((senderPendingTxs) => !senderPendingTxs.isEmpty());
164
+ }
165
+ hasQueuedTransactions() {
166
+ const queuedMap = this._getQueued();
167
+ return queuedMap.some((senderQueuedTxs) => !senderQueuedTxs.isEmpty());
168
+ }
169
+ isEmpty() {
170
+ return !(this.hasPendingTransactions() || this.hasQueuedTransactions());
171
+ }
172
+ getPendingTransactions() {
173
+ const deserializedImmutableMap = this._getPending()
174
+ .filter((txs) => txs.size > 0)
175
+ .map((txs) => txs.map(this._deserializeTransaction).toJS());
176
+ return new Map(deserializedImmutableMap.entries());
177
+ }
178
+ getQueuedTransactions() {
179
+ const deserializedImmutableMap = this._getQueued()
180
+ .filter((txs) => txs.size > 0)
181
+ .map((txs) => txs.map(this._deserializeTransaction).toJS());
182
+ return new Map(deserializedImmutableMap.entries());
183
+ }
184
+ /**
185
+ * Returns the next available nonce for an address, taking into account
186
+ * its pending transactions.
187
+ */
188
+ async getNextPendingNonce(accountAddress) {
189
+ const pendingTxs = this._getPendingForAddress(accountAddress.toString());
190
+ const lastPendingTx = pendingTxs?.last(undefined);
191
+ if (lastPendingTx === undefined) {
192
+ return this._getNextConfirmedNonce(accountAddress);
193
+ }
194
+ const lastPendingTxNonce = this._deserializeTransaction(lastPendingTx).data.nonce;
195
+ return lastPendingTxNonce + 1n;
196
+ }
197
+ getBlockGasLimit() {
198
+ return BigInt(this._state.get("blockGasLimit"));
199
+ }
200
+ setBlockGasLimit(newLimit) {
201
+ if (typeof newLimit === "number") {
202
+ newLimit = BigInt(newLimit);
203
+ }
204
+ this._setBlockGasLimit(newLimit);
205
+ }
206
+ /**
207
+ * Updates the pending and queued list of all addresses
208
+ */
209
+ async updatePendingAndQueued() {
210
+ let newPending = this._getPending();
211
+ // update pending transactions
212
+ for (const [address, txs] of newPending) {
213
+ const senderAccount = await this._stateManager.getAccount(ethereumjs_util_1.Address.fromString(address));
214
+ const senderNonce = senderAccount.nonce;
215
+ const senderBalance = senderAccount.balance;
216
+ let moveToQueued = false;
217
+ for (const tx of txs) {
218
+ const deserializedTx = this._deserializeTransaction(tx);
219
+ if (moveToQueued) {
220
+ newPending = this._removeTx(newPending, address, deserializedTx);
221
+ const queued = this._getQueuedForAddress(address) ?? (0, immutable_1.List)();
222
+ this._setQueuedForAddress(address, queued.push(tx));
223
+ continue;
224
+ }
225
+ const txNonce = deserializedTx.data.nonce;
226
+ if (!this._isTxValid(deserializedTx, txNonce, senderNonce, senderBalance)) {
227
+ newPending = this._removeTx(newPending, address, deserializedTx);
228
+ // if we are dropping a pending transaction with a valid nonce,
229
+ // then we move all the following txs to the queued list
230
+ if (txNonce >= senderNonce) {
231
+ moveToQueued = true;
232
+ }
233
+ }
234
+ }
235
+ }
236
+ this._setPending(newPending);
237
+ // update queued addresses
238
+ let newQueued = this._getQueued();
239
+ for (const [address, txs] of newQueued) {
240
+ const senderAccount = await this._stateManager.getAccount(ethereumjs_util_1.Address.fromString(address));
241
+ const senderNonce = senderAccount.nonce;
242
+ const senderBalance = senderAccount.balance;
243
+ for (const tx of txs) {
244
+ const deserializedTx = this._deserializeTransaction(tx);
245
+ const txNonce = deserializedTx.data.nonce;
246
+ if (!this._isTxValid(deserializedTx, txNonce, senderNonce, senderBalance)) {
247
+ newQueued = this._removeTx(newQueued, address, deserializedTx);
248
+ }
249
+ }
250
+ }
251
+ this._setQueued(newQueued);
252
+ }
253
+ _getSenderAddress(tx) {
254
+ try {
255
+ return tx.getSenderAddress(); // verifies signature
256
+ }
257
+ catch (e) {
258
+ if (!tx.isSigned()) {
259
+ throw new errors_1.InvalidInputError("Invalid Signature");
260
+ }
261
+ throw new errors_1.InvalidInputError(e.message);
262
+ }
263
+ }
264
+ _removeSnapshotsAfter(snapshotId) {
265
+ const snapshotIds = [...this._snapshotIdToState.keys()].filter((x) => x >= snapshotId);
266
+ for (const id of snapshotIds) {
267
+ this._snapshotIdToState.delete(id);
268
+ }
269
+ }
270
+ _removeTx(map, address, deserializedTX) {
271
+ const accountTxs = map.get(address);
272
+ if (accountTxs === undefined) {
273
+ throw new Error("Trying to remove a transaction from list that doesn't exist, this should never happen");
274
+ }
275
+ this._deleteTransactionByHash(deserializedTX.data.hash());
276
+ const indexOfTx = accountTxs.indexOf(serializeTransaction(deserializedTX));
277
+ return map.set(address, accountTxs.remove(indexOfTx));
278
+ }
279
+ _addPendingTransaction(tx) {
280
+ const orderedTx = {
281
+ orderId: this._nextOrderId++,
282
+ data: tx,
283
+ };
284
+ const serializedTx = serializeTransaction(orderedTx);
285
+ const hexSenderAddress = tx.getSenderAddress().toString();
286
+ const accountTransactions = this._getPendingForAddress(hexSenderAddress) ?? (0, immutable_1.List)();
287
+ const replaced = this._replacePendingTx(hexSenderAddress, orderedTx);
288
+ if (!replaced) {
289
+ const { newPending, newQueued } = (0, reorganizeTransactionsLists_1.reorganizeTransactionsLists)(accountTransactions.push(serializedTx), this._getQueuedForAddress(hexSenderAddress) ?? (0, immutable_1.List)(), (stx) => this._deserializeTransaction(stx).data.nonce);
290
+ this._setPendingForAddress(hexSenderAddress, newPending);
291
+ this._setQueuedForAddress(hexSenderAddress, newQueued);
292
+ }
293
+ this._setTransactionByHash((0, ethereumjs_util_1.bufferToHex)(tx.hash()), serializedTx);
294
+ }
295
+ _addQueuedTransaction(tx) {
296
+ const orderedTx = {
297
+ orderId: this._nextOrderId++,
298
+ data: tx,
299
+ };
300
+ const serializedTx = serializeTransaction(orderedTx);
301
+ const hexSenderAddress = tx.getSenderAddress().toString();
302
+ const accountTransactions = this._getQueuedForAddress(hexSenderAddress) ?? (0, immutable_1.List)();
303
+ const replaced = this._replaceQueuedTx(hexSenderAddress, orderedTx);
304
+ if (!replaced) {
305
+ this._setQueuedForAddress(hexSenderAddress, accountTransactions.push(serializedTx));
306
+ }
307
+ this._setTransactionByHash((0, ethereumjs_util_1.bufferToHex)(tx.hash()), serializedTx);
308
+ }
309
+ async _validateTransaction(tx, senderAddress, senderNonce) {
310
+ if (this._knownTransaction(tx)) {
311
+ throw new errors_1.InvalidInputError(`Known transaction: ${(0, ethereumjs_util_1.bufferToHex)(tx.hash())}`);
312
+ }
313
+ const txNonce = tx.nonce;
314
+ // Geth returns this error if trying to create a contract and no data is provided
315
+ if (tx.to === undefined && tx.data.length === 0) {
316
+ throw new errors_1.InvalidInputError("contract creation without any data provided");
317
+ }
318
+ const senderAccount = await this._stateManager.getAccount(senderAddress);
319
+ const senderBalance = senderAccount.balance;
320
+ const maxFee = "gasPrice" in tx ? tx.gasPrice : tx.maxFeePerGas;
321
+ const txMaxUpfrontCost = tx.gasLimit * maxFee + tx.value;
322
+ if (txMaxUpfrontCost > senderBalance) {
323
+ throw new errors_1.InvalidInputError(`sender doesn't have enough funds to send tx. The max upfront cost is: ${txMaxUpfrontCost.toString()}` +
324
+ ` and the sender's account only has: ${senderBalance.toString()}`);
325
+ }
326
+ if (txNonce < senderNonce) {
327
+ throw new errors_1.InvalidInputError(`Nonce too low. Expected nonce to be at least ${senderNonce.toString()} but got ${txNonce.toString()}.`);
328
+ }
329
+ const gasLimit = tx.gasLimit;
330
+ const baseFee = tx.getBaseFee();
331
+ if (gasLimit < baseFee) {
332
+ throw new errors_1.InvalidInputError(`Transaction requires at least ${baseFee.toString()} gas but got ${gasLimit.toString()}`);
333
+ }
334
+ const blockGasLimit = this.getBlockGasLimit();
335
+ if (gasLimit > blockGasLimit) {
336
+ throw new errors_1.InvalidInputError(`Transaction gas limit is ${gasLimit.toString()} and exceeds block gas limit of ${blockGasLimit.toString()}`);
337
+ }
338
+ }
339
+ _knownTransaction(tx) {
340
+ const senderAddress = tx.getSenderAddress().toString();
341
+ return (this._transactionExists(tx, this._getPendingForAddress(senderAddress)) ||
342
+ this._transactionExists(tx, this._getQueuedForAddress(senderAddress)));
343
+ }
344
+ _transactionExists(tx, txList) {
345
+ const existingTx = txList?.find((etx) => this._deserializeTransaction(etx).data.hash().equals(tx.hash()));
346
+ return existingTx !== undefined;
347
+ }
348
+ _getTransactionsByHash() {
349
+ return this._state.get("hashToTransaction");
350
+ }
351
+ _getPending() {
352
+ return this._state.get("pendingTransactions");
353
+ }
354
+ _getQueued() {
355
+ return this._state.get("queuedTransactions");
356
+ }
357
+ _getPendingForAddress(address) {
358
+ return this._getPending().get(address);
359
+ }
360
+ _getQueuedForAddress(address) {
361
+ return this._getQueued().get(address);
362
+ }
363
+ _setTransactionByHash(hash, transaction) {
364
+ this._state = this._state.set("hashToTransaction", this._getTransactionsByHash().set(hash, transaction));
365
+ }
366
+ _setPending(transactions) {
367
+ this._state = this._state.set("pendingTransactions", transactions);
368
+ }
369
+ _setQueued(transactions) {
370
+ this._state = this._state.set("queuedTransactions", transactions);
371
+ }
372
+ _setPendingForAddress(address, transactions) {
373
+ this._state = this._state.set("pendingTransactions", this._getPending().set(address, transactions));
374
+ }
375
+ _setQueuedForAddress(address, transactions) {
376
+ this._state = this._state.set("queuedTransactions", this._getQueued().set(address, transactions));
377
+ }
378
+ _setBlockGasLimit(newLimit) {
379
+ this._state = this._state.set("blockGasLimit", BigIntUtils.toHex(newLimit));
380
+ }
381
+ _deleteTransactionByHash(hash) {
382
+ this._state = this._state.set("hashToTransaction", this._getTransactionsByHash().delete((0, ethereumjs_util_1.bufferToHex)(hash)));
383
+ }
384
+ _isTxValid(tx, txNonce, senderNonce, senderBalance) {
385
+ const txGasLimit = tx.data.gasLimit;
386
+ return (txGasLimit <= this.getBlockGasLimit() &&
387
+ txNonce >= senderNonce &&
388
+ tx.data.getUpfrontCost() <= senderBalance);
389
+ }
390
+ /**
391
+ * Returns the next available nonce for an address, ignoring its
392
+ * pending transactions.
393
+ */
394
+ async _getNextConfirmedNonce(accountAddress) {
395
+ const account = await this._stateManager.getAccount(accountAddress);
396
+ return account.nonce;
397
+ }
398
+ /**
399
+ * Checks if some pending tx with the same nonce as `newTx` exists.
400
+ * If it exists, it replaces it with `newTx` and returns true.
401
+ * Otherwise returns false.
402
+ */
403
+ _replacePendingTx(accountAddress, newTx) {
404
+ const pendingTxs = this._getPendingForAddress(accountAddress);
405
+ const newPendingTxs = this._replaceTx(pendingTxs, newTx);
406
+ if (newPendingTxs !== undefined) {
407
+ this._setPendingForAddress(accountAddress, newPendingTxs);
408
+ return true;
409
+ }
410
+ return false;
411
+ }
412
+ /**
413
+ * Checks if some queued tx with the same nonce as `newTx` exists.
414
+ * If it exists, it replaces it with `newTx` and returns true.
415
+ * Otherwise returns false.
416
+ */
417
+ _replaceQueuedTx(accountAddress, newTx) {
418
+ const queuedTxs = this._getQueuedForAddress(accountAddress);
419
+ const newQueuedTxs = this._replaceTx(queuedTxs, newTx);
420
+ if (newQueuedTxs !== undefined) {
421
+ this._setQueuedForAddress(accountAddress, newQueuedTxs);
422
+ return true;
423
+ }
424
+ return false;
425
+ }
426
+ _replaceTx(txs, newTx) {
427
+ if (txs === undefined) {
428
+ return;
429
+ }
430
+ const existingTxEntry = txs.findEntry((tx) => this._deserializeTransaction(tx).data.nonce === newTx.data.nonce);
431
+ if (existingTxEntry === undefined) {
432
+ return;
433
+ }
434
+ const [existingTxIndex, existingTx] = existingTxEntry;
435
+ const deserializedExistingTx = this._deserializeTransaction(existingTx);
436
+ const currentMaxFeePerGas = "gasPrice" in deserializedExistingTx.data
437
+ ? deserializedExistingTx.data.gasPrice
438
+ : deserializedExistingTx.data.maxFeePerGas;
439
+ const currentPriorityFeePerGas = "gasPrice" in deserializedExistingTx.data
440
+ ? deserializedExistingTx.data.gasPrice
441
+ : deserializedExistingTx.data.maxPriorityFeePerGas;
442
+ const newMaxFeePerGas = "gasPrice" in newTx.data ? newTx.data.gasPrice : newTx.data.maxFeePerGas;
443
+ const newPriorityFeePerGas = "gasPrice" in newTx.data
444
+ ? newTx.data.gasPrice
445
+ : newTx.data.maxPriorityFeePerGas;
446
+ const minNewMaxFeePerGas = this._getMinNewFeePrice(currentMaxFeePerGas);
447
+ const minNewPriorityFeePerGas = this._getMinNewFeePrice(currentPriorityFeePerGas);
448
+ if (newMaxFeePerGas < minNewMaxFeePerGas) {
449
+ throw new errors_1.InvalidInputError(`Replacement transaction underpriced. A gasPrice/maxFeePerGas of at least ${minNewMaxFeePerGas.toString()} is necessary to replace the existing transaction with nonce ${newTx.data.nonce.toString()}.`);
450
+ }
451
+ if (newPriorityFeePerGas < minNewPriorityFeePerGas) {
452
+ throw new errors_1.InvalidInputError(`Replacement transaction underpriced. A gasPrice/maxPriorityFeePerGas of at least ${minNewPriorityFeePerGas.toString()} is necessary to replace the existing transaction with nonce ${newTx.data.nonce.toString()}.`);
453
+ }
454
+ const newTxs = txs.set(existingTxIndex, serializeTransaction(newTx));
455
+ this._deleteTransactionByHash(deserializedExistingTx.data.hash());
456
+ return newTxs;
457
+ }
458
+ _getMinNewFeePrice(feePrice) {
459
+ let minNewPriorityFee = feePrice * 110n;
460
+ if (minNewPriorityFee % 100n === 0n) {
461
+ minNewPriorityFee = minNewPriorityFee / 100n;
462
+ }
463
+ else {
464
+ minNewPriorityFee = minNewPriorityFee / 100n + 1n;
465
+ }
466
+ return minNewPriorityFee;
467
+ }
468
+ }
469
+ exports.TxPool = TxPool;
470
+ //# sourceMappingURL=TxPool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ardhat-network/provider/ethereumjs-workarounds.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ethereumjs_tx_1 = require("@nomicfoundation/ethereumjs-tx");
4
+ const baseTransaction_1 = require("@nomicfoundation/ethereumjs-tx/dist/baseTransaction");
5
+ // This is a hack to prevent Block.fromBlockData from recreating our
6
+ // transactions and changing their types. Note fromBlockData is used
7
+ // by the BlockBuilder to update block it's building.
8
+ const previousFromTxData = ethereumjs_tx_1.TransactionFactory.fromTxData;
9
+ ethereumjs_tx_1.TransactionFactory.fromTxData = function (txData, txOptions) {
10
+ if (txData instanceof baseTransaction_1.BaseTransaction) {
11
+ return txData;
12
+ }
13
+ return previousFromTxData.call(this, txData, txOptions);
14
+ };
15
+ //# sourceMappingURL=ethereumjs-workarounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ethereumjs-workarounds.js","sourceRoot":"","sources":["../../../src/internal/hardhat-network/provider/ethereumjs-workarounds.ts"],"names":[],"mappings":";;AAAA,kEAAoE;AACpE,yFAAsF;AAOtF,oEAAoE;AACpE,oEAAoE;AACpE,qDAAqD;AACrD,MAAM,kBAAkB,GAAG,kCAAkB,CAAC,UAAU,CAAC;AACxD,kCAA0B,CAAC,UAAU,GAAG,UACvC,MAAwC,EACxC,SAAqB;IAErB,IAAI,MAAM,YAAY,iCAAe,EAAE;QACrC,OAAO,MAAM,CAAC;KACf;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAC1D,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /// <reference types="node" />
2
+ import { Bloom } from "@nomicfoundation/ethereumjs-vm";
3
+ import { RpcLogOutput } from "./output";
4
+ export declare const LATEST_BLOCK = -1n;
5
+ export declare enum Type {
6
+ LOGS_SUBSCRIPTION = 0,
7
+ PENDING_TRANSACTION_SUBSCRIPTION = 1,
8
+ BLOCK_SUBSCRIPTION = 2
9
+ }
10
+ export interface FilterCriteria {
11
+ fromBlock: bigint;
12
+ toBlock: bigint;
13
+ addresses: Buffer[];
14
+ normalizedTopics: Array<Array<Buffer | null> | null>;
15
+ }
16
+ export interface Filter {
17
+ id: bigint;
18
+ type: Type;
19
+ criteria?: FilterCriteria;
20
+ deadline: Date;
21
+ hashes: string[];
22
+ logs: RpcLogOutput[];
23
+ subscription: boolean;
24
+ }
25
+ export declare function bloomFilter(bloom: Bloom, addresses: Buffer[], normalizedTopics: Array<Array<Buffer | null> | null>): boolean;
26
+ export declare function filterLogs(logs: RpcLogOutput[], criteria: FilterCriteria): RpcLogOutput[];
27
+ export declare function includes(addresses: Buffer[], a: Buffer): boolean;
28
+ export declare function topicMatched(normalizedTopics: Array<Array<Buffer | null> | null>, logTopics: string[]): boolean;
29
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/internal/hardhat-network/provider/filter.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,oBAAY,IAAI;IACd,iBAAiB,IAAI;IACrB,gCAAgC,IAAI;IACpC,kBAAkB,IAAI;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,I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