@aztec/end-to-end 0.0.0-test.1 → 0.0.1-commit.017a351

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 (316) hide show
  1. package/README.md +27 -0
  2. package/dest/bench/client_flows/benchmark.d.ts +76 -0
  3. package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
  4. package/dest/bench/client_flows/benchmark.js +298 -0
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts +79 -0
  6. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
  7. package/dest/bench/client_flows/client_flows_benchmark.js +318 -0
  8. package/dest/bench/client_flows/config.d.ts +14 -0
  9. package/dest/bench/client_flows/config.d.ts.map +1 -0
  10. package/dest/bench/client_flows/config.js +124 -0
  11. package/dest/bench/client_flows/data_extractor.d.ts +2 -0
  12. package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
  13. package/dest/bench/client_flows/data_extractor.js +79 -0
  14. package/dest/bench/utils.d.ts +16 -41
  15. package/dest/bench/utils.d.ts.map +1 -1
  16. package/dest/bench/utils.js +46 -72
  17. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +30 -20
  18. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  19. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +137 -106
  20. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +44 -33
  21. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  22. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +136 -103
  23. package/dest/e2e_deploy_contract/deploy_test.d.ts +20 -11
  24. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  25. package/dest/e2e_deploy_contract/deploy_test.js +28 -28
  26. package/dest/e2e_epochs/epochs_test.d.ts +98 -24
  27. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  28. package/dest/e2e_epochs/epochs_test.js +366 -61
  29. package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
  30. package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
  31. package/dest/e2e_fees/bridging_race.notest.js +61 -0
  32. package/dest/e2e_fees/fees_test.d.ts +42 -24
  33. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  34. package/dest/e2e_fees/fees_test.js +194 -182
  35. package/dest/e2e_l1_publisher/write_json.d.ts +11 -0
  36. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
  37. package/dest/e2e_l1_publisher/write_json.js +56 -0
  38. package/dest/e2e_multi_validator/utils.d.ts +12 -0
  39. package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
  40. package/dest/e2e_multi_validator/utils.js +214 -0
  41. package/dest/e2e_nested_contract/nested_contract_test.d.ts +16 -16
  42. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  43. package/dest/e2e_nested_contract/nested_contract_test.js +38 -43
  44. package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
  45. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
  46. package/dest/e2e_p2p/inactivity_slash_test.js +137 -0
  47. package/dest/e2e_p2p/p2p_network.d.ts +287 -31
  48. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  49. package/dest/e2e_p2p/p2p_network.js +281 -183
  50. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  51. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  52. package/dest/e2e_p2p/reqresp/utils.js +206 -0
  53. package/dest/e2e_p2p/shared.d.ts +73 -8
  54. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  55. package/dest/e2e_p2p/shared.js +205 -27
  56. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  57. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  58. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  59. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  60. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  61. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  62. package/dest/e2e_token_contract/token_contract_test.d.ts +30 -15
  63. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  64. package/dest/e2e_token_contract/token_contract_test.js +110 -76
  65. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  66. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  67. package/dest/fixtures/authwit_proxy.js +34 -0
  68. package/dest/fixtures/e2e_prover_test.d.ts +56 -0
  69. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
  70. package/dest/fixtures/e2e_prover_test.js +267 -0
  71. package/dest/fixtures/elu_monitor.d.ts +21 -0
  72. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  73. package/dest/fixtures/elu_monitor.js +102 -0
  74. package/dest/fixtures/fixtures.d.ts +79 -8
  75. package/dest/fixtures/fixtures.d.ts.map +1 -1
  76. package/dest/fixtures/fixtures.js +76 -5
  77. package/dest/fixtures/get_acvm_config.d.ts +2 -2
  78. package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
  79. package/dest/fixtures/get_acvm_config.js +3 -15
  80. package/dest/fixtures/get_bb_config.d.ts +2 -2
  81. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  82. package/dest/fixtures/get_bb_config.js +10 -17
  83. package/dest/fixtures/ha_setup.d.ts +71 -0
  84. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  85. package/dest/fixtures/ha_setup.js +116 -0
  86. package/dest/fixtures/index.d.ts +2 -1
  87. package/dest/fixtures/index.d.ts.map +1 -1
  88. package/dest/fixtures/index.js +1 -0
  89. package/dest/fixtures/l1_to_l2_messaging.d.ts +11 -7
  90. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  91. package/dest/fixtures/l1_to_l2_messaging.js +45 -19
  92. package/dest/fixtures/logging.d.ts +1 -1
  93. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  94. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  95. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  96. package/dest/fixtures/setup.d.ts +272 -0
  97. package/dest/fixtures/setup.d.ts.map +1 -0
  98. package/dest/fixtures/setup.js +735 -0
  99. package/dest/fixtures/setup_p2p_test.d.ts +28 -16
  100. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  101. package/dest/fixtures/setup_p2p_test.js +103 -32
  102. package/dest/fixtures/token_utils.d.ts +10 -4
  103. package/dest/fixtures/token_utils.d.ts.map +1 -1
  104. package/dest/fixtures/token_utils.js +30 -13
  105. package/dest/fixtures/utils.d.ts +5 -153
  106. package/dest/fixtures/utils.d.ts.map +1 -1
  107. package/dest/fixtures/utils.js +4 -552
  108. package/dest/fixtures/web3signer.d.ts +5 -0
  109. package/dest/fixtures/web3signer.d.ts.map +1 -0
  110. package/dest/fixtures/web3signer.js +53 -0
  111. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  112. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  113. package/dest/fixtures/with_telemetry_utils.js +2 -2
  114. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  115. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  116. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  117. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  118. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  119. package/dest/forward-compatibility/wallet_service.js +109 -0
  120. package/dest/index.d.ts +1 -1
  121. package/dest/install_legacy_contracts.d.cts +10 -0
  122. package/dest/install_legacy_contracts.d.cts.map +1 -0
  123. package/dest/legacy-jest-resolver.d.cts +3 -0
  124. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  125. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  126. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  127. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  128. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  129. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  130. package/dest/quality_of_service/prometheus_client.js +67 -0
  131. package/dest/shared/cross_chain_test_harness.d.ts +46 -27
  132. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  133. package/dest/shared/cross_chain_test_harness.js +113 -55
  134. package/dest/shared/gas_portal_test_harness.d.ts +39 -28
  135. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  136. package/dest/shared/gas_portal_test_harness.js +64 -34
  137. package/dest/shared/index.d.ts +3 -2
  138. package/dest/shared/index.d.ts.map +1 -1
  139. package/dest/shared/index.js +1 -0
  140. package/dest/shared/jest_setup.d.ts +1 -1
  141. package/dest/shared/jest_setup.js +42 -2
  142. package/dest/shared/mock_state_view.d.ts +86 -0
  143. package/dest/shared/mock_state_view.d.ts.map +1 -0
  144. package/dest/shared/mock_state_view.js +186 -0
  145. package/dest/shared/submit-transactions.d.ts +6 -4
  146. package/dest/shared/submit-transactions.d.ts.map +1 -1
  147. package/dest/shared/submit-transactions.js +15 -16
  148. package/dest/shared/uniswap_l1_l2.d.ts +3 -25
  149. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  150. package/dest/shared/uniswap_l1_l2.js +202 -135
  151. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  152. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  153. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  154. package/dest/simulators/index.d.ts +1 -1
  155. package/dest/simulators/lending_simulator.d.ts +16 -9
  156. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  157. package/dest/simulators/lending_simulator.js +38 -27
  158. package/dest/simulators/token_simulator.d.ts +6 -3
  159. package/dest/simulators/token_simulator.d.ts.map +1 -1
  160. package/dest/simulators/token_simulator.js +12 -30
  161. package/dest/spartan/setup_test_wallets.d.ts +36 -11
  162. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  163. package/dest/spartan/setup_test_wallets.js +301 -63
  164. package/dest/spartan/tx_metrics.d.ts +102 -0
  165. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  166. package/dest/spartan/tx_metrics.js +475 -0
  167. package/dest/spartan/utils/bot.d.ts +28 -0
  168. package/dest/spartan/utils/bot.d.ts.map +1 -0
  169. package/dest/spartan/utils/bot.js +142 -0
  170. package/dest/spartan/utils/chaos.d.ts +79 -0
  171. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  172. package/dest/spartan/utils/chaos.js +142 -0
  173. package/dest/spartan/utils/clients.d.ts +39 -0
  174. package/dest/spartan/utils/clients.d.ts.map +1 -0
  175. package/dest/spartan/utils/clients.js +90 -0
  176. package/dest/spartan/utils/config.d.ts +19 -0
  177. package/dest/spartan/utils/config.d.ts.map +1 -0
  178. package/dest/spartan/utils/config.js +23 -0
  179. package/dest/spartan/utils/health.d.ts +63 -0
  180. package/dest/spartan/utils/health.d.ts.map +1 -0
  181. package/dest/spartan/utils/health.js +202 -0
  182. package/dest/spartan/utils/helm.d.ts +15 -0
  183. package/dest/spartan/utils/helm.d.ts.map +1 -0
  184. package/dest/spartan/utils/helm.js +47 -0
  185. package/dest/spartan/utils/index.d.ts +11 -0
  186. package/dest/spartan/utils/index.d.ts.map +1 -0
  187. package/dest/spartan/utils/index.js +22 -0
  188. package/dest/spartan/utils/k8s.d.ts +128 -0
  189. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  190. package/dest/spartan/utils/k8s.js +381 -0
  191. package/dest/spartan/utils/nodes.d.ts +40 -0
  192. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  193. package/dest/spartan/utils/nodes.js +461 -0
  194. package/dest/spartan/utils/pod_logs.d.ts +25 -0
  195. package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
  196. package/dest/spartan/utils/pod_logs.js +74 -0
  197. package/dest/spartan/utils/scripts.d.ts +30 -0
  198. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  199. package/dest/spartan/utils/scripts.js +81 -0
  200. package/dest/spartan/utils.d.ts +2 -415
  201. package/dest/spartan/utils.d.ts.map +1 -1
  202. package/dest/spartan/utils.js +1 -445
  203. package/dest/test-wallet/test_wallet.d.ts +85 -0
  204. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  205. package/dest/test-wallet/test_wallet.js +273 -0
  206. package/dest/test-wallet/utils.d.ts +41 -0
  207. package/dest/test-wallet/utils.d.ts.map +1 -0
  208. package/dest/test-wallet/utils.js +66 -0
  209. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  210. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  211. package/dest/test-wallet/wallet_worker_script.js +53 -0
  212. package/dest/test-wallet/worker_wallet.d.ts +53 -0
  213. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  214. package/dest/test-wallet/worker_wallet.js +155 -0
  215. package/dest/test-wallet/worker_wallet_schema.d.ts +160 -0
  216. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  217. package/dest/test-wallet/worker_wallet_schema.js +22 -0
  218. package/package.json +79 -64
  219. package/src/bench/client_flows/benchmark.ts +382 -0
  220. package/src/bench/client_flows/client_flows_benchmark.ts +399 -0
  221. package/src/bench/client_flows/config.ts +69 -0
  222. package/src/bench/client_flows/data_extractor.ts +89 -0
  223. package/src/bench/utils.ts +49 -87
  224. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +164 -172
  225. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +194 -183
  226. package/src/e2e_deploy_contract/deploy_test.ts +42 -49
  227. package/src/e2e_epochs/epochs_test.ts +451 -93
  228. package/src/e2e_fees/bridging_race.notest.ts +74 -0
  229. package/src/e2e_fees/fees_test.ts +249 -262
  230. package/src/e2e_l1_publisher/write_json.ts +77 -0
  231. package/src/e2e_multi_validator/utils.ts +258 -0
  232. package/src/e2e_nested_contract/nested_contract_test.ts +51 -60
  233. package/src/e2e_p2p/inactivity_slash_test.ts +180 -0
  234. package/src/e2e_p2p/p2p_network.ts +391 -240
  235. package/src/e2e_p2p/reqresp/utils.ts +274 -0
  236. package/src/e2e_p2p/shared.ts +304 -39
  237. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  238. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  239. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  240. package/src/e2e_token_contract/token_contract_test.ts +140 -124
  241. package/src/fixtures/authwit_proxy.ts +54 -0
  242. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  243. package/src/fixtures/e2e_prover_test.ts +329 -0
  244. package/src/fixtures/elu_monitor.ts +126 -0
  245. package/src/fixtures/fixtures.ts +98 -7
  246. package/src/fixtures/get_acvm_config.ts +4 -12
  247. package/src/fixtures/get_bb_config.ts +19 -13
  248. package/src/fixtures/ha_setup.ts +188 -0
  249. package/src/fixtures/index.ts +1 -0
  250. package/src/fixtures/l1_to_l2_messaging.ts +56 -24
  251. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  252. package/src/fixtures/setup.ts +1056 -0
  253. package/src/fixtures/setup_p2p_test.ts +142 -54
  254. package/src/fixtures/token_utils.ts +34 -16
  255. package/src/fixtures/utils.ts +29 -820
  256. package/src/fixtures/web3signer.ts +63 -0
  257. package/src/fixtures/with_telemetry_utils.ts +2 -2
  258. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  259. package/src/forward-compatibility/wallet_service.ts +104 -0
  260. package/src/guides/up_quick_start.sh +9 -19
  261. package/src/install_legacy_contracts.cjs +75 -0
  262. package/src/legacy-jest-resolver.cjs +112 -0
  263. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +2 -2
  264. package/src/quality_of_service/prometheus_client.ts +113 -0
  265. package/src/shared/cross_chain_test_harness.ts +116 -90
  266. package/src/shared/gas_portal_test_harness.ts +75 -56
  267. package/src/shared/index.ts +2 -1
  268. package/src/shared/jest_setup.ts +52 -2
  269. package/src/shared/mock_state_view.ts +188 -0
  270. package/src/shared/submit-transactions.ts +19 -20
  271. package/src/shared/uniswap_l1_l2.ts +259 -234
  272. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  273. package/src/simulators/lending_simulator.ts +43 -26
  274. package/src/simulators/token_simulator.ts +18 -34
  275. package/src/spartan/DEVELOP.md +128 -0
  276. package/src/spartan/setup_test_wallets.ts +420 -96
  277. package/src/spartan/tx_metrics.ts +434 -0
  278. package/src/spartan/utils/bot.ts +188 -0
  279. package/src/spartan/utils/chaos.ts +253 -0
  280. package/src/spartan/utils/clients.ts +100 -0
  281. package/src/spartan/utils/config.ts +29 -0
  282. package/src/spartan/utils/health.ts +255 -0
  283. package/src/spartan/utils/helm.ts +84 -0
  284. package/src/spartan/utils/index.ts +71 -0
  285. package/src/spartan/utils/k8s.ts +535 -0
  286. package/src/spartan/utils/nodes.ts +543 -0
  287. package/src/spartan/utils/pod_logs.ts +99 -0
  288. package/src/spartan/utils/scripts.ts +99 -0
  289. package/src/spartan/utils.ts +1 -582
  290. package/src/test-wallet/test_wallet.ts +376 -0
  291. package/src/test-wallet/utils.ts +108 -0
  292. package/src/test-wallet/wallet_worker_script.ts +63 -0
  293. package/src/test-wallet/worker_wallet.ts +218 -0
  294. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  295. package/dest/e2e_prover/e2e_prover_test.d.ts +0 -56
  296. package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
  297. package/dest/e2e_prover/e2e_prover_test.js +0 -291
  298. package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
  299. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  300. package/dest/fixtures/setup_l1_contracts.js +0 -17
  301. package/dest/fixtures/snapshot_manager.d.ts +0 -87
  302. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  303. package/dest/fixtures/snapshot_manager.js +0 -479
  304. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  305. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  306. package/dest/sample-dapp/connect.js +0 -12
  307. package/dest/sample-dapp/contracts.js +0 -10
  308. package/dest/sample-dapp/deploy.js +0 -35
  309. package/dest/sample-dapp/index.js +0 -98
  310. package/src/e2e_prover/e2e_prover_test.ts +0 -418
  311. package/src/fixtures/setup_l1_contracts.ts +0 -27
  312. package/src/fixtures/snapshot_manager.ts +0 -617
  313. package/src/sample-dapp/connect.mjs +0 -16
  314. package/src/sample-dapp/contracts.mjs +0 -14
  315. package/src/sample-dapp/deploy.mjs +0 -40
  316. package/src/sample-dapp/index.mjs +0 -128
@@ -1,6 +1,12 @@
1
- import { createLogger } from '@aztec/aztec.js';
2
- import { beforeEach, expect } from '@jest/globals';
1
+ import { createLogger } from '@aztec/aztec.js/log';
2
+ import { afterAll, afterEach, beforeEach, expect } from '@jest/globals';
3
+ import { readlinkSync } from 'fs';
3
4
  import { basename } from 'path';
5
+ import { EluMonitor } from '../fixtures/elu_monitor.js';
6
+ const eluMonitor = process.env.ELU_MONITOR_FILE ? new EluMonitor(process.env.ELU_MONITOR_FILE, Number(process.env.ELU_MONITOR_INTERVAL_MS) || undefined) : undefined;
7
+ if (eluMonitor) {
8
+ process.on('exit', ()=>eluMonitor.stop());
9
+ }
4
10
  beforeEach(()=>{
5
11
  const { testPath, currentTestName } = expect.getState();
6
12
  if (!testPath || !currentTestName) {
@@ -8,4 +14,38 @@ beforeEach(()=>{
8
14
  }
9
15
  const logger = createLogger(`e2e:${basename(testPath).replace('.test.ts', '')}`);
10
16
  logger.info(`Running test: ${currentTestName}`);
17
+ eluMonitor?.startTest(currentTestName);
18
+ });
19
+ afterEach(()=>{
20
+ eluMonitor?.stopTest();
21
+ });
22
+ // Log leaked handles after all tests complete. This runs after test-level afterAll hooks,
23
+ // so any handles still alive at this point were not properly cleaned up during teardown.
24
+ // This diagnostic helps identify the source of exit hangs without masking them.
25
+ afterAll(()=>{
26
+ const handles = process._getActiveHandles();
27
+ if (handles.length > 0) {
28
+ const details = handles.map((h)=>{
29
+ const type = h?.constructor?.name ?? typeof h;
30
+ const fd = h?.fd ?? h?._handle?.fd ?? '?';
31
+ const destroyed = h?.destroyed ?? '?';
32
+ const hasRef = typeof h?.hasRef === 'function' ? h.hasRef() : '?';
33
+ const localAddr = h?.localAddress ?? '';
34
+ const remoteAddr = h?.remoteAddress ?? '';
35
+ const localPort = h?.localPort ?? '';
36
+ const remotePort = h?.remotePort ?? '';
37
+ const proto = Object.getPrototypeOf(h)?.constructor?.name ?? '?';
38
+ const keys = Object.keys(h).slice(0, 10).join(',');
39
+ let fdTarget = '';
40
+ if (typeof fd === 'number') {
41
+ try {
42
+ fdTarget = ` -> ${readlinkSync(`/proc/self/fd/${fd}`)}`;
43
+ } catch {
44
+ // ignore
45
+ }
46
+ }
47
+ return ` ${type}(fd=${fd}, destroyed=${destroyed}, hasRef=${hasRef}${fdTarget}) proto=${proto} addr=${localAddr}:${localPort}->${remoteAddr}:${remotePort} keys=[${keys}]`;
48
+ });
49
+ process.stderr.write(`\n[jest_setup] WARNING: ${handles.length} handle(s) still active after teardown:\n${details.join('\n')}\n` + `These may prevent Jest from exiting. Investigate and fix the leak.\n\n`);
50
+ }
11
51
  });
@@ -0,0 +1,86 @@
1
+ import { EthAddress } from '@aztec/aztec.js/addresses';
2
+ import type { EthCheatCodes } from '@aztec/aztec/testing';
3
+ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
4
+ /**
5
+ * Mock StateView contract for testing the Uniswap price oracle.
6
+ *
7
+ * Wraps a compiled Solidity contract that mimics the Uniswap V4 StateView's getSlot0 function.
8
+ * The mock allows setting return values dynamically for testing different price scenarios.
9
+ *
10
+ * Solidity source:
11
+ * ```solidity
12
+ * // SPDX-License-Identifier: Apache-2.0
13
+ * pragma solidity >=0.8.27;
14
+ *
15
+ * contract MockStateView {
16
+ * uint160 public sqrtPriceX96;
17
+ * int24 public tick;
18
+ * uint24 public protocolFee;
19
+ * uint24 public lpFee;
20
+ *
21
+ * function setReturnValues(
22
+ * uint160 _sqrtPriceX96,
23
+ * int24 _tick,
24
+ * uint24 _protocolFee,
25
+ * uint24 _lpFee
26
+ * ) external {
27
+ * sqrtPriceX96 = _sqrtPriceX96;
28
+ * tick = _tick;
29
+ * protocolFee = _protocolFee;
30
+ * lpFee = _lpFee;
31
+ * }
32
+ *
33
+ * function getSlot0(bytes32 poolId) external view returns (uint160, int24, uint24, uint24) {
34
+ * return (sqrtPriceX96, tick, protocolFee, lpFee);
35
+ * }
36
+ * }
37
+ * ```
38
+ */
39
+ export declare class MockStateView {
40
+ private readonly address;
41
+ private readonly walletClient;
42
+ private readonly log;
43
+ private static readonly BYTECODE;
44
+ private static readonly ABI;
45
+ private constructor();
46
+ /**
47
+ * Deploys the mock StateView contract at the specified address using etch.
48
+ * @param ethCheatCodes - Cheat codes for etching bytecode
49
+ * @param walletClient - Wallet client for sending transactions
50
+ * @param address - Address to deploy the mock at (typically the real StateView address)
51
+ */
52
+ static deploy(ethCheatCodes: EthCheatCodes, walletClient: ExtendedViemWalletClient, address: EthAddress): Promise<MockStateView>;
53
+ /**
54
+ * Sets the price using the ethPerFeeAssetE12 format (same as rollup contract).
55
+ * Computes the corresponding sqrtPriceX96 internally.
56
+ *
57
+ * Math (from fee_asset_price_oracle.ts):
58
+ * ethPerFeeAssetE12 = 1e12 * 2^192 / sqrtPriceX96^2
59
+ *
60
+ * Inverted:
61
+ * sqrtPriceX96^2 = 1e12 * 2^192 / ethPerFeeAssetE12
62
+ * sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
63
+ *
64
+ * @param ethPerFeeAssetE12 - The price in ETH per fee asset, scaled by 1e12
65
+ */
66
+ setEthPerFeeAsset(ethPerFeeAssetE12: bigint): Promise<import("viem").TransactionReceipt>;
67
+ /**
68
+ * Sets the sqrtPriceX96 value directly (Uniswap's price encoding).
69
+ * @param sqrtPriceX96 - The sqrtPriceX96 value
70
+ * @param tick - The tick value (default 10)
71
+ * @param protocolFee - The protocol fee (default 0)
72
+ * @param lpFee - The LP fee (default 500)
73
+ */
74
+ setSqrtPriceX96(sqrtPriceX96: bigint, tick?: number, protocolFee?: number, lpFee?: number): Promise<import("viem").TransactionReceipt>;
75
+ /**
76
+ * Converts ethPerFeeAssetE12 to sqrtPriceX96 (inverse of sqrtPriceX96ToEthPerFeeAssetE12).
77
+ *
78
+ * Math:
79
+ * sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
80
+ */
81
+ ethPerFeeAssetE12ToSqrtPriceX96(ethPerFeeAssetE12: bigint): bigint;
82
+ /** Integer square root using Newton's method */
83
+ bigintSqrt(n: bigint): bigint;
84
+ }
85
+ export declare function diffInBps(a: bigint, b: bigint): bigint;
86
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ja19zdGF0ZV92aWV3LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2hhcmVkL21vY2tfc3RhdGVfdmlldy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFdkQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDMUQsT0FBTyxLQUFLLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUl0RTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtDRztBQUNILHFCQUFhLGFBQWE7SUFxRHRCLE9BQU8sQ0FBQyxRQUFRLENBQUMsT0FBTztJQUN4QixPQUFPLENBQUMsUUFBUSxDQUFDLFlBQVk7SUFDN0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHO0lBdER0QixPQUFPLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQ20rRTtJQUNuZ0YsT0FBTyxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsR0FBRyxDQStDaEI7SUFFWCxPQUFPLGVBSUg7SUFFSjs7Ozs7T0FLRztJQUNILE9BQWEsTUFBTSxDQUNqQixhQUFhLEVBQUUsYUFBYSxFQUM1QixZQUFZLEVBQUUsd0JBQXdCLEVBQ3RDLE9BQU8sRUFBRSxVQUFVLEdBQ2xCLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FHeEI7SUFFRDs7Ozs7Ozs7Ozs7O09BWUc7SUFDRyxpQkFBaUIsQ0FBQyxpQkFBaUIsRUFBRSxNQUFNLDhDQUdoRDtJQUVEOzs7Ozs7T0FNRztJQUNHLGVBQWUsQ0FBQyxZQUFZLEVBQUUsTUFBTSxFQUFFLElBQUksR0FBRSxNQUFXLEVBQUUsV0FBVyxHQUFFLE1BQVUsRUFBRSxLQUFLLEdBQUUsTUFBWSw4Q0FVMUc7SUFFRDs7Ozs7T0FLRztJQUNILCtCQUErQixDQUFDLGlCQUFpQixFQUFFLE1BQU0sR0FBRyxNQUFNLENBT2pFO0lBRUQsZ0RBQWdEO0lBQ2hELFVBQVUsQ0FBQyxDQUFDLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FjNUI7Q0FDRjtBQUVELHdCQUFnQixTQUFTLENBQUMsQ0FBQyxFQUFFLE1BQU0sRUFBRSxDQUFDLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FFdEQifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock_state_view.d.ts","sourceRoot":"","sources":["../../src/shared/mock_state_view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,aAAa;IAqDtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG;IAtDtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CACm+E;IACngF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CA+ChB;IAEX,OAAO,eAIH;IAEJ;;;;;OAKG;IACH,OAAa,MAAM,CACjB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,wBAAwB,EACtC,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,aAAa,CAAC,CAGxB;IAED;;;;;;;;;;;;OAYG;IACG,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,8CAGhD;IAED;;;;;;OAMG;IACG,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,EAAE,WAAW,GAAE,MAAU,EAAE,KAAK,GAAE,MAAY,8CAU1G;IAED;;;;;OAKG;IACH,+BAA+B,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAOjE;IAED,gDAAgD;IAChD,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAc5B;CACF;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -0,0 +1,186 @@
1
+ import { createLogger } from '@aztec/aztec.js/log';
2
+ import { getContract } from 'viem';
3
+ /**
4
+ * Mock StateView contract for testing the Uniswap price oracle.
5
+ *
6
+ * Wraps a compiled Solidity contract that mimics the Uniswap V4 StateView's getSlot0 function.
7
+ * The mock allows setting return values dynamically for testing different price scenarios.
8
+ *
9
+ * Solidity source:
10
+ * ```solidity
11
+ * // SPDX-License-Identifier: Apache-2.0
12
+ * pragma solidity >=0.8.27;
13
+ *
14
+ * contract MockStateView {
15
+ * uint160 public sqrtPriceX96;
16
+ * int24 public tick;
17
+ * uint24 public protocolFee;
18
+ * uint24 public lpFee;
19
+ *
20
+ * function setReturnValues(
21
+ * uint160 _sqrtPriceX96,
22
+ * int24 _tick,
23
+ * uint24 _protocolFee,
24
+ * uint24 _lpFee
25
+ * ) external {
26
+ * sqrtPriceX96 = _sqrtPriceX96;
27
+ * tick = _tick;
28
+ * protocolFee = _protocolFee;
29
+ * lpFee = _lpFee;
30
+ * }
31
+ *
32
+ * function getSlot0(bytes32 poolId) external view returns (uint160, int24, uint24, uint24) {
33
+ * return (sqrtPriceX96, tick, protocolFee, lpFee);
34
+ * }
35
+ * }
36
+ * ```
37
+ */ export class MockStateView {
38
+ address;
39
+ walletClient;
40
+ log;
41
+ static BYTECODE = '0x608060405234801561000f575f5ffd5b5060043610610060575f3560e01c80633eaf5d9f14610064578063704ce43e146100825780638db791d2146100a0578063b0e21e8a146100be578063b52e4bdd146100dc578063c815641c146100f8575b5f5ffd5b61006c61012b565b60405161007991906102ab565b60405180910390f35b61008a61013d565b60405161009791906102e1565b60405180910390f35b6100a8610151565b6040516100b59190610328565b60405180910390f35b6100c6610175565b6040516100d391906102e1565b60405180910390f35b6100f660048036038101906100f191906103c3565b610189565b005b610112600480360381019061010d919061045a565b61022b565b6040516101229493929190610485565b60405180910390f35b5f60149054906101000a900460020b81565b5f601a9054906101000a900462ffffff1681565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60179054906101000a900462ffffff1681565b835f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825f60146101000a81548162ffffff021916908360020b62ffffff160217905550815f60176101000a81548162ffffff021916908362ffffff160217905550805f601a6101000a81548162ffffff021916908362ffffff16021790555050505050565b5f5f5f5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff165f60149054906101000a900460020b5f60179054906101000a900462ffffff165f601a9054906101000a900462ffffff1693509350935093509193509193565b5f8160020b9050919050565b6102a581610290565b82525050565b5f6020820190506102be5f83018461029c565b92915050565b5f62ffffff82169050919050565b6102db816102c4565b82525050565b5f6020820190506102f45f8301846102d2565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b610322816102fa565b82525050565b5f60208201905061033b5f830184610319565b92915050565b5f5ffd5b61034e816102fa565b8114610358575f5ffd5b50565b5f8135905061036981610345565b92915050565b61037881610290565b8114610382575f5ffd5b50565b5f813590506103938161036f565b92915050565b6103a2816102c4565b81146103ac575f5ffd5b50565b5f813590506103bd81610399565b92915050565b5f5f5f5f608085870312156103db576103da610341565b5b5f6103e88782880161035b565b94505060206103f987828801610385565b935050604061040a878288016103af565b925050606061041b878288016103af565b91505092959194509250565b5f819050919050565b61043981610427565b8114610443575f5ffd5b50565b5f8135905061045481610430565b92915050565b5f6020828403121561046f5761046e610341565b5b5f61047c84828501610446565b91505092915050565b5f6080820190506104985f830187610319565b6104a5602083018661029c565b6104b260408301856102d2565b6104bf60608301846102d2565b9594505050505056fea2646970667358221220f8b1bfff284535bc078368ed34bd5e78981644845f3c9c1f5a4b8448c976805464736f6c634300081f0033';
42
+ static ABI = [
43
+ {
44
+ type: 'function',
45
+ name: 'setReturnValues',
46
+ inputs: [
47
+ {
48
+ name: '_sqrtPriceX96',
49
+ type: 'uint160'
50
+ },
51
+ {
52
+ name: '_tick',
53
+ type: 'int24'
54
+ },
55
+ {
56
+ name: '_protocolFee',
57
+ type: 'uint24'
58
+ },
59
+ {
60
+ name: '_lpFee',
61
+ type: 'uint24'
62
+ }
63
+ ],
64
+ outputs: [],
65
+ stateMutability: 'nonpayable'
66
+ },
67
+ {
68
+ inputs: [
69
+ {
70
+ internalType: 'bytes32',
71
+ name: 'poolId',
72
+ type: 'bytes32'
73
+ }
74
+ ],
75
+ name: 'getSlot0',
76
+ outputs: [
77
+ {
78
+ internalType: 'uint160',
79
+ name: '',
80
+ type: 'uint160'
81
+ },
82
+ {
83
+ internalType: 'int24',
84
+ name: '',
85
+ type: 'int24'
86
+ },
87
+ {
88
+ internalType: 'uint24',
89
+ name: '',
90
+ type: 'uint24'
91
+ },
92
+ {
93
+ internalType: 'uint24',
94
+ name: '',
95
+ type: 'uint24'
96
+ }
97
+ ],
98
+ stateMutability: 'view',
99
+ type: 'function'
100
+ }
101
+ ];
102
+ constructor(address, walletClient, log = createLogger('mock-state-view')){
103
+ this.address = address;
104
+ this.walletClient = walletClient;
105
+ this.log = log;
106
+ }
107
+ /**
108
+ * Deploys the mock StateView contract at the specified address using etch.
109
+ * @param ethCheatCodes - Cheat codes for etching bytecode
110
+ * @param walletClient - Wallet client for sending transactions
111
+ * @param address - Address to deploy the mock at (typically the real StateView address)
112
+ */ static async deploy(ethCheatCodes, walletClient, address) {
113
+ await ethCheatCodes.etch(address, MockStateView.BYTECODE);
114
+ return new MockStateView(address, walletClient);
115
+ }
116
+ /**
117
+ * Sets the price using the ethPerFeeAssetE12 format (same as rollup contract).
118
+ * Computes the corresponding sqrtPriceX96 internally.
119
+ *
120
+ * Math (from fee_asset_price_oracle.ts):
121
+ * ethPerFeeAssetE12 = 1e12 * 2^192 / sqrtPriceX96^2
122
+ *
123
+ * Inverted:
124
+ * sqrtPriceX96^2 = 1e12 * 2^192 / ethPerFeeAssetE12
125
+ * sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
126
+ *
127
+ * @param ethPerFeeAssetE12 - The price in ETH per fee asset, scaled by 1e12
128
+ */ async setEthPerFeeAsset(ethPerFeeAssetE12) {
129
+ const sqrtPriceX96 = this.ethPerFeeAssetE12ToSqrtPriceX96(ethPerFeeAssetE12);
130
+ return await this.setSqrtPriceX96(sqrtPriceX96);
131
+ }
132
+ /**
133
+ * Sets the sqrtPriceX96 value directly (Uniswap's price encoding).
134
+ * @param sqrtPriceX96 - The sqrtPriceX96 value
135
+ * @param tick - The tick value (default 10)
136
+ * @param protocolFee - The protocol fee (default 0)
137
+ * @param lpFee - The LP fee (default 500)
138
+ */ async setSqrtPriceX96(sqrtPriceX96, tick = 10, protocolFee = 0, lpFee = 500) {
139
+ const contract = getContract({
140
+ address: this.address.toString(),
141
+ abi: MockStateView.ABI,
142
+ client: this.walletClient
143
+ });
144
+ const hash = await contract.write.setReturnValues([
145
+ sqrtPriceX96,
146
+ tick,
147
+ protocolFee,
148
+ lpFee
149
+ ]);
150
+ this.log.info(`Set sqrtPriceX96 to ${sqrtPriceX96}`);
151
+ return await this.walletClient.waitForTransactionReceipt({
152
+ hash
153
+ });
154
+ }
155
+ /**
156
+ * Converts ethPerFeeAssetE12 to sqrtPriceX96 (inverse of sqrtPriceX96ToEthPerFeeAssetE12).
157
+ *
158
+ * Math:
159
+ * sqrtPriceX96 = sqrt(1e12 * 2^192 / ethPerFeeAssetE12)
160
+ */ ethPerFeeAssetE12ToSqrtPriceX96(ethPerFeeAssetE12) {
161
+ if (ethPerFeeAssetE12 === 0n) {
162
+ throw new Error('Cannot convert zero ethPerFeeAssetE12');
163
+ }
164
+ const Q192 = 2n ** 192n;
165
+ const sqrtPriceSquared = 10n ** 12n * Q192 / ethPerFeeAssetE12;
166
+ return this.bigintSqrt(sqrtPriceSquared);
167
+ }
168
+ /** Integer square root using Newton's method */ bigintSqrt(n) {
169
+ if (n < 0n) {
170
+ throw new Error('Cannot compute sqrt of negative number');
171
+ }
172
+ if (n === 0n) {
173
+ return 0n;
174
+ }
175
+ let x = n;
176
+ let y = (x + 1n) / 2n;
177
+ while(y < x){
178
+ x = y;
179
+ y = (x + n / x) / 2n;
180
+ }
181
+ return x;
182
+ }
183
+ }
184
+ export function diffInBps(a, b) {
185
+ return (a - b) * 10000n / b;
186
+ }
@@ -1,4 +1,6 @@
1
- import { type Logger, type SentTx, type Wallet } from '@aztec/aztec.js';
2
- import type { PXEService } from '@aztec/pxe/server';
3
- export declare const submitTxsTo: (pxe: PXEService, numTxs: number, wallet: Wallet, logger: Logger) => Promise<SentTx[]>;
4
- //# sourceMappingURL=submit-transactions.d.ts.map
1
+ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import type { Logger } from '@aztec/aztec.js/log';
3
+ import { TxHash } from '@aztec/aztec.js/tx';
4
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
5
+ export declare const submitTxsTo: (wallet: TestWallet, submitter: AztecAddress, numTxs: number, logger: Logger) => Promise<TxHash[]>;
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3VibWl0LXRyYW5zYWN0aW9ucy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoYXJlZC9zdWJtaXQtdHJhbnNhY3Rpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUd6RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNsRCxPQUFPLEVBQUUsTUFBTSxFQUE0QixNQUFNLG9CQUFvQixDQUFDO0FBR3RFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBR2hFLGVBQU8sTUFBTSxXQUFXLG9HQXFCdkIsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,MAAM,EAAE,KAAK,MAAM,EAAY,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEtG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,eAAO,MAAM,WAAW,QACjB,UAAU,UACP,MAAM,UACN,MAAM,UACN,MAAM,KACb,QAAQ,MAAM,EAAE,CAqBlB,CAAC"}
1
+ {"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAA4B,MAAM,oBAAoB,CAAC;AAGtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,eAAO,MAAM,WAAW,oGAqBvB,CAAC"}
@@ -1,23 +1,22 @@
1
- import { getSchnorrAccount } from '@aztec/accounts/schnorr';
2
- import { Fr, GrumpkinScalar, TxStatus } from '@aztec/aztec.js';
1
+ import { NO_WAIT } from '@aztec/aztec.js/contracts';
2
+ import { Fr, GrumpkinScalar } from '@aztec/aztec.js/fields';
3
+ import { TxStatus } from '@aztec/aztec.js/tx';
3
4
  import { times } from '@aztec/foundation/collection';
4
- // submits a set of transactions to the provided Private eXecution Environment (PXE)
5
- export const submitTxsTo = async (pxe, numTxs, wallet, logger)=>{
6
- const txs = [];
5
+ // submits a set of transactions to the provided Wallet
6
+ export const submitTxsTo = async (wallet, submitter, numTxs, logger)=>{
7
+ const txHashes = [];
7
8
  await Promise.all(times(numTxs, async ()=>{
8
- const accountManager = await getSchnorrAccount(pxe, Fr.random(), GrumpkinScalar.random(), Fr.random());
9
- const tx = accountManager.deploy({
10
- deployWallet: wallet
9
+ const accountManager = await wallet.createSchnorrAccount(Fr.random(), Fr.random(), GrumpkinScalar.random());
10
+ const deployMethod = await accountManager.getDeployMethod();
11
+ const { txHash } = await deployMethod.send({
12
+ from: submitter,
13
+ wait: NO_WAIT
11
14
  });
12
- const txHash = await tx.getTxHash();
13
15
  logger.info(`Tx sent with hash ${txHash}`);
14
- const receipt = await tx.getReceipt();
15
- expect(receipt).toEqual(expect.objectContaining({
16
- status: TxStatus.PENDING,
17
- error: ''
18
- }));
16
+ const receipt = await wallet.getTxReceipt(txHash);
17
+ expect(receipt.status).toBe(TxStatus.PENDING);
19
18
  logger.info(`Receipt received for ${txHash}`);
20
- txs.push(tx);
19
+ txHashes.push(txHash);
21
20
  }));
22
- return txs;
21
+ return txHashes;
23
22
  };
@@ -1,25 +1,3 @@
1
- import { type AccountWallet, type AztecNode, type CheatCodes, type Logger, type PXE } from '@aztec/aztec.js';
2
- import { type DeployL1ContractsReturnType, type ViemPublicClient, type ViemWalletClient } from '@aztec/ethereum';
3
- /** Objects to be returned by the uniswap setup function */
4
- export type UniswapSetupContext = {
5
- /** Aztec Node instance */
6
- aztecNode: AztecNode;
7
- /** The Private eXecution Environment (PXE). */
8
- pxe: PXE;
9
- /** Logger instance named as the current test. */
10
- logger: Logger;
11
- /** Viem Public client instance. */
12
- publicClient: ViemPublicClient;
13
- /** Viem Wallet Client instance. */
14
- walletClient: ViemWalletClient;
15
- /** The owner wallet. */
16
- ownerWallet: AccountWallet;
17
- /** The sponsor wallet. */
18
- sponsorWallet: AccountWallet;
19
- /** */
20
- deployL1ContractsValues: DeployL1ContractsReturnType;
21
- /** Cheat codes instance. */
22
- cheatCodes: CheatCodes;
23
- };
24
- export declare const uniswapL1L2TestSuite: (setup: () => Promise<UniswapSetupContext>, cleanup: () => Promise<void>, expectedForkBlockNumber?: number) => void;
25
- //# sourceMappingURL=uniswap_l1_l2.d.ts.map
1
+ import { type EndToEndContext } from '../fixtures/utils.js';
2
+ export declare const uniswapL1L2TestSuite: (setup: () => Promise<EndToEndContext>, cleanup: () => Promise<void>, expectedForkBlockNumber?: number) => void;
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pc3dhcF9sMV9sMi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoYXJlZC91bmlzd2FwX2wxX2wyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQSxPQUFPLEVBQ0wsS0FBSyxlQUFlLEVBR3JCLE1BQU0sc0JBQXNCLENBQUM7QUFhOUIsZUFBTyxNQUFNLG9CQUFvQixpSEErZ0NoQyxDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,UAAU,EAGf,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAGtB,MAAM,iBAAiB,CAAC;AAqBzB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,mCAAmC;IACnC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,wBAAwB;IACxB,WAAW,EAAE,aAAa,CAAC;IAC3B,0BAA0B;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,UACxB,MAAM,QAAQ,mBAAmB,CAAC,WAChC,MAAM,QAAQ,IAAI,CAAC,2CA89B7B,CAAC"}
1
+ {"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,sBAAsB,CAAC;AAa9B,eAAO,MAAM,oBAAoB,iHA+gChC,CAAC"}