@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
@@ -0,0 +1,155 @@
1
+ import { jsonStringify } from '@aztec/foundation/json-rpc';
2
+ import { createLogger } from '@aztec/foundation/log';
3
+ import { promiseWithResolvers } from '@aztec/foundation/promise';
4
+ import { getSchemaReturnType } from '@aztec/foundation/schemas';
5
+ import { sleep } from '@aztec/foundation/sleep';
6
+ import { NodeConnector, TransportClient } from '@aztec/foundation/transport';
7
+ import { Worker } from 'worker_threads';
8
+ import { WorkerWalletSchema } from './worker_wallet_schema.js';
9
+ const log = createLogger('e2e:test-wallet:worker-wallet');
10
+ const WORKER_READY_TIMEOUT_MS = 120_000;
11
+ /**
12
+ * Wallet implementation that offloads all work to a worker thread.
13
+ * Implements the Wallet interface by proxying calls over a transport layer
14
+ * using JSON serialization with Zod schema parsing on both ends.
15
+ */ export class WorkerWallet {
16
+ worker;
17
+ client;
18
+ constructor(worker, client){
19
+ this.worker = worker;
20
+ this.client = client;
21
+ }
22
+ /**
23
+ * Creates a WorkerWallet by spawning a worker thread that creates a TestWallet internally.
24
+ * @param nodeUrl - URL of the Aztec node to connect to.
25
+ * @param pxeConfig - Optional PXE configuration overrides.
26
+ * @returns A WorkerWallet ready to use.
27
+ */ static async create(nodeUrl, pxeConfig) {
28
+ // replace stc/ with dest/ so the wallet works in Jest tests
29
+ const workerUrl = new URL('./wallet_worker_script.js', import.meta.url);
30
+ workerUrl.pathname = workerUrl.pathname.replace('/src/', '/dest/');
31
+ // remove JEST_WORKER_ID so the worker uses pino-pretty transport instead of Jest's raw output.
32
+ const { JEST_WORKER_ID: _, ...parentEnv } = process.env;
33
+ const worker = new Worker(workerUrl, {
34
+ workerData: {
35
+ nodeUrl,
36
+ pxeConfig
37
+ },
38
+ env: {
39
+ ...parentEnv,
40
+ ...process.stderr.isTTY || process.env.FORCE_COLOR ? {
41
+ FORCE_COLOR: '1'
42
+ } : {},
43
+ LOG_LEVEL: process.env.WORKER_LOG_LEVEL ?? 'info'
44
+ }
45
+ });
46
+ const connector = new NodeConnector(worker);
47
+ const client = new TransportClient(connector);
48
+ await client.open();
49
+ const wallet = new WorkerWallet(worker, client);
50
+ const { promise: workerDied, reject: rejectWorkerDied } = promiseWithResolvers();
51
+ // reject if the worker exits or errors before the warmup completes.
52
+ const onError = (err)=>{
53
+ worker.off('exit', onExit);
54
+ rejectWorkerDied(new Error(`Worker wallet thread error: ${err.message}`));
55
+ };
56
+ const onExit = (code)=>{
57
+ worker.off('error', onError);
58
+ rejectWorkerDied(new Error(`Worker wallet thread exited with code ${code} before becoming ready`));
59
+ };
60
+ worker.once('error', onError);
61
+ worker.once('exit', onExit);
62
+ const timeout = sleep(WORKER_READY_TIMEOUT_MS).then(()=>{
63
+ throw new Error(`Worker wallet creation timed out after ${WORKER_READY_TIMEOUT_MS / 1000}s`);
64
+ });
65
+ try {
66
+ // wait for worker wallet to start
67
+ await Promise.race([
68
+ wallet.getChainInfo(),
69
+ workerDied,
70
+ timeout
71
+ ]);
72
+ } catch (err) {
73
+ log.error('Worker wallet creation failed, cleaning up', {
74
+ error: String(err)
75
+ });
76
+ client.close();
77
+ await worker.terminate();
78
+ throw err;
79
+ } finally{
80
+ worker.off('error', onError);
81
+ worker.off('exit', onExit);
82
+ }
83
+ return wallet;
84
+ }
85
+ async callRaw(fn, ...args) {
86
+ const argsJson = jsonStringify(args);
87
+ return await this.client.request({
88
+ fn,
89
+ args: argsJson
90
+ });
91
+ }
92
+ async call(fn, ...args) {
93
+ const resultJson = await this.callRaw(fn, ...args);
94
+ const methodSchema = WorkerWalletSchema[fn];
95
+ return getSchemaReturnType(methodSchema).parseAsync(JSON.parse(resultJson));
96
+ }
97
+ getChainInfo() {
98
+ return this.call('getChainInfo');
99
+ }
100
+ getContractMetadata(address) {
101
+ return this.call('getContractMetadata', address);
102
+ }
103
+ getContractClassMetadata(id) {
104
+ return this.call('getContractClassMetadata', id);
105
+ }
106
+ getPrivateEvents(eventMetadata, eventFilter) {
107
+ return this.call('getPrivateEvents', eventMetadata, eventFilter);
108
+ }
109
+ registerSender(address, alias) {
110
+ return this.call('registerSender', address, alias);
111
+ }
112
+ getAddressBook() {
113
+ return this.call('getAddressBook');
114
+ }
115
+ getAccounts() {
116
+ return this.call('getAccounts');
117
+ }
118
+ registerContract(instance, artifact, secretKey) {
119
+ return this.call('registerContract', instance, artifact, secretKey);
120
+ }
121
+ registerContractClass(artifact) {
122
+ return this.call('registerContractClass', artifact);
123
+ }
124
+ simulateTx(exec, opts) {
125
+ return this.call('simulateTx', exec, opts);
126
+ }
127
+ executeUtility(call, opts) {
128
+ return this.call('executeUtility', call, opts);
129
+ }
130
+ profileTx(exec, opts) {
131
+ return this.call('profileTx', exec, opts);
132
+ }
133
+ sendTx(exec, opts) {
134
+ return this.call('sendTx', exec, opts);
135
+ }
136
+ proveTx(exec, opts) {
137
+ return this.call('proveTx', exec, opts);
138
+ }
139
+ /** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt) {
140
+ return this.call('registerAccount', secret, salt);
141
+ }
142
+ createAuthWit(from, messageHashOrIntent) {
143
+ return this.call('createAuthWit', from, messageHashOrIntent);
144
+ }
145
+ requestCapabilities(manifest) {
146
+ return this.call('requestCapabilities', manifest);
147
+ }
148
+ batch(methods) {
149
+ return this.call('batch', methods);
150
+ }
151
+ /** Shuts down the worker thread and closes the transport. */ async stop() {
152
+ this.client.close();
153
+ await this.worker.terminate();
154
+ }
155
+ }
@@ -0,0 +1,160 @@
1
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
2
+ import { Tx } from '@aztec/stdlib/tx';
3
+ import { z } from 'zod';
4
+ /** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */
5
+ export declare const WorkerWalletSchema: {
6
+ getPrivateEvents: z.ZodFunction<z.ZodTuple<[eventMetadata: z.ZodType<import("@aztec/stdlib/abi").EventMetadataDefinition, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").EventMetadataDefinition, any>>, eventFilter: z.ZodType<import("@aztec/aztec.js/wallet").PrivateEventFilter, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").PrivateEventFilter, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").PrivateEvent<unknown>[], any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").PrivateEvent<unknown>[], any>>>;
7
+ getChainInfo: z.ZodFunction<z.ZodTuple<[], null>, z.ZodType<import("@aztec/entrypoints/interfaces").ChainInfo, any, z.core.$ZodTypeInternals<import("@aztec/entrypoints/interfaces").ChainInfo, any>>>;
8
+ getContractMetadata: z.ZodFunction<z.ZodTuple<[address: z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").ContractMetadata, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ContractMetadata, any>>>;
9
+ getContractClassMetadata: z.ZodFunction<z.ZodTuple<[id: z.ZodType<import("@aztec/foundation/schemas").Fr, any, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").ContractClassMetadata, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ContractClassMetadata, any>>>;
10
+ registerSender: z.ZodFunction<z.ZodTuple<[address: z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>, alias: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<string | undefined, any, z.core.$ZodTypeInternals<string | undefined, any>>>], null>, z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>>;
11
+ getAddressBook: z.ZodFunction<z.ZodTuple<[], null>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any>>>;
12
+ getAccounts: z.ZodFunction<z.ZodTuple<[], null>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any>>>;
13
+ registerContract: z.ZodFunction<z.ZodTuple<[instance: z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any>>, artifact: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/stdlib/abi").ContractArtifact | undefined, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").ContractArtifact | undefined, any>>>, secretKey: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/foundation/schemas").Fr | undefined, any, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr | undefined, any>>>], null>, z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any>>>;
14
+ registerContractClass: z.ZodFunction<z.ZodTuple<[artifact: z.ZodType<import("@aztec/stdlib/abi").ContractArtifact, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").ContractArtifact, any>>], null>, z.ZodType<void, any, z.core.$ZodTypeInternals<void, any>>>;
15
+ simulateTx: z.ZodFunction<z.ZodTuple<[exec: z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").ExecutionPayload, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SimulateOptions, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").SimulateOptions, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").TxSimulationResultWithAppOffset, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").TxSimulationResultWithAppOffset, any>>>;
16
+ executeUtility: z.ZodFunction<z.ZodTuple<[call: z.ZodType<import("@aztec/stdlib/abi").FunctionCall, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").FunctionCall, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ExecuteUtilityOptions, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ExecuteUtilityOptions, any>>], null>, z.ZodType<import("@aztec/stdlib/tx").UtilityExecutionResult, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").UtilityExecutionResult, any>>>;
17
+ profileTx: z.ZodFunction<z.ZodTuple<[exec: z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").ExecutionPayload, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ProfileOptions, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ProfileOptions, any>>], null>, z.ZodType<import("@aztec/stdlib/tx").TxProfileResult, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").TxProfileResult, any>>>;
18
+ sendTx: z.ZodFunction<z.ZodTuple<[exec: z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").ExecutionPayload, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, any>>], null>, z.ZodType<import("@aztec/aztec.js/contracts").TxSendResultImmediate | import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/contracts").TxSendResultImmediate | import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>, any>>>;
19
+ createAuthWit: z.ZodFunction<z.ZodTuple<[from: z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>, messageHashOrIntent: z.ZodType<import("@aztec/aztec.js/authorization").CallIntent | import("@aztec/aztec.js/authorization").IntentInnerHash, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/authorization").CallIntent | import("@aztec/aztec.js/authorization").IntentInnerHash, any>>], null>, z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/auth-witness").AuthWitness, any>>>;
20
+ requestCapabilities: z.ZodFunction<z.ZodTuple<[manifest: z.ZodType<import("@aztec/aztec.js/wallet").AppCapabilities, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").AppCapabilities, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").WalletCapabilities, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").WalletCapabilities, any>>>;
21
+ batch: z.ZodFunction<z.ZodTuple<[methods: z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethod[], any, z.core.$ZodTypeInternals<readonly import("@aztec/aztec.js/wallet").BatchedMethod[], any>>], null>, z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethodResultWrapper<import("@aztec/aztec.js/wallet").BatchedMethod>[], any, z.core.$ZodTypeInternals<readonly import("@aztec/aztec.js/wallet").BatchedMethodResultWrapper<import("@aztec/aztec.js/wallet").BatchedMethod>[], any>>>;
22
+ proveTx: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
23
+ calls: z.ZodArray<z.ZodPipe<z.ZodObject<{
24
+ name: z.ZodString;
25
+ to: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
26
+ selector: import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/abi").FunctionSelector>;
27
+ type: z.ZodEnum<typeof import("@aztec/stdlib/abi").FunctionType>;
28
+ isStatic: z.ZodBoolean;
29
+ hideMsgSender: z.ZodBoolean;
30
+ args: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
31
+ returnTypes: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
32
+ }, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/abi").FunctionCall, {
33
+ name: string;
34
+ to: AztecAddress;
35
+ selector: import("@aztec/stdlib/abi").FunctionSelector;
36
+ type: import("@aztec/stdlib/abi").FunctionType;
37
+ isStatic: boolean;
38
+ hideMsgSender: boolean;
39
+ args: import("@aztec/foundation/schemas").Fr[];
40
+ returnTypes: import("@aztec/stdlib/abi").AbiType[];
41
+ }>>>;
42
+ authWitnesses: z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/auth-witness").AuthWitness, string>>>;
43
+ capsules: z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").Capsule, string>>>;
44
+ extraHashedArgs: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/tx").HashedValues>>;
45
+ feePayer: z.ZodPipe<z.ZodOptional<z.ZodNullable<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>>, z.ZodTransform<AztecAddress | undefined, AztecAddress | null | undefined>>;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ from: z.ZodUnion<readonly [import("@aztec/foundation/schemas").ZodFor<AztecAddress>, z.ZodLiteral<"NO_FROM">]>;
48
+ authWitnesses: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/auth-witness").AuthWitness, string>>>>>, z.ZodTransform<import("@aztec/stdlib/auth-witness").AuthWitness[] | undefined, import("@aztec/stdlib/auth-witness").AuthWitness[] | null | undefined>>;
49
+ capsules: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").Capsule, string>>>>>, z.ZodTransform<import("@aztec/stdlib/tx").Capsule[] | undefined, import("@aztec/stdlib/tx").Capsule[] | null | undefined>>;
50
+ fee: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
51
+ gasSettings: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
52
+ gasLimits: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
53
+ daGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
54
+ l2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
55
+ }, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/gas").Gas, {
56
+ daGas: number;
57
+ l2Gas: number;
58
+ }>>>>, z.ZodTransform<import("@aztec/stdlib/gas").Gas | undefined, import("@aztec/stdlib/gas").Gas | null | undefined>>;
59
+ teardownGasLimits: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
60
+ daGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
61
+ l2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
62
+ }, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/gas").Gas, {
63
+ daGas: number;
64
+ l2Gas: number;
65
+ }>>>>, z.ZodTransform<import("@aztec/stdlib/gas").Gas | undefined, import("@aztec/stdlib/gas").Gas | null | undefined>>;
66
+ maxFeePerGas: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
67
+ feePerDaGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
68
+ feePerL2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
69
+ }, z.core.$strip>>>, z.ZodTransform<{
70
+ feePerDaGas: bigint;
71
+ feePerL2Gas: bigint;
72
+ } | undefined, {
73
+ feePerDaGas: bigint;
74
+ feePerL2Gas: bigint;
75
+ } | null | undefined>>;
76
+ maxPriorityFeePerGas: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
77
+ feePerDaGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
78
+ feePerL2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
79
+ }, z.core.$strip>>>, z.ZodTransform<{
80
+ feePerDaGas: bigint;
81
+ feePerL2Gas: bigint;
82
+ } | undefined, {
83
+ feePerDaGas: bigint;
84
+ feePerL2Gas: bigint;
85
+ } | null | undefined>>;
86
+ }, z.core.$strip>>>, z.ZodTransform<{
87
+ gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
88
+ teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
89
+ maxFeePerGas: {
90
+ feePerDaGas: bigint;
91
+ feePerL2Gas: bigint;
92
+ } | undefined;
93
+ maxPriorityFeePerGas: {
94
+ feePerDaGas: bigint;
95
+ feePerL2Gas: bigint;
96
+ } | undefined;
97
+ } | undefined, {
98
+ gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
99
+ teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
100
+ maxFeePerGas: {
101
+ feePerDaGas: bigint;
102
+ feePerL2Gas: bigint;
103
+ } | undefined;
104
+ maxPriorityFeePerGas: {
105
+ feePerDaGas: bigint;
106
+ feePerL2Gas: bigint;
107
+ } | undefined;
108
+ } | null | undefined>>;
109
+ congestionEstimate: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof import("@aztec/stdlib/gas").ManaUsageEstimate>>>, z.ZodTransform<import("@aztec/stdlib/gas").ManaUsageEstimate | undefined, import("@aztec/stdlib/gas").ManaUsageEstimate | null | undefined>>;
110
+ }, z.core.$strip>>>, z.ZodTransform<{
111
+ gasSettings: {
112
+ gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
113
+ teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
114
+ maxFeePerGas: {
115
+ feePerDaGas: bigint;
116
+ feePerL2Gas: bigint;
117
+ } | undefined;
118
+ maxPriorityFeePerGas: {
119
+ feePerDaGas: bigint;
120
+ feePerL2Gas: bigint;
121
+ } | undefined;
122
+ } | undefined;
123
+ congestionEstimate: import("@aztec/stdlib/gas").ManaUsageEstimate | undefined;
124
+ } | undefined, {
125
+ gasSettings: {
126
+ gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
127
+ teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
128
+ maxFeePerGas: {
129
+ feePerDaGas: bigint;
130
+ feePerL2Gas: bigint;
131
+ } | undefined;
132
+ maxPriorityFeePerGas: {
133
+ feePerDaGas: bigint;
134
+ feePerL2Gas: bigint;
135
+ } | undefined;
136
+ } | undefined;
137
+ congestionEstimate: import("@aztec/stdlib/gas").ManaUsageEstimate | undefined;
138
+ } | null | undefined>>;
139
+ wait: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"NO_WAIT">, z.ZodObject<{
140
+ ignoreDroppedReceiptsFor: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
141
+ timeout: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
142
+ interval: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
143
+ dontThrowOnRevert: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
144
+ }, z.core.$strip>]>>>, z.ZodTransform<NonNullable<"NO_WAIT" | {
145
+ ignoreDroppedReceiptsFor: number | undefined;
146
+ timeout: number | undefined;
147
+ interval: number | undefined;
148
+ dontThrowOnRevert: boolean | undefined;
149
+ }> | undefined, "NO_WAIT" | {
150
+ ignoreDroppedReceiptsFor: number | undefined;
151
+ timeout: number | undefined;
152
+ interval: number | undefined;
153
+ dontThrowOnRevert: boolean | undefined;
154
+ } | null | undefined>>;
155
+ additionalScopes: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>>>, z.ZodTransform<AztecAddress[] | undefined, AztecAddress[] | null | undefined>>;
156
+ sendMessagesAs: z.ZodPipe<z.ZodOptional<z.ZodNullable<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>>, z.ZodTransform<AztecAddress | undefined, AztecAddress | null | undefined>>;
157
+ }, z.core.$strip>], null>, import("@aztec/foundation/schemas").ZodFor<Tx>>;
158
+ registerAccount: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>, z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>], null>, import("@aztec/foundation/schemas").ZodFor<AztecAddress>>;
159
+ };
160
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldF9zY2hlbWEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0LXdhbGxldC93b3JrZXJfd2FsbGV0X3NjaGVtYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRXRDLE9BQU8sRUFBRSxDQUFDLEVBQUUsTUFBTSxLQUFLLENBQUM7QUFFeEIsaUdBQStGO0FBQy9GLGVBQU8sTUFBTSxrQkFBa0I7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FJOUIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker_wallet_schema.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet_schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iGAA+F;AAC/F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI9B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { ExecutionPayloadSchema, SendOptionsSchema, WalletSchema } from '@aztec/aztec.js/wallet';
2
+ import { schemas } from '@aztec/foundation/schemas';
3
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ import { Tx } from '@aztec/stdlib/tx';
5
+ import { z } from 'zod';
6
+ /** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */ export const WorkerWalletSchema = {
7
+ ...WalletSchema,
8
+ proveTx: z.function({
9
+ input: z.tuple([
10
+ ExecutionPayloadSchema,
11
+ SendOptionsSchema
12
+ ]),
13
+ output: Tx.schema
14
+ }),
15
+ registerAccount: z.function({
16
+ input: z.tuple([
17
+ schemas.Fr,
18
+ schemas.Fr
19
+ ]),
20
+ output: AztecAddress.schema
21
+ })
22
+ };
package/package.json CHANGED
@@ -1,114 +1,126 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.0.0-test.1",
3
+ "version": "0.0.1-commit.017a351",
4
4
  "type": "module",
5
- "exports": "./dest/index.js",
5
+ "exports": {
6
+ ".": "./dest/index.js",
7
+ "./*": "./dest/*"
8
+ },
6
9
  "inherits": [
7
10
  "../package.common.json",
8
11
  "./package.local.json"
9
12
  ],
10
13
  "scripts": {
11
- "build": "yarn clean && tsc -b",
12
- "build:dev": "tsc -b --watch",
14
+ "build": "yarn clean && ../scripts/tsc.sh",
15
+ "build:dev": "../scripts/tsc.sh --watch",
13
16
  "clean": "rm -rf ./dest .tsbuildinfo",
14
- "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
15
17
  "test:with-alerts": "./scripts/test-with-alerts.sh",
16
- "test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
18
+ "test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
17
19
  "test:e2e-docker": "./scripts/run_test.sh simple",
18
20
  "test:e2e-no-docker": "echo 'The command test:e2e-no-docker is now the same as test:e2e. You can now run this dropping the no-docker suffix.'; yarn test:e2e",
19
- "test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000 --forceExit",
21
+ "test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000",
20
22
  "serve:flames": "python3 -m http.server --directory \"flame_graph\" 8000",
21
- "test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
23
+ "test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
22
24
  "test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
23
25
  "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json",
24
26
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests src/fixtures",
25
27
  "test:compose": "./scripts/run_test.sh compose",
28
+ "test:ha": "./scripts/run_test.sh ha",
26
29
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
27
30
  },
28
31
  "dependencies": {
29
- "@aztec/accounts": "0.0.0-test.1",
30
- "@aztec/archiver": "0.0.0-test.1",
31
- "@aztec/aztec": "0.0.0-test.1",
32
- "@aztec/aztec-node": "0.0.0-test.1",
33
- "@aztec/aztec.js": "0.0.0-test.1",
34
- "@aztec/bb-prover": "0.0.0-test.1",
35
- "@aztec/blob-lib": "0.0.0-test.1",
36
- "@aztec/blob-sink": "0.0.0-test.1",
37
- "@aztec/bot": "0.0.0-test.1",
38
- "@aztec/constants": "0.0.0-test.1",
39
- "@aztec/entrypoints": "0.0.0-test.1",
40
- "@aztec/epoch-cache": "0.0.0-test.1",
41
- "@aztec/ethereum": "0.0.0-test.1",
42
- "@aztec/foundation": "0.0.0-test.1",
43
- "@aztec/kv-store": "0.0.0-test.1",
44
- "@aztec/l1-artifacts": "0.0.0-test.1",
45
- "@aztec/merkle-tree": "0.0.0-test.1",
46
- "@aztec/noir-contracts.js": "0.0.0-test.1",
47
- "@aztec/noir-protocol-circuits-types": "0.0.0-test.1",
48
- "@aztec/p2p": "0.0.0-test.1",
49
- "@aztec/protocol-contracts": "0.0.0-test.1",
50
- "@aztec/prover-client": "0.0.0-test.1",
51
- "@aztec/prover-node": "0.0.0-test.1",
52
- "@aztec/pxe": "0.0.0-test.1",
53
- "@aztec/sequencer-client": "0.0.0-test.1",
54
- "@aztec/simulator": "0.0.0-test.1",
55
- "@aztec/stdlib": "0.0.0-test.1",
56
- "@aztec/telemetry-client": "0.0.0-test.1",
57
- "@aztec/validator-client": "0.0.0-test.1",
58
- "@aztec/world-state": "0.0.0-test.1",
32
+ "@aztec/accounts": "0.0.1-commit.017a351",
33
+ "@aztec/archiver": "0.0.1-commit.017a351",
34
+ "@aztec/aztec": "0.0.1-commit.017a351",
35
+ "@aztec/aztec-node": "0.0.1-commit.017a351",
36
+ "@aztec/aztec.js": "0.0.1-commit.017a351",
37
+ "@aztec/bb-prover": "0.0.1-commit.017a351",
38
+ "@aztec/bb.js": "0.0.1-commit.017a351",
39
+ "@aztec/blob-client": "0.0.1-commit.017a351",
40
+ "@aztec/blob-lib": "0.0.1-commit.017a351",
41
+ "@aztec/bot": "0.0.1-commit.017a351",
42
+ "@aztec/cli": "0.0.1-commit.017a351",
43
+ "@aztec/constants": "0.0.1-commit.017a351",
44
+ "@aztec/entrypoints": "0.0.1-commit.017a351",
45
+ "@aztec/epoch-cache": "0.0.1-commit.017a351",
46
+ "@aztec/ethereum": "0.0.1-commit.017a351",
47
+ "@aztec/foundation": "0.0.1-commit.017a351",
48
+ "@aztec/kv-store": "0.0.1-commit.017a351",
49
+ "@aztec/l1-artifacts": "0.0.1-commit.017a351",
50
+ "@aztec/node-keystore": "0.0.1-commit.017a351",
51
+ "@aztec/noir-contracts.js": "0.0.1-commit.017a351",
52
+ "@aztec/noir-noirc_abi": "0.0.1-commit.017a351",
53
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.017a351",
54
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.017a351",
55
+ "@aztec/p2p": "0.0.1-commit.017a351",
56
+ "@aztec/protocol-contracts": "0.0.1-commit.017a351",
57
+ "@aztec/prover-client": "0.0.1-commit.017a351",
58
+ "@aztec/prover-node": "0.0.1-commit.017a351",
59
+ "@aztec/pxe": "0.0.1-commit.017a351",
60
+ "@aztec/sequencer-client": "0.0.1-commit.017a351",
61
+ "@aztec/simulator": "0.0.1-commit.017a351",
62
+ "@aztec/slasher": "0.0.1-commit.017a351",
63
+ "@aztec/standard-contracts": "0.0.1-commit.017a351",
64
+ "@aztec/stdlib": "0.0.1-commit.017a351",
65
+ "@aztec/telemetry-client": "0.0.1-commit.017a351",
66
+ "@aztec/validator-client": "0.0.1-commit.017a351",
67
+ "@aztec/validator-ha-signer": "0.0.1-commit.017a351",
68
+ "@aztec/wallet-sdk": "0.0.1-commit.017a351",
69
+ "@aztec/wallets": "0.0.1-commit.017a351",
70
+ "@aztec/world-state": "0.0.1-commit.017a351",
59
71
  "@iarna/toml": "^2.2.5",
60
- "@jest/globals": "^29.5.0",
61
- "@noble/curves": "^1.0.0",
72
+ "@jest/globals": "^30.0.0",
73
+ "@noble/curves": "=1.0.0",
62
74
  "@swc/core": "^1.4.11",
63
75
  "@swc/jest": "^0.2.36",
64
76
  "@types/fs-extra": "^11.0.2",
65
- "@types/jest": "^29.5.0",
66
- "@types/koa": "^2.13.9",
77
+ "@types/jest": "^30.0.0",
78
+ "@types/koa": "^2.15.0",
67
79
  "@types/koa-static": "^4.0.2",
68
- "@types/levelup": "^5.1.2",
69
80
  "@types/lodash.every": "^4.6.7",
70
- "@types/memdown": "^3.0.3",
71
- "@types/node": "^18.7.23",
72
- "@viem/anvil": "^0.0.9",
81
+ "@types/node": "^22.15.17",
73
82
  "buffer": "^6.0.3",
74
- "crypto-browserify": "^3.12.0",
83
+ "crypto-browserify": "^3.12.1",
75
84
  "fs-extra": "^11.2.0",
76
85
  "get-port": "^7.1.0",
77
86
  "glob": "^10.3.10",
78
- "jest": "^29.5.0",
79
- "jest-extended": "^4.0.2",
80
- "jest-mock-extended": "^3.0.5",
81
- "koa": "^2.14.2",
87
+ "jest": "^30.0.0",
88
+ "jest-extended": "^6.0.0",
89
+ "jest-mock-extended": "^4.0.0",
90
+ "koa": "^2.16.1",
82
91
  "koa-static": "^5.0.0",
83
- "levelup": "^5.1.1",
84
92
  "lodash.chunk": "^4.2.0",
85
93
  "lodash.compact": "^3.0.1",
86
94
  "lodash.every": "^4.6.0",
87
95
  "lodash.omit": "^4.5.0",
88
- "memdown": "^6.1.1",
96
+ "msgpackr": "^1.11.2",
97
+ "pg": "^8.17.1",
89
98
  "process": "^0.11.10",
99
+ "snappy": "^7.2.2",
90
100
  "stream-browserify": "^3.0.0",
91
101
  "string-argv": "^0.3.2",
92
- "ts-loader": "^9.4.4",
102
+ "ts-loader": "^9.5.4",
93
103
  "ts-node": "^10.9.1",
94
104
  "tslib": "^2.4.0",
95
- "typescript": "^5.0.4",
105
+ "typescript": "^5.3.3",
96
106
  "util": "^0.12.5",
97
- "viem": "2.22.8",
98
- "zod": "^3.23.8"
107
+ "viem": "npm:@aztec/viem@2.38.2",
108
+ "zod": "^4"
99
109
  },
100
110
  "devDependencies": {
101
111
  "0x": "^5.7.0",
102
- "@jest/globals": "^29.5.0",
103
- "@types/jest": "^29.5.0",
112
+ "@jest/globals": "^30.0.0",
113
+ "@types/jest": "^30.0.0",
104
114
  "@types/js-yaml": "^4.0.9",
105
115
  "@types/lodash.chunk": "^4.2.9",
116
+ "@types/pg": "^8",
117
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
106
118
  "concurrently": "^7.6.0",
107
- "jest": "^29.5.0",
108
- "jest-extended": "^4.0.2",
119
+ "jest": "^30.0.0",
120
+ "jest-extended": "^6.0.0",
109
121
  "js-yaml": "^4.1.0",
110
122
  "ts-node": "^10.9.1",
111
- "typescript": "^5.0.4"
123
+ "typescript": "^5.3.3"
112
124
  },
113
125
  "files": [
114
126
  "dest",
@@ -117,11 +129,12 @@
117
129
  ],
118
130
  "types": "./dest/index.d.ts",
119
131
  "engines": {
120
- "node": ">=18"
132
+ "node": ">=20.10"
121
133
  },
122
134
  "jest": {
123
135
  "slowTestThreshold": 300,
124
136
  "setupFilesAfterEnv": [
137
+ "../../foundation/src/jest/setupAfterEnv.mjs",
125
138
  "jest-extended/all",
126
139
  "./shared/jest_setup.ts"
127
140
  ],
@@ -150,11 +163,13 @@
150
163
  "moduleNameMapper": {
151
164
  "^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
152
165
  },
166
+ "resolver": "<rootDir>/legacy-jest-resolver.cjs",
153
167
  "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
154
168
  "rootDir": "./src",
155
169
  "testTimeout": 120000,
156
170
  "setupFiles": [
157
171
  "../../foundation/src/jest/setup.mjs"
158
- ]
172
+ ],
173
+ "testEnvironment": "../../foundation/src/jest/env.mjs"
159
174
  }
160
175
  }