@aztec/end-to-end 0.0.1-commit.9ef841308 → 0.0.1-commit.a4600f49

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 (294) hide show
  1. package/README.md +217 -14
  2. package/dest/automine/automine_test_context.d.ts +85 -0
  3. package/dest/automine/automine_test_context.d.ts.map +1 -0
  4. package/dest/automine/automine_test_context.js +98 -0
  5. package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
  6. package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  7. package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.d.ts +1 -1
  8. package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
  9. package/dest/automine/delivery/onchain_delivery_harness.d.ts +17 -0
  10. package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
  11. package/dest/automine/delivery/onchain_delivery_harness.js +123 -0
  12. package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
  13. package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
  14. package/dest/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.js +23 -36
  15. package/dest/automine/token/token_contract_test.d.ts +40 -0
  16. package/dest/automine/token/token_contract_test.d.ts.map +1 -0
  17. package/dest/{e2e_token_contract → automine/token}/token_contract_test.js +24 -39
  18. package/dest/automine/token/token_test_helpers.d.ts +73 -0
  19. package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
  20. package/dest/automine/token/token_test_helpers.js +97 -0
  21. package/dest/bench/client_flows/benchmark.d.ts +15 -1
  22. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  23. package/dest/bench/client_flows/benchmark.js +19 -0
  24. package/dest/bench/client_flows/client_flows_benchmark.d.ts +5 -5
  25. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  26. package/dest/bench/client_flows/client_flows_benchmark.js +43 -27
  27. package/dest/bench/client_flows/data_extractor.js +1 -0
  28. package/dest/bench/utils.d.ts +3 -3
  29. package/dest/bench/utils.d.ts.map +1 -1
  30. package/dest/bench/utils.js +97 -6
  31. package/dest/composed/ha/ha_full_setup.d.ts +77 -0
  32. package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
  33. package/dest/composed/ha/ha_full_setup.js +383 -0
  34. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
  35. package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
  36. package/dest/fixtures/authwit_proxy.d.ts +1 -1
  37. package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
  38. package/dest/fixtures/authwit_proxy.js +4 -0
  39. package/dest/fixtures/e2e_prover_test.d.ts +12 -9
  40. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  41. package/dest/fixtures/e2e_prover_test.js +50 -30
  42. package/dest/fixtures/fixtures.d.ts +78 -1
  43. package/dest/fixtures/fixtures.d.ts.map +1 -1
  44. package/dest/fixtures/fixtures.js +78 -0
  45. package/dest/fixtures/ha_setup.d.ts +4 -4
  46. package/dest/fixtures/ha_setup.d.ts.map +1 -1
  47. package/dest/fixtures/ha_setup.js +5 -2
  48. package/dest/fixtures/index.d.ts +2 -1
  49. package/dest/fixtures/index.d.ts.map +1 -1
  50. package/dest/fixtures/index.js +1 -0
  51. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
  52. package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
  53. package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
  54. package/dest/fixtures/setup.d.ts +71 -41
  55. package/dest/fixtures/setup.d.ts.map +1 -1
  56. package/dest/fixtures/setup.js +277 -198
  57. package/dest/fixtures/setup_p2p_test.d.ts +10 -6
  58. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  59. package/dest/fixtures/setup_p2p_test.js +11 -11
  60. package/dest/fixtures/timing.d.ts +42 -0
  61. package/dest/fixtures/timing.d.ts.map +1 -0
  62. package/dest/fixtures/timing.js +72 -0
  63. package/dest/fixtures/token_utils.d.ts +22 -4
  64. package/dest/fixtures/token_utils.d.ts.map +1 -1
  65. package/dest/fixtures/token_utils.js +21 -1
  66. package/dest/fixtures/utils.d.ts +2 -2
  67. package/dest/fixtures/utils.d.ts.map +1 -1
  68. package/dest/fixtures/utils.js +1 -1
  69. package/dest/fixtures/wait_helpers.d.ts +135 -0
  70. package/dest/fixtures/wait_helpers.d.ts.map +1 -0
  71. package/dest/fixtures/wait_helpers.js +154 -0
  72. package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
  73. package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
  74. package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
  75. package/dest/forward-compatibility/wallet_service.d.ts +3 -0
  76. package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
  77. package/dest/forward-compatibility/wallet_service.js +109 -0
  78. package/dest/install_legacy_contracts.d.cts +10 -0
  79. package/dest/install_legacy_contracts.d.cts.map +1 -0
  80. package/dest/legacy-jest-resolver.d.cts +3 -0
  81. package/dest/legacy-jest-resolver.d.cts.map +1 -0
  82. package/dest/multi-node/block-production/setup.d.ts +97 -0
  83. package/dest/multi-node/block-production/setup.d.ts.map +1 -0
  84. package/dest/multi-node/block-production/setup.js +158 -0
  85. package/dest/multi-node/governance/setup.d.ts +67 -0
  86. package/dest/multi-node/governance/setup.d.ts.map +1 -0
  87. package/dest/multi-node/governance/setup.js +126 -0
  88. package/dest/multi-node/multi_node_test_context.d.ts +212 -0
  89. package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
  90. package/dest/multi-node/multi_node_test_context.js +347 -0
  91. package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
  92. package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
  93. package/dest/multi-node/slashing/inactivity_setup.js +111 -0
  94. package/dest/multi-node/slashing/setup.d.ts +167 -0
  95. package/dest/multi-node/slashing/setup.d.ts.map +1 -0
  96. package/dest/multi-node/slashing/setup.js +275 -0
  97. package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +19 -10
  98. package/dest/p2p/p2p_network.d.ts.map +1 -0
  99. package/dest/{e2e_p2p → p2p}/p2p_network.js +81 -38
  100. package/dest/p2p/reqresp/utils.d.ts +19 -0
  101. package/dest/p2p/reqresp/utils.d.ts.map +1 -0
  102. package/dest/{e2e_p2p → p2p}/reqresp/utils.js +32 -29
  103. package/dest/p2p/shared.d.ts +72 -0
  104. package/dest/p2p/shared.d.ts.map +1 -0
  105. package/dest/p2p/shared.js +212 -0
  106. package/dest/shared/cross_chain_test_harness.d.ts +6 -4
  107. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  108. package/dest/shared/cross_chain_test_harness.js +25 -20
  109. package/dest/shared/gas_portal_test_harness.d.ts +8 -5
  110. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  111. package/dest/shared/gas_portal_test_harness.js +24 -12
  112. package/dest/shared/submit-transactions.d.ts +1 -1
  113. package/dest/shared/submit-transactions.d.ts.map +1 -1
  114. package/dest/shared/submit-transactions.js +12 -5
  115. package/dest/shared/timing_env.d.js +5 -0
  116. package/dest/shared/timing_env.js +365 -0
  117. package/dest/shared/uniswap_l1_l2.d.ts +1 -1
  118. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  119. package/dest/shared/uniswap_l1_l2.js +50 -37
  120. package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
  121. package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
  122. package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
  123. package/dest/simulators/lending_simulator.d.ts +10 -3
  124. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  125. package/dest/simulators/lending_simulator.js +24 -12
  126. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
  127. package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
  128. package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
  129. package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
  130. package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
  131. package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
  132. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
  133. package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
  134. package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +17 -4
  135. package/dest/single-node/fees/fees_test.d.ts +93 -0
  136. package/dest/single-node/fees/fees_test.d.ts.map +1 -0
  137. package/dest/{e2e_fees → single-node/fees}/fees_test.js +78 -59
  138. package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
  139. package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
  140. package/dest/single-node/l1-reorgs/setup.js +57 -0
  141. package/dest/single-node/partial-proofs/setup.d.ts +5 -0
  142. package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
  143. package/dest/single-node/partial-proofs/setup.js +5 -0
  144. package/dest/single-node/proving/setup.d.ts +5 -0
  145. package/dest/single-node/proving/setup.d.ts.map +1 -0
  146. package/dest/single-node/proving/setup.js +5 -0
  147. package/dest/single-node/recovery/setup.d.ts +5 -0
  148. package/dest/single-node/recovery/setup.d.ts.map +1 -0
  149. package/dest/single-node/recovery/setup.js +5 -0
  150. package/dest/single-node/setup.d.ts +49 -0
  151. package/dest/single-node/setup.d.ts.map +1 -0
  152. package/dest/single-node/setup.js +56 -0
  153. package/dest/single-node/single_node_test_context.d.ts +360 -0
  154. package/dest/single-node/single_node_test_context.d.ts.map +1 -0
  155. package/dest/single-node/single_node_test_context.js +833 -0
  156. package/dest/spartan/setup_test_wallets.d.ts +1 -1
  157. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  158. package/dest/spartan/setup_test_wallets.js +26 -42
  159. package/dest/spartan/tx_metrics.d.ts +27 -4
  160. package/dest/spartan/tx_metrics.d.ts.map +1 -1
  161. package/dest/spartan/tx_metrics.js +105 -20
  162. package/dest/spartan/utils/config.d.ts +9 -35
  163. package/dest/spartan/utils/config.d.ts.map +1 -1
  164. package/dest/spartan/utils/nodes.js +2 -2
  165. package/dest/test-wallet/test_wallet.d.ts +38 -9
  166. package/dest/test-wallet/test_wallet.d.ts.map +1 -1
  167. package/dest/test-wallet/test_wallet.js +167 -57
  168. package/dest/test-wallet/utils.d.ts +38 -3
  169. package/dest/test-wallet/utils.d.ts.map +1 -1
  170. package/dest/test-wallet/utils.js +65 -10
  171. package/dest/test-wallet/wallet_worker_script.js +10 -2
  172. package/dest/test-wallet/worker_wallet.d.ts +7 -6
  173. package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
  174. package/dest/test-wallet/worker_wallet.js +6 -2
  175. package/dest/test-wallet/worker_wallet_schema.d.ts +3 -273
  176. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
  177. package/dest/test-wallet/worker_wallet_schema.js +14 -2
  178. package/package.json +47 -42
  179. package/src/automine/README.md +60 -0
  180. package/src/automine/automine_test_context.ts +153 -0
  181. package/src/automine/delivery/onchain_delivery_harness.ts +177 -0
  182. package/src/{e2e_blacklist_token_contract → automine/token}/blacklist_token_contract_test.ts +24 -47
  183. package/src/{e2e_token_contract → automine/token}/token_contract_test.ts +25 -48
  184. package/src/automine/token/token_test_helpers.ts +138 -0
  185. package/src/bench/client_flows/benchmark.ts +21 -0
  186. package/src/bench/client_flows/client_flows_benchmark.ts +75 -54
  187. package/src/bench/client_flows/data_extractor.ts +1 -0
  188. package/src/bench/utils.ts +110 -6
  189. package/src/composed/ha/ha_full_setup.ts +466 -0
  190. package/src/fixtures/authwit_proxy.ts +4 -0
  191. package/src/fixtures/e2e_prover_test.ts +59 -48
  192. package/src/fixtures/fixtures.ts +98 -0
  193. package/src/fixtures/ha_setup.ts +11 -5
  194. package/src/fixtures/index.ts +1 -0
  195. package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
  196. package/src/fixtures/setup.ts +336 -255
  197. package/src/fixtures/setup_p2p_test.ts +15 -11
  198. package/src/fixtures/timing.ts +97 -0
  199. package/src/fixtures/token_utils.ts +39 -4
  200. package/src/fixtures/utils.ts +2 -3
  201. package/src/fixtures/wait_helpers.ts +333 -0
  202. package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
  203. package/src/forward-compatibility/wallet_service.ts +106 -0
  204. package/src/guides/up_quick_start.sh +5 -2
  205. package/src/infra/README.md +12 -0
  206. package/src/install_legacy_contracts.cjs +75 -0
  207. package/src/legacy-jest-resolver.cjs +112 -0
  208. package/src/multi-node/README.md +95 -0
  209. package/src/multi-node/block-production/setup.ts +272 -0
  210. package/src/multi-node/governance/setup.ts +172 -0
  211. package/src/multi-node/multi_node_test_context.ts +447 -0
  212. package/src/multi-node/slashing/inactivity_setup.ts +139 -0
  213. package/src/multi-node/slashing/setup.ts +433 -0
  214. package/src/p2p/README.md +78 -0
  215. package/src/{e2e_p2p → p2p}/p2p_network.ts +92 -49
  216. package/src/{e2e_p2p → p2p}/reqresp/utils.ts +35 -28
  217. package/src/p2p/shared.ts +329 -0
  218. package/src/shared/cross_chain_test_harness.ts +35 -14
  219. package/src/shared/gas_portal_test_harness.ts +32 -14
  220. package/src/shared/submit-transactions.ts +13 -5
  221. package/src/shared/timing_env.d.mts +39 -0
  222. package/src/shared/timing_env.mjs +363 -0
  223. package/src/shared/uniswap_l1_l2.ts +80 -43
  224. package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
  225. package/src/simulators/lending_simulator.ts +28 -14
  226. package/src/single-node/README.md +60 -0
  227. package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
  228. package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
  229. package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +19 -5
  230. package/src/{e2e_fees → single-node/fees}/fees_test.ts +103 -66
  231. package/src/single-node/l1-reorgs/setup.ts +93 -0
  232. package/src/single-node/partial-proofs/setup.ts +8 -0
  233. package/src/single-node/proving/setup.ts +15 -0
  234. package/src/single-node/recovery/setup.ts +8 -0
  235. package/src/single-node/setup.ts +63 -0
  236. package/src/single-node/single_node_test_context.ts +1041 -0
  237. package/src/spartan/setup_test_wallets.ts +21 -36
  238. package/src/spartan/tx_metrics.ts +107 -23
  239. package/src/spartan/utils/nodes.ts +2 -2
  240. package/src/test-wallet/test_wallet.ts +185 -57
  241. package/src/test-wallet/utils.ts +104 -11
  242. package/src/test-wallet/wallet_worker_script.ts +8 -2
  243. package/src/test-wallet/worker_wallet.ts +12 -11
  244. package/src/test-wallet/worker_wallet_schema.ts +4 -3
  245. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -55
  246. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
  247. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -47
  248. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
  249. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -129
  250. package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -37
  251. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
  252. package/dest/e2e_deploy_contract/deploy_test.js +0 -50
  253. package/dest/e2e_epochs/epochs_test.d.ts +0 -104
  254. package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
  255. package/dest/e2e_epochs/epochs_test.js +0 -389
  256. package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
  257. package/dest/e2e_fees/fees_test.d.ts +0 -88
  258. package/dest/e2e_fees/fees_test.d.ts.map +0 -1
  259. package/dest/e2e_l1_publisher/write_json.d.ts +0 -11
  260. package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
  261. package/dest/e2e_l1_publisher/write_json.js +0 -56
  262. package/dest/e2e_multi_validator/utils.d.ts +0 -12
  263. package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
  264. package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -26
  265. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
  266. package/dest/e2e_nested_contract/nested_contract_test.js +0 -54
  267. package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
  268. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
  269. package/dest/e2e_p2p/inactivity_slash_test.js +0 -136
  270. package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
  271. package/dest/e2e_p2p/reqresp/utils.d.ts +0 -22
  272. package/dest/e2e_p2p/reqresp/utils.d.ts.map +0 -1
  273. package/dest/e2e_p2p/shared.d.ts +0 -66
  274. package/dest/e2e_p2p/shared.d.ts.map +0 -1
  275. package/dest/e2e_p2p/shared.js +0 -212
  276. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +0 -2
  277. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +0 -1
  278. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +0 -1
  279. package/dest/e2e_token_contract/token_contract_test.d.ts +0 -44
  280. package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
  281. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -193
  282. package/src/e2e_deploy_contract/deploy_test.ts +0 -85
  283. package/src/e2e_epochs/epochs_test.ts +0 -499
  284. package/src/e2e_l1_publisher/write_json.ts +0 -77
  285. package/src/e2e_nested_contract/nested_contract_test.ts +0 -75
  286. package/src/e2e_p2p/inactivity_slash_test.ts +0 -179
  287. package/src/e2e_p2p/shared.ts +0 -343
  288. /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.js +0 -0
  289. /package/dest/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.js +0 -0
  290. /package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +0 -0
  291. /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof.json +0 -0
  292. /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fetcher.ts +0 -0
  293. /package/src/{e2e_storage_proof → automine/contracts}/fixtures/storage_proof_fixture.ts +0 -0
  294. /package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +0 -0
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.0.1-commit.9ef841308",
3
+ "version": "0.0.1-commit.a4600f49",
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"
@@ -26,44 +29,45 @@
26
29
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
27
30
  },
28
31
  "dependencies": {
29
- "@aztec/accounts": "0.0.1-commit.9ef841308",
30
- "@aztec/archiver": "0.0.1-commit.9ef841308",
31
- "@aztec/aztec": "0.0.1-commit.9ef841308",
32
- "@aztec/aztec-node": "0.0.1-commit.9ef841308",
33
- "@aztec/aztec.js": "0.0.1-commit.9ef841308",
34
- "@aztec/bb-prover": "0.0.1-commit.9ef841308",
35
- "@aztec/bb.js": "0.0.1-commit.9ef841308",
36
- "@aztec/blob-client": "0.0.1-commit.9ef841308",
37
- "@aztec/blob-lib": "0.0.1-commit.9ef841308",
38
- "@aztec/bot": "0.0.1-commit.9ef841308",
39
- "@aztec/cli": "0.0.1-commit.9ef841308",
40
- "@aztec/constants": "0.0.1-commit.9ef841308",
41
- "@aztec/entrypoints": "0.0.1-commit.9ef841308",
42
- "@aztec/epoch-cache": "0.0.1-commit.9ef841308",
43
- "@aztec/ethereum": "0.0.1-commit.9ef841308",
44
- "@aztec/foundation": "0.0.1-commit.9ef841308",
45
- "@aztec/kv-store": "0.0.1-commit.9ef841308",
46
- "@aztec/l1-artifacts": "0.0.1-commit.9ef841308",
47
- "@aztec/node-keystore": "0.0.1-commit.9ef841308",
48
- "@aztec/noir-contracts.js": "0.0.1-commit.9ef841308",
49
- "@aztec/noir-noirc_abi": "0.0.1-commit.9ef841308",
50
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.9ef841308",
51
- "@aztec/noir-test-contracts.js": "0.0.1-commit.9ef841308",
52
- "@aztec/p2p": "0.0.1-commit.9ef841308",
53
- "@aztec/protocol-contracts": "0.0.1-commit.9ef841308",
54
- "@aztec/prover-client": "0.0.1-commit.9ef841308",
55
- "@aztec/prover-node": "0.0.1-commit.9ef841308",
56
- "@aztec/pxe": "0.0.1-commit.9ef841308",
57
- "@aztec/sequencer-client": "0.0.1-commit.9ef841308",
58
- "@aztec/simulator": "0.0.1-commit.9ef841308",
59
- "@aztec/slasher": "0.0.1-commit.9ef841308",
60
- "@aztec/stdlib": "0.0.1-commit.9ef841308",
61
- "@aztec/telemetry-client": "0.0.1-commit.9ef841308",
62
- "@aztec/validator-client": "0.0.1-commit.9ef841308",
63
- "@aztec/validator-ha-signer": "0.0.1-commit.9ef841308",
64
- "@aztec/wallet-sdk": "0.0.1-commit.9ef841308",
65
- "@aztec/wallets": "0.0.1-commit.9ef841308",
66
- "@aztec/world-state": "0.0.1-commit.9ef841308",
32
+ "@aztec/accounts": "0.0.1-commit.a4600f49",
33
+ "@aztec/archiver": "0.0.1-commit.a4600f49",
34
+ "@aztec/aztec": "0.0.1-commit.a4600f49",
35
+ "@aztec/aztec-node": "0.0.1-commit.a4600f49",
36
+ "@aztec/aztec.js": "0.0.1-commit.a4600f49",
37
+ "@aztec/bb-prover": "0.0.1-commit.a4600f49",
38
+ "@aztec/bb.js": "0.0.1-commit.a4600f49",
39
+ "@aztec/blob-client": "0.0.1-commit.a4600f49",
40
+ "@aztec/blob-lib": "0.0.1-commit.a4600f49",
41
+ "@aztec/bot": "0.0.1-commit.a4600f49",
42
+ "@aztec/cli": "0.0.1-commit.a4600f49",
43
+ "@aztec/constants": "0.0.1-commit.a4600f49",
44
+ "@aztec/entrypoints": "0.0.1-commit.a4600f49",
45
+ "@aztec/epoch-cache": "0.0.1-commit.a4600f49",
46
+ "@aztec/ethereum": "0.0.1-commit.a4600f49",
47
+ "@aztec/foundation": "0.0.1-commit.a4600f49",
48
+ "@aztec/kv-store": "0.0.1-commit.a4600f49",
49
+ "@aztec/l1-artifacts": "0.0.1-commit.a4600f49",
50
+ "@aztec/node-keystore": "0.0.1-commit.a4600f49",
51
+ "@aztec/noir-contracts.js": "0.0.1-commit.a4600f49",
52
+ "@aztec/noir-noirc_abi": "0.0.1-commit.a4600f49",
53
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.a4600f49",
54
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.a4600f49",
55
+ "@aztec/p2p": "0.0.1-commit.a4600f49",
56
+ "@aztec/protocol-contracts": "0.0.1-commit.a4600f49",
57
+ "@aztec/prover-client": "0.0.1-commit.a4600f49",
58
+ "@aztec/prover-node": "0.0.1-commit.a4600f49",
59
+ "@aztec/pxe": "0.0.1-commit.a4600f49",
60
+ "@aztec/sequencer-client": "0.0.1-commit.a4600f49",
61
+ "@aztec/simulator": "0.0.1-commit.a4600f49",
62
+ "@aztec/slasher": "0.0.1-commit.a4600f49",
63
+ "@aztec/standard-contracts": "0.0.1-commit.a4600f49",
64
+ "@aztec/stdlib": "0.0.1-commit.a4600f49",
65
+ "@aztec/telemetry-client": "0.0.1-commit.a4600f49",
66
+ "@aztec/validator-client": "0.0.1-commit.a4600f49",
67
+ "@aztec/validator-ha-signer": "0.0.1-commit.a4600f49",
68
+ "@aztec/wallet-sdk": "0.0.1-commit.a4600f49",
69
+ "@aztec/wallets": "0.0.1-commit.a4600f49",
70
+ "@aztec/world-state": "0.0.1-commit.a4600f49",
67
71
  "@iarna/toml": "^2.2.5",
68
72
  "@jest/globals": "^30.0.0",
69
73
  "@noble/curves": "=1.0.0",
@@ -101,7 +105,7 @@
101
105
  "typescript": "^5.3.3",
102
106
  "util": "^0.12.5",
103
107
  "viem": "npm:@aztec/viem@2.38.2",
104
- "zod": "^3.23.8"
108
+ "zod": "^4"
105
109
  },
106
110
  "devDependencies": {
107
111
  "0x": "^5.7.0",
@@ -159,12 +163,13 @@
159
163
  "moduleNameMapper": {
160
164
  "^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
161
165
  },
166
+ "resolver": "<rootDir>/legacy-jest-resolver.cjs",
162
167
  "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
163
168
  "rootDir": "./src",
164
169
  "testTimeout": 120000,
165
170
  "setupFiles": [
166
171
  "../../foundation/src/jest/setup.mjs"
167
172
  ],
168
- "testEnvironment": "../../foundation/src/jest/env.mjs"
173
+ "testEnvironment": "./shared/timing_env.mjs"
169
174
  }
170
175
  }
@@ -0,0 +1,60 @@
1
+ # `automine` e2e test category
2
+
3
+ Automine tests run a single Aztec node driving the deterministic `AutomineSequencer`: one block per
4
+ submitted transaction, synchronous L1 publish, no committee, no prover, and no validator client. The
5
+ node opts into this topology through the `AUTOMINE_E2E_OPTS` preset (`fixtures/fixtures.ts`), which the
6
+ base context applies by default. This is the fast, deterministic counterpart to the `single-node`
7
+ category, whose node runs the production sequencer with interval block production. A test belongs here
8
+ when it exercises contract or protocol behavior that does not depend on real block-building or consensus
9
+ (token transfers, nested calls, note discovery, tx semantics); it belongs in `single-node` when it
10
+ asserts on sequencer, proving, or reorg behavior.
11
+
12
+ ## Base class
13
+
14
+ All tests use `AutomineTestContext` (`automine_test_context.ts`), which owns:
15
+
16
+ - The environment: an in-process anvil in automine mode plus the L1 contract deploy, wrapping
17
+ `fixtures/setup.ts:setup()` with `AUTOMINE_E2E_OPTS` and `fundSponsoredFPC` as defaults.
18
+ - The common handles: `context`, `wallet`, `aztecNode`, `aztecNodeAdmin`, `cheatCodes`, `sequencer`,
19
+ `accounts`, `defaultAccountAddress`, `logger`.
20
+ - `markProvenAndWarp(seconds)`: marks pending checkpoints proven before warping the L2 clock, so a long
21
+ warp does not trip the rollup's pruning window (see the method's doc comment).
22
+ - `registerContract(...)`: computes and registers a contract instance without an on-chain deploy.
23
+ - `applyManualParentChild()`: deploys a Parent and Child contract for the nested-call tests.
24
+
25
+ Tests call the static `AutomineTestContext.setup({ numberOfAccounts })` factory (or `new` plus `setup()`
26
+ for the harness subclasses), passing `numberOfAccounts` rather than spreading `AUTOMINE_E2E_OPTS`.
27
+
28
+ ## Harnesses
29
+
30
+ Two domain harnesses extend `AutomineTestContext` and run their domain setup after `super.setup()`:
31
+
32
+ - `token/token_contract_test.ts` — a `TokenSimulator` plus opt-in base/mint snapshots for the Token
33
+ contract tests.
34
+ - `token/blacklist_token_contract_test.ts` — a `TokenSimulator`, the `Role` helper, and the
35
+ role-change-delay warp (via `markProvenAndWarp`) for the TokenBlacklist tests.
36
+
37
+ ## Organizing principle
38
+
39
+ The top level groups tests by node topology (automine); the second level names the primary behavior
40
+ under test rather than the shared setup. Each file has a single top-level `describe` named to match its
41
+ path. A `.parallel` suffix marks files with more than one top-level `it`; CI splits each `it` into its
42
+ own job.
43
+
44
+ ## Subfolders
45
+
46
+ A second-level folder is created only when it earns its keep: a shared harness, an existing sub-hierarchy,
47
+ or a coherent domain of several files. The remaining miscellaneous protocol/execution behaviors live as flat
48
+ files directly under `automine/` — smoke, tx ordering/double-spend/phase checks, mempool limits, the app demos
49
+ (card game, private voting), and the timestamp/PXE tests.
50
+
51
+ | Path | Contents |
52
+ |---|---|
53
+ | `token/` | Token-economics tests on the two token harnesses plus the `TokenSimulator`/`LendingSimulator`-adjacent DeFi tests: token transfers/minting/burning/access-control, the blacklist token suite, AMM, lending, NFT, orderbook, crowdfunding, and escrow. |
54
+ | `contracts/` | Contract lifecycle and cross-contract behavior. `deploy/` (class registration, deploy method, legacy deploy, private initialization), `nested/` (importer and the manual private/public nested-call patterns), plus contract updates, storage proofs, static calls, nested utility calls, and the ABI/storage-surface tests (ABI types, option params, state variables). |
55
+ | `accounts/` | Account and key behavior: account contracts, keys, multiple accounts sharing an encryption key, two-PXE interop, authwit, and scope isolation. |
56
+ | `effects/` | Note discovery, events, and offchain effects: note getters, pending note hashes, partial notes, event logs, event-only notes, offchain effects and payments, large public events, custom messages, the tx-effect oracle, and note rediscovery after pruned blocks. |
57
+ | `simulation/` | Circuit simulation surface: the AVM simulator, kernelless simulation, and the circuit recorder. |
58
+
59
+ The `simulation/avm_simulator` file is a genuine outlier: it dumps AVM circuit inputs for the downstream
60
+ `avm_check_circuit` CI job, so it has a bespoke CI line and is excluded from the generic `simulation/` glob.
@@ -0,0 +1,153 @@
1
+ import type { ContractArtifact } from '@aztec/aztec.js/abi';
2
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
3
+ import { type ContractBase, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
4
+ import { Fr } from '@aztec/aztec.js/fields';
5
+ import type { PublicKeys } from '@aztec/aztec.js/keys';
6
+ import type { Logger } from '@aztec/aztec.js/log';
7
+ import type { AztecNode } from '@aztec/aztec.js/node';
8
+ import type { Wallet } from '@aztec/aztec.js/wallet';
9
+ import type { CheatCodes } from '@aztec/aztec/testing';
10
+ import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
11
+ import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
12
+ import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
13
+ import type { PXEConfig } from '@aztec/pxe/config';
14
+ import type { SequencerClient } from '@aztec/sequencer-client';
15
+ import type { AztecNodeAdmin, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
16
+
17
+ import { AUTOMINE_E2E_OPTS } from '../fixtures/fixtures.js';
18
+ import { type EndToEndContext, type SetupOptions, setup, teardown } from '../fixtures/setup.js';
19
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
20
+
21
+ export type AutomineTestOpts = Partial<SetupOptions> & {
22
+ /** Number of accounts to create and deploy during setup. */
23
+ numberOfAccounts?: number;
24
+ /** Options forwarded to PXE creation. */
25
+ pxeOpts?: Partial<PXEConfig>;
26
+ };
27
+
28
+ /**
29
+ * Base class for the automine-sequencer test topology: a single in-process node running the
30
+ * deterministic {@link AUTOMINE_E2E_OPTS} preset (one block per submitted tx, synchronous L1 publish,
31
+ * no committee, no prover, no validator client). Owns the environment (in-proc anvil in automine mode
32
+ * plus the L1 deploy) and exposes the handles every automine test uses (`wallet`, `aztecNode`,
33
+ * `cheatCodes`, `sequencer`, `accounts`, `logger`).
34
+ *
35
+ * The sibling of {@link SingleNodeTestContext}: both wrap the same underlying `fixtures/setup.ts:setup()`
36
+ * but fix opposite sequencer topologies. Making {@link AUTOMINE_E2E_OPTS} the base default removes the
37
+ * per-test-file spread every automine test would otherwise repeat.
38
+ *
39
+ * Domain harnesses (the token simulators) compose on top by extending this base and overriding
40
+ * {@link setup} to run their domain steps after `super.setup()`.
41
+ */
42
+ export class AutomineTestContext {
43
+ public context!: EndToEndContext;
44
+ public logger!: Logger;
45
+ public wallet!: TestWallet;
46
+ public aztecNode!: AztecNode & AztecNodeDebug;
47
+ public aztecNodeAdmin!: AztecNodeAdmin;
48
+ public cheatCodes!: CheatCodes;
49
+ public sequencer!: SequencerClient;
50
+ public accounts!: AztecAddress[];
51
+ public defaultAccountAddress!: AztecAddress;
52
+
53
+ public parentContract!: ParentContract;
54
+ public childContract!: ChildContract;
55
+
56
+ public static async setup<T extends AutomineTestContext>(this: new () => T, opts: AutomineTestOpts = {}): Promise<T> {
57
+ const test = new this();
58
+ await test.setup(opts);
59
+ return test;
60
+ }
61
+
62
+ public async setup(opts: AutomineTestOpts = {}): Promise<void> {
63
+ const { numberOfAccounts = 1, pxeOpts, ...setupOpts } = opts;
64
+ const context = await setup(
65
+ numberOfAccounts,
66
+ {
67
+ ...AUTOMINE_E2E_OPTS,
68
+ fundSponsoredFPC: true,
69
+ ...setupOpts,
70
+ },
71
+ pxeOpts,
72
+ );
73
+ await this.hydrateFromContext(context);
74
+ }
75
+
76
+ /**
77
+ * Populates the context-derived handles from an already-built {@link EndToEndContext}. Split out of
78
+ * {@link setup} so domain harnesses that build the environment with their own bespoke `setup(...)`
79
+ * opts can still reuse the shared handle wiring.
80
+ */
81
+ protected hydrateFromContext(context: EndToEndContext): Promise<void> {
82
+ this.context = context;
83
+ this.logger = context.logger;
84
+ this.wallet = context.wallet;
85
+ this.aztecNode = context.aztecNodeService;
86
+ this.aztecNodeAdmin = context.aztecNodeService;
87
+ this.cheatCodes = context.cheatCodes;
88
+ this.sequencer = context.sequencer!;
89
+ this.accounts = context.accounts;
90
+ this.defaultAccountAddress = context.accounts[0];
91
+ return Promise.resolve();
92
+ }
93
+
94
+ public async teardown(): Promise<void> {
95
+ await teardown(this.context);
96
+ }
97
+
98
+ /**
99
+ * Marks the current pending checkpoints as proven, then warps the L2 clock forward by `seconds`.
100
+ *
101
+ * Under {@link AUTOMINE_E2E_OPTS} a long warp crosses many epochs with no proofs being submitted, so
102
+ * without a prior `markAsProven()` the rollup contract's pruning window resets the chain tip to genesis
103
+ * and the warp's own empty-checkpoint propose fails with `Rollup__InvalidArchive`. Marking proven before
104
+ * warping keeps the pending chain alive. Composes the existing `cheatCodes.rollup.markAsProven` and
105
+ * `warpL2TimeAtLeastBy` with that required ordering.
106
+ */
107
+ public async markProvenAndWarp(seconds: number | bigint): Promise<void> {
108
+ await this.cheatCodes.rollup.markAsProven();
109
+ await this.cheatCodes.warpL2TimeAtLeastBy(this.aztecNode, seconds);
110
+ }
111
+
112
+ /** Computes and registers a contract instance in the wallet without deploying it on-chain. */
113
+ public async registerContract<T extends ContractBase>(
114
+ wallet: Wallet,
115
+ contractArtifact: ContractArtifactClass<T>,
116
+ opts: {
117
+ salt?: Fr;
118
+ publicKeys?: PublicKeys;
119
+ initArgs?: any[];
120
+ constructorName?: string;
121
+ deployer?: AztecAddress;
122
+ } = {},
123
+ ): Promise<T> {
124
+ const { salt, publicKeys, initArgs, constructorName, deployer } = opts;
125
+ const instance = await getContractInstanceFromInstantiationParams(contractArtifact.artifact, {
126
+ constructorArgs: initArgs ?? [],
127
+ constructorArtifact: constructorName,
128
+ salt: salt ?? Fr.random(),
129
+ publicKeys,
130
+ deployer,
131
+ });
132
+ await wallet.registerContract(instance, contractArtifact.artifact);
133
+ return contractArtifact.at(instance.address, wallet);
134
+ }
135
+
136
+ /** Deploys a Parent and a Child contract from the default account for the nested-call tests. */
137
+ public async applyManualParentChild(): Promise<void> {
138
+ this.logger.info('Deploying parent and child contracts');
139
+ ({ contract: this.parentContract } = await ParentContract.deploy(this.wallet).send({
140
+ from: this.defaultAccountAddress,
141
+ }));
142
+ ({ contract: this.childContract } = await ChildContract.deploy(this.wallet).send({
143
+ from: this.defaultAccountAddress,
144
+ }));
145
+ }
146
+ }
147
+
148
+ export type StatefulContractCtorArgs = Parameters<StatefulTestContract['methods']['constructor']>;
149
+
150
+ export type ContractArtifactClass<T extends ContractBase> = {
151
+ at(address: AztecAddress, wallet: Wallet): T;
152
+ artifact: ContractArtifact;
153
+ };
@@ -0,0 +1,177 @@
1
+ import { type InitialAccountData, generateSchnorrAccounts } from '@aztec/accounts/testing';
2
+ import type { FieldLike } from '@aztec/aztec.js/abi';
3
+ import { NO_FROM } from '@aztec/aztec.js/account';
4
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
5
+ import type { AztecNode } from '@aztec/aztec.js/node';
6
+ import { BlockNumber } from '@aztec/foundation/branded-types';
7
+ import { type DeliveryEvent, OnchainDeliveryTestContract } from '@aztec/noir-test-contracts.js/OnchainDeliveryTest';
8
+ import type { PXECreationOptions } from '@aztec/pxe/server';
9
+ import type { AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
10
+
11
+ import { jest } from '@jest/globals';
12
+
13
+ import { AUTOMINE_E2E_OPTS } from '../../fixtures/fixtures.js';
14
+ import { ensureHandshakeRegistryPublished, setup, setupPXEAndGetWallet } from '../../fixtures/setup.js';
15
+ import { TestWallet } from '../../test-wallet/test_wallet.js';
16
+
17
+ // The wallet hook that selects a message's tagging-secret source. Derived from the exported PXE options
18
+ // rather than importing the hook type, which `@aztec/pxe/server` does not re-export.
19
+ export type SenderHook = NonNullable<NonNullable<PXECreationOptions['hooks']>['resolveTaggingSecretStrategy']>;
20
+
21
+ export type Mode = 'constrained' | 'unconstrained';
22
+
23
+ // A single mode applies to both the event and note sends; `{ events, notes }` sends each in its own mode, which
24
+ // exercises cross-mode handshake reuse: bootstrap in one mode, deliver in the other on the same handshake.
25
+ export type DeliveryMode = Mode | { events: Mode; notes: Mode };
26
+
27
+ const formatMode = (mode: DeliveryMode): string => (typeof mode === 'string' ? mode : `${mode.events}->${mode.notes}`);
28
+
29
+ // Onchain private delivery has two orthogonal axes: the delivery MODE (constrained = nullifier-chained sequence;
30
+ // unconstrained = no nullifier, windowed scan) and the tagging-secret SOURCE, which the wallet's
31
+ // `resolveTaggingSecretStrategy` hook selects. This harness exercises (strategy, mode) cells end to end across two
32
+ // PXEs that share only a node: the sender PXE sends, the recipient PXE discovers purely from onchain logs plus the
33
+ // HandshakeRegistry.
34
+ //
35
+ // Cross-PXE is the meaningful setup: the recipient PXE holds no sender state, so a cell only "discovers" a message if
36
+ // the source truly reached it.
37
+ export function buildMessageDeliveryTest(opts: {
38
+ // Names the tagging-secret source, e.g. 'non-interactive handshake' or 'arbitrary secret'. The describe title is
39
+ // derived as `${strategy} x ${mode}`.
40
+ strategy: string;
41
+ mode: DeliveryMode;
42
+ // Required: every cell states its source explicitly rather than leaning on the PXE default (covered by unit tests).
43
+ senderHook: SenderHook;
44
+ // Recipient-side setup the source requires (e.g. registering a raw arbitrary secret); runs once after deployment.
45
+ recipientRegistration?: (
46
+ recipient: TestWallet,
47
+ recipientAddress: AztecAddress,
48
+ sender: AztecAddress,
49
+ ) => Promise<void>;
50
+ // Extra `it()`s to register in this cell's suite, e.g. assertions against state a custom `senderHook` recorded.
51
+ // Called inside the same `describe`, after the two baseline assertions below, so it shares their `beforeAll`
52
+ // instead of depending on Jest's cross-`describe` execution order.
53
+ additionalTests?: () => void;
54
+ }) {
55
+ const { strategy, mode, senderHook, recipientRegistration, additionalTests } = opts;
56
+ const description = `${strategy} x ${formatMode(mode)}`;
57
+
58
+ describe(description, () => {
59
+ jest.setTimeout(300_000);
60
+
61
+ const eventValues = [10n, 20n, 30n];
62
+ const noteValues = [40n, 50n, 60n];
63
+
64
+ let aztecNode: AztecNode & AztecNodeDebug;
65
+ let walletSender: TestWallet;
66
+ let walletRecipient: TestWallet;
67
+ let sender: AztecAddress;
68
+ let recipient: AztecAddress;
69
+ let contractSender: OnchainDeliveryTestContract;
70
+ let teardownSender: () => Promise<void>;
71
+ let teardownRecipient: () => Promise<void>;
72
+ // Discovery results captured in beforeAll, so the assertions in the actual tests below stay pure.
73
+ // A failure during delivery fails beforeAll loudly instead of being swallowed as an expected red.
74
+ let discoveredEvents: FieldLike[];
75
+ let readNotes: bigint[];
76
+
77
+ const { events: eventMode, notes: noteMode } = typeof mode === 'string' ? { events: mode, notes: mode } : mode;
78
+ const sendEvent = (value: bigint) =>
79
+ eventMode === 'constrained'
80
+ ? contractSender.methods.emit_event(recipient, value)
81
+ : contractSender.methods.emit_event_unconstrained(recipient, value);
82
+ const sendNote = (value: bigint) =>
83
+ noteMode === 'constrained'
84
+ ? contractSender.methods.emit_note(recipient, value)
85
+ : contractSender.methods.emit_note_unconstrained(recipient, value);
86
+
87
+ beforeAll(async () => {
88
+ // The sender PXE holds the sender and carries this cell's tagging-secret-strategy hook. The recipient is funded
89
+ // at genesis here but created and deployed on the isolated recipient PXE below, so it carries no sender state
90
+ // from other cells.
91
+ let additionallyFundedAccounts: InitialAccountData[];
92
+ ({
93
+ aztecNode,
94
+ additionallyFundedAccounts,
95
+ wallet: walletSender,
96
+ accounts: [sender],
97
+ teardown: teardownSender,
98
+ } = await setup(1, {
99
+ ...AUTOMINE_E2E_OPTS,
100
+ additionallyFundedAccounts: await generateSchnorrAccounts(1, 'schnorr'),
101
+ pxeCreationOptions: { hooks: { resolveTaggingSecretStrategy: senderHook } },
102
+ }));
103
+
104
+ ({ wallet: walletRecipient, teardown: teardownRecipient } = await setupPXEAndGetWallet(
105
+ aztecNode,
106
+ aztecNode,
107
+ {},
108
+ undefined,
109
+ 'pxe-recipient',
110
+ ));
111
+ const recipientAccount = await walletRecipient.createSchnorrAccount(
112
+ additionallyFundedAccounts[0].secret,
113
+ additionallyFundedAccounts[0].salt,
114
+ additionallyFundedAccounts[0].signingKey,
115
+ );
116
+ await (await recipientAccount.getDeployMethod()).send({ from: NO_FROM });
117
+ recipient = recipientAccount.address;
118
+
119
+ await ensureHandshakeRegistryPublished(walletSender, sender);
120
+ const { contract: deployed, instance } = await OnchainDeliveryTestContract.deploy(walletSender).send({
121
+ from: sender,
122
+ });
123
+ contractSender = deployed;
124
+
125
+ await ensureHandshakeRegistryPublished(walletRecipient, recipient);
126
+ await walletRecipient.registerContract(instance, OnchainDeliveryTestContract.artifact);
127
+
128
+ await recipientRegistration?.(walletRecipient, recipient, sender);
129
+
130
+ // Constrained sends to one pair are strictly ordered, so deliver one tx at a time. The first send bootstraps the
131
+ // handshake (when the source is a handshake); the rest reuse it.
132
+ const blockNumbers: number[] = [];
133
+ for (const value of eventValues) {
134
+ const { receipt } = await sendEvent(value).send({ from: sender });
135
+ blockNumbers.push(receipt.blockNumber!);
136
+ }
137
+ for (const value of noteValues) {
138
+ await sendNote(value).send({ from: sender });
139
+ }
140
+
141
+ await walletRecipient.sync();
142
+
143
+ const events = await walletRecipient.getPrivateEvents<DeliveryEvent>(
144
+ OnchainDeliveryTestContract.events.DeliveryEvent,
145
+ {
146
+ contractAddress: contractSender.address,
147
+ fromBlock: BlockNumber(Math.min(...blockNumbers)),
148
+ toBlock: BlockNumber(Math.max(...blockNumbers) + 1),
149
+ scopes: [recipient],
150
+ },
151
+ );
152
+ discoveredEvents = events.map(e => e.event.value);
153
+
154
+ const contractRecipient = OnchainDeliveryTestContract.at(contractSender.address, walletRecipient);
155
+ const { result } = await contractRecipient.methods.get_note_values(recipient).simulate({ from: recipient });
156
+ readNotes = result.storage.slice(0, Number(result.len));
157
+ });
158
+
159
+ afterAll(async () => {
160
+ await teardownRecipient();
161
+ await teardownSender();
162
+ });
163
+
164
+ it('the recipient PXE discovers the events delivered by the sender PXE', () => {
165
+ expect(discoveredEvents.length).toBe(eventValues.length);
166
+ for (const value of eventValues) {
167
+ expect(discoveredEvents).toContainEqual(value);
168
+ }
169
+ });
170
+
171
+ it('the recipient PXE reads back the notes delivered by the sender PXE', () => {
172
+ expect(readNotes).toEqual(noteValues);
173
+ });
174
+
175
+ additionalTests?.();
176
+ });
177
+ }
@@ -1,21 +1,18 @@
1
1
  import { AztecAddress } from '@aztec/aztec.js/addresses';
2
2
  import { computeSecretHash } from '@aztec/aztec.js/crypto';
3
3
  import { Fr } from '@aztec/aztec.js/fields';
4
- import { type Logger, createLogger } from '@aztec/aztec.js/log';
5
- import type { AztecNode } from '@aztec/aztec.js/node';
4
+ import { createLogger } from '@aztec/aztec.js/log';
6
5
  import type { TxHash } from '@aztec/aztec.js/tx';
7
- import type { CheatCodes } from '@aztec/aztec/testing';
8
6
  import type { TokenContract } from '@aztec/noir-contracts.js/Token';
9
7
  import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
10
8
  import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
11
9
  import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
12
- import type { SequencerClient } from '@aztec/sequencer-client';
13
10
 
14
11
  import { jest } from '@jest/globals';
15
12
 
16
- import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
17
- import { TokenSimulator } from '../simulators/token_simulator.js';
18
- import type { TestWallet } from '../test-wallet/test_wallet.js';
13
+ import { ensureAuthRegistryPublished } from '../../fixtures/setup.js';
14
+ import { TokenSimulator } from '../../simulators/token_simulator.js';
15
+ import { AutomineTestContext, type AutomineTestOpts } from '../automine_test_context.js';
19
16
 
20
17
  export class Role {
21
18
  private isAdmin = false;
@@ -44,35 +41,33 @@ export class Role {
44
41
  }
45
42
  }
46
43
 
47
- export class BlacklistTokenContractTest {
44
+ /**
45
+ * TokenBlacklist-domain harness over the automine topology: extends {@link AutomineTestContext} with a
46
+ * {@link TokenSimulator}, the {@link Role} helper, the TokenBlacklist deploy plus a bad-account and
47
+ * authwit proxy, and the role-change-delay warp. Base setup and mint run in {@link setup}.
48
+ */
49
+ export class BlacklistTokenContractTest extends AutomineTestContext {
48
50
  // This value MUST match the same value that we have in the contract
49
51
  static CHANGE_ROLES_DELAY = 86400;
50
52
 
51
- context!: EndToEndContext;
52
- logger: Logger;
53
- wallet!: TestWallet;
54
53
  asset!: TokenBlacklistContract;
55
54
  tokenSim!: TokenSimulator;
56
55
  badAccount!: InvalidAccountContract;
57
56
  authwitProxy!: GenericProxyContract;
58
- cheatCodes!: CheatCodes;
59
- sequencer!: SequencerClient;
60
- aztecNode!: AztecNode;
61
57
 
62
58
  adminAddress!: AztecAddress;
63
59
  otherAddress!: AztecAddress;
64
60
  blacklistedAddress!: AztecAddress;
65
61
 
62
+ private testName: string;
63
+
66
64
  constructor(testName: string) {
67
- this.logger = createLogger(`e2e:e2e_blacklist_token_contract:${testName}`);
65
+ super();
66
+ this.testName = testName;
68
67
  }
69
68
 
70
69
  async crossTimestampOfChange() {
71
- await this.cheatCodes.warpL2TimeAtLeastBy(
72
- this.sequencer,
73
- this.aztecNode,
74
- BlacklistTokenContractTest.CHANGE_ROLES_DELAY,
75
- );
70
+ await this.markProvenAndWarp(BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
76
71
  }
77
72
 
78
73
  /**
@@ -81,30 +76,18 @@ export class BlacklistTokenContractTest {
81
76
  * 2. Publicly deploy accounts, deploy token contract and a "bad account".
82
77
  */
83
78
  async applyBaseSetup() {
84
- // Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
85
- jest.setTimeout(120_000);
86
-
87
- this.logger.info('Deploying 3 accounts');
88
- const { deployedAccounts } = await deployAccounts(
89
- 3,
90
- this.logger,
91
- )({
92
- wallet: this.context.wallet,
93
- initialFundedAccounts: this.context.initialFundedAccounts,
94
- });
79
+ // Bumped from 2 min: pipelined cadence (~24s/dependent-tx) makes the 3-account deploy plus token/bad-account/
80
+ // proxy deploys exceed the original window.
81
+ jest.setTimeout(600_000);
95
82
 
96
83
  this.cheatCodes = this.context.cheatCodes;
97
84
  this.aztecNode = this.context.aztecNodeService;
98
85
  this.sequencer = this.context.sequencer!;
99
86
  this.wallet = this.context.wallet;
100
- this.adminAddress = deployedAccounts[0].address;
101
- this.otherAddress = deployedAccounts[1].address;
102
- this.blacklistedAddress = deployedAccounts[2].address;
87
+ [this.adminAddress, this.otherAddress, this.blacklistedAddress] = this.context.accounts;
103
88
 
104
89
  this.logger.info('Setting up blacklist token contract');
105
- // Create the token contract state.
106
- this.logger.verbose(`Public deploy accounts...`);
107
- await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
90
+ await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
108
91
 
109
92
  this.logger.verbose(`Deploying TokenContract...`);
110
93
  ({ contract: this.asset } = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
@@ -142,19 +125,13 @@ export class BlacklistTokenContractTest {
142
125
  ).toEqual(new Role().withAdmin().toNoirStruct());
143
126
  }
144
127
 
145
- async setup() {
146
- this.logger.info('Setting up fresh context');
147
- this.context = await setup(0, {
148
- fundSponsoredFPC: true,
149
- skipAccountDeployment: true,
150
- });
128
+ override async setup(opts: AutomineTestOpts = {}) {
129
+ await super.setup({ numberOfAccounts: 3, ...opts });
130
+ // hydrateFromContext repoints `this.logger` at the context logger; restore the harness-named one.
131
+ this.logger = createLogger(`e2e:automine:blacklist:${this.testName}`);
151
132
  await this.applyBaseSetup();
152
133
  }
153
134
 
154
- async teardown() {
155
- await teardown(this.context);
156
- }
157
-
158
135
  async addPendingShieldNoteToPXE(
159
136
  contract: TokenBlacklistContract,
160
137
  recipient: AztecAddress,