@aztec/end-to-end 0.0.1-commit.fce3e4f → 0.0.1-commit.ffe5b04ea

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 (259) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +3 -2
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
  3. package/dest/bench/client_flows/benchmark.js +21 -1
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +15 -16
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
  6. package/dest/bench/client_flows/client_flows_benchmark.js +136 -141
  7. package/dest/bench/client_flows/config.d.ts +2 -2
  8. package/dest/bench/client_flows/config.d.ts.map +1 -1
  9. package/dest/bench/client_flows/config.js +18 -0
  10. package/dest/bench/client_flows/data_extractor.js +3 -1
  11. package/dest/bench/utils.d.ts +9 -8
  12. package/dest/bench/utils.d.ts.map +1 -1
  13. package/dest/bench/utils.js +31 -19
  14. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +9 -8
  15. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +107 -113
  17. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +20 -14
  18. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +92 -71
  20. package/dest/e2e_deploy_contract/deploy_test.d.ts +5 -4
  21. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  22. package/dest/e2e_deploy_contract/deploy_test.js +18 -13
  23. package/dest/e2e_epochs/epochs_test.d.ts +25 -15
  24. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  25. package/dest/e2e_epochs/epochs_test.js +100 -51
  26. package/dest/e2e_fees/bridging_race.notest.js +4 -6
  27. package/dest/e2e_fees/fees_test.d.ts +21 -17
  28. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  29. package/dest/e2e_fees/fees_test.js +137 -145
  30. package/dest/e2e_l1_publisher/write_json.d.ts +4 -3
  31. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
  32. package/dest/e2e_l1_publisher/write_json.js +14 -16
  33. package/dest/e2e_multi_validator/utils.js +1 -1
  34. package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
  35. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  36. package/dest/e2e_nested_contract/nested_contract_test.js +30 -40
  37. package/dest/e2e_p2p/inactivity_slash_test.d.ts +4 -4
  38. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
  39. package/dest/e2e_p2p/inactivity_slash_test.js +6 -9
  40. package/dest/e2e_p2p/p2p_network.d.ts +17 -14
  41. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  42. package/dest/e2e_p2p/p2p_network.js +141 -115
  43. package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
  44. package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
  45. package/dest/e2e_p2p/reqresp/utils.js +177 -0
  46. package/dest/e2e_p2p/shared.d.ts +21 -7
  47. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  48. package/dest/e2e_p2p/shared.js +42 -22
  49. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
  50. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
  51. package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
  52. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
  53. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
  54. package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
  55. package/dest/e2e_token_contract/token_contract_test.d.ts +19 -10
  56. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  57. package/dest/e2e_token_contract/token_contract_test.js +100 -92
  58. package/dest/fixtures/authwit_proxy.d.ts +15 -0
  59. package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
  60. package/dest/fixtures/authwit_proxy.js +30 -0
  61. package/dest/fixtures/e2e_prover_test.d.ts +13 -21
  62. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
  63. package/dest/fixtures/e2e_prover_test.js +114 -133
  64. package/dest/fixtures/elu_monitor.d.ts +21 -0
  65. package/dest/fixtures/elu_monitor.d.ts.map +1 -0
  66. package/dest/fixtures/elu_monitor.js +102 -0
  67. package/dest/fixtures/fixtures.d.ts +6 -3
  68. package/dest/fixtures/fixtures.d.ts.map +1 -1
  69. package/dest/fixtures/fixtures.js +8 -3
  70. package/dest/fixtures/get_acvm_config.js +1 -1
  71. package/dest/fixtures/ha_setup.d.ts +71 -0
  72. package/dest/fixtures/ha_setup.d.ts.map +1 -0
  73. package/dest/fixtures/ha_setup.js +116 -0
  74. package/dest/fixtures/index.d.ts +2 -1
  75. package/dest/fixtures/index.d.ts.map +1 -1
  76. package/dest/fixtures/index.js +1 -0
  77. package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
  78. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  79. package/dest/fixtures/l1_to_l2_messaging.js +2 -2
  80. package/dest/fixtures/setup.d.ts +234 -0
  81. package/dest/fixtures/setup.d.ts.map +1 -0
  82. package/dest/fixtures/setup.js +605 -0
  83. package/dest/fixtures/setup_p2p_test.d.ts +16 -9
  84. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  85. package/dest/fixtures/setup_p2p_test.js +43 -32
  86. package/dest/fixtures/token_utils.d.ts +2 -2
  87. package/dest/fixtures/token_utils.d.ts.map +1 -1
  88. package/dest/fixtures/token_utils.js +12 -8
  89. package/dest/fixtures/utils.d.ts +5 -637
  90. package/dest/fixtures/utils.d.ts.map +1 -1
  91. package/dest/fixtures/utils.js +4 -647
  92. package/dest/fixtures/web3signer.js +1 -1
  93. package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
  94. package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
  95. package/dest/fixtures/with_telemetry_utils.js +2 -2
  96. package/dest/quality_of_service/grafana_client.d.ts +41 -0
  97. package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
  98. package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
  99. package/dest/quality_of_service/prometheus_client.d.ts +38 -0
  100. package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
  101. package/dest/quality_of_service/prometheus_client.js +67 -0
  102. package/dest/shared/cross_chain_test_harness.d.ts +18 -6
  103. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  104. package/dest/shared/cross_chain_test_harness.js +27 -27
  105. package/dest/shared/gas_portal_test_harness.d.ts +12 -2
  106. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  107. package/dest/shared/gas_portal_test_harness.js +3 -3
  108. package/dest/shared/index.d.ts +3 -2
  109. package/dest/shared/index.d.ts.map +1 -1
  110. package/dest/shared/index.js +1 -0
  111. package/dest/shared/jest_setup.js +41 -1
  112. package/dest/shared/mock_state_view.d.ts +86 -0
  113. package/dest/shared/mock_state_view.d.ts.map +1 -0
  114. package/dest/shared/mock_state_view.js +186 -0
  115. package/dest/shared/submit-transactions.d.ts +4 -4
  116. package/dest/shared/submit-transactions.d.ts.map +1 -1
  117. package/dest/shared/submit-transactions.js +9 -11
  118. package/dest/shared/uniswap_l1_l2.d.ts +3 -27
  119. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  120. package/dest/shared/uniswap_l1_l2.js +61 -39
  121. package/dest/simulators/lending_simulator.d.ts +6 -2
  122. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  123. package/dest/simulators/lending_simulator.js +4 -4
  124. package/dest/simulators/token_simulator.d.ts +1 -1
  125. package/dest/simulators/token_simulator.d.ts.map +1 -1
  126. package/dest/simulators/token_simulator.js +3 -24
  127. package/dest/spartan/setup_test_wallets.d.ts +12 -4
  128. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  129. package/dest/spartan/setup_test_wallets.js +96 -37
  130. package/dest/spartan/tx_metrics.d.ts +88 -0
  131. package/dest/spartan/tx_metrics.d.ts.map +1 -0
  132. package/dest/spartan/tx_metrics.js +422 -0
  133. package/dest/spartan/utils/bot.d.ts +28 -0
  134. package/dest/spartan/utils/bot.d.ts.map +1 -0
  135. package/dest/spartan/utils/bot.js +142 -0
  136. package/dest/spartan/utils/chaos.d.ts +79 -0
  137. package/dest/spartan/utils/chaos.d.ts.map +1 -0
  138. package/dest/spartan/utils/chaos.js +142 -0
  139. package/dest/spartan/utils/clients.d.ts +39 -0
  140. package/dest/spartan/utils/clients.d.ts.map +1 -0
  141. package/dest/spartan/utils/clients.js +90 -0
  142. package/dest/spartan/utils/config.d.ts +42 -0
  143. package/dest/spartan/utils/config.d.ts.map +1 -0
  144. package/dest/spartan/utils/config.js +22 -0
  145. package/dest/spartan/utils/health.d.ts +63 -0
  146. package/dest/spartan/utils/health.d.ts.map +1 -0
  147. package/dest/spartan/utils/health.js +202 -0
  148. package/dest/spartan/utils/helm.d.ts +15 -0
  149. package/dest/spartan/utils/helm.d.ts.map +1 -0
  150. package/dest/spartan/utils/helm.js +47 -0
  151. package/dest/spartan/utils/index.d.ts +10 -0
  152. package/dest/spartan/utils/index.d.ts.map +1 -0
  153. package/dest/spartan/utils/index.js +20 -0
  154. package/dest/spartan/utils/k8s.d.ts +128 -0
  155. package/dest/spartan/utils/k8s.d.ts.map +1 -0
  156. package/dest/spartan/utils/k8s.js +381 -0
  157. package/dest/spartan/utils/nodes.d.ts +40 -0
  158. package/dest/spartan/utils/nodes.d.ts.map +1 -0
  159. package/dest/spartan/utils/nodes.js +461 -0
  160. package/dest/spartan/utils/scripts.d.ts +30 -0
  161. package/dest/spartan/utils/scripts.d.ts.map +1 -0
  162. package/dest/spartan/utils/scripts.js +81 -0
  163. package/dest/spartan/utils.d.ts +2 -218
  164. package/dest/spartan/utils.d.ts.map +1 -1
  165. package/dest/spartan/utils.js +1 -749
  166. package/dest/test-wallet/test_wallet.d.ts +83 -0
  167. package/dest/test-wallet/test_wallet.d.ts.map +1 -0
  168. package/dest/test-wallet/test_wallet.js +214 -0
  169. package/dest/test-wallet/utils.d.ts +41 -0
  170. package/dest/test-wallet/utils.d.ts.map +1 -0
  171. package/dest/test-wallet/utils.js +71 -0
  172. package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
  173. package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
  174. package/dest/test-wallet/wallet_worker_script.js +48 -0
  175. package/dest/test-wallet/worker_wallet.d.ts +52 -0
  176. package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
  177. package/dest/test-wallet/worker_wallet.js +151 -0
  178. package/dest/test-wallet/worker_wallet_schema.d.ts +274 -0
  179. package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
  180. package/dest/test-wallet/worker_wallet_schema.js +10 -0
  181. package/package.json +49 -45
  182. package/src/bench/client_flows/benchmark.ts +24 -2
  183. package/src/bench/client_flows/client_flows_benchmark.ts +156 -215
  184. package/src/bench/client_flows/config.ts +9 -1
  185. package/src/bench/client_flows/data_extractor.ts +1 -1
  186. package/src/bench/utils.ts +36 -21
  187. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +120 -145
  188. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -126
  189. package/src/e2e_deploy_contract/deploy_test.ts +22 -15
  190. package/src/e2e_epochs/epochs_test.ts +162 -113
  191. package/src/e2e_fees/bridging_race.notest.ts +5 -11
  192. package/src/e2e_fees/fees_test.ts +178 -228
  193. package/src/e2e_l1_publisher/write_json.ts +16 -16
  194. package/src/e2e_multi_validator/utils.ts +1 -1
  195. package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
  196. package/src/e2e_p2p/inactivity_slash_test.ts +7 -10
  197. package/src/e2e_p2p/p2p_network.ts +204 -181
  198. package/src/e2e_p2p/reqresp/utils.ts +235 -0
  199. package/src/e2e_p2p/shared.ts +77 -29
  200. package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
  201. package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
  202. package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
  203. package/src/e2e_token_contract/token_contract_test.ts +121 -119
  204. package/src/fixtures/authwit_proxy.ts +50 -0
  205. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  206. package/src/fixtures/e2e_prover_test.ts +136 -177
  207. package/src/fixtures/elu_monitor.ts +126 -0
  208. package/src/fixtures/fixtures.ts +12 -5
  209. package/src/fixtures/get_acvm_config.ts +1 -1
  210. package/src/fixtures/ha_setup.ts +186 -0
  211. package/src/fixtures/index.ts +1 -0
  212. package/src/fixtures/l1_to_l2_messaging.ts +4 -2
  213. package/src/fixtures/setup.ts +897 -0
  214. package/src/fixtures/setup_p2p_test.ts +43 -47
  215. package/src/fixtures/token_utils.ts +10 -6
  216. package/src/fixtures/utils.ts +27 -966
  217. package/src/fixtures/web3signer.ts +1 -1
  218. package/src/fixtures/with_telemetry_utils.ts +2 -2
  219. package/src/guides/up_quick_start.sh +3 -3
  220. package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
  221. package/src/quality_of_service/prometheus_client.ts +113 -0
  222. package/src/shared/cross_chain_test_harness.ts +30 -43
  223. package/src/shared/gas_portal_test_harness.ts +3 -3
  224. package/src/shared/index.ts +2 -1
  225. package/src/shared/jest_setup.ts +51 -1
  226. package/src/shared/mock_state_view.ts +188 -0
  227. package/src/shared/submit-transactions.ts +11 -16
  228. package/src/shared/uniswap_l1_l2.ts +71 -92
  229. package/src/simulators/lending_simulator.ts +7 -5
  230. package/src/simulators/token_simulator.ts +6 -30
  231. package/src/spartan/DEVELOP.md +7 -0
  232. package/src/spartan/setup_test_wallets.ts +130 -28
  233. package/src/spartan/tx_metrics.ts +376 -0
  234. package/src/spartan/utils/bot.ts +188 -0
  235. package/src/spartan/utils/chaos.ts +253 -0
  236. package/src/spartan/utils/clients.ts +100 -0
  237. package/src/spartan/utils/config.ts +28 -0
  238. package/src/spartan/utils/health.ts +255 -0
  239. package/src/spartan/utils/helm.ts +84 -0
  240. package/src/spartan/utils/index.ts +68 -0
  241. package/src/spartan/utils/k8s.ts +535 -0
  242. package/src/spartan/utils/nodes.ts +543 -0
  243. package/src/spartan/utils/scripts.ts +99 -0
  244. package/src/spartan/utils.ts +1 -942
  245. package/src/test-wallet/test_wallet.ts +306 -0
  246. package/src/test-wallet/utils.ts +112 -0
  247. package/src/test-wallet/wallet_worker_script.ts +60 -0
  248. package/src/test-wallet/worker_wallet.ts +213 -0
  249. package/src/test-wallet/worker_wallet_schema.ts +13 -0
  250. package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
  251. package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
  252. package/dest/fixtures/setup_l1_contracts.js +0 -17
  253. package/dest/fixtures/snapshot_manager.d.ts +0 -95
  254. package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
  255. package/dest/fixtures/snapshot_manager.js +0 -505
  256. package/dest/quality_of_service/alert_checker.d.ts +0 -41
  257. package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
  258. package/src/fixtures/setup_l1_contracts.ts +0 -26
  259. package/src/fixtures/snapshot_manager.ts +0 -665
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Fetches a ERC20 balance storage proof from the Ethereum mainnet and saves it to a Prover.toml compatible JSON.
3
+ * The JSON can be converted to toml for use with nargo, or used directly as a JSON file when used in
4
+ * Aztec contracts. This script is not using any Aztec library code, so it's easily portable.
5
+ */
6
+ import fs from 'fs';
7
+ import { dirname, join } from 'path';
8
+ import { fileURLToPath } from 'url';
9
+ import { createPublicClient, encodeAbiParameters, fromRlp, hexToBytes, http, keccak256 } from 'viem';
10
+ import { mainnet } from 'viem/chains';
11
+
12
+ const __dirname = dirname(fileURLToPath(import.meta.url));
13
+
14
+ const RPC_URL = process.env.RPC_URL;
15
+ const ERC20_CONTRACT = (process.env.ERC20_CONTRACT || '0xdAC17F958D2ee523a2206206994597C13D831ec7') as `0x${string}`;
16
+ const HOLDER = (process.env.HOLDER || '0x23878914EFE38d27C4D67Ab83ed1b93A74D4086a') as `0x${string}`;
17
+ const SLOT = BigInt(process.env.SLOT || '2');
18
+ const BLOCK_TAG = process.env.BLOCK_NUMBER ? BigInt(process.env.BLOCK_NUMBER) : 'latest';
19
+ const MAX_ACCOUNT_PATH = 15;
20
+ const MAX_STORAGE_PATH = 10;
21
+
22
+ function padTo(arr: number[], len: number) {
23
+ return [...arr, ...Array(len - arr.length).fill(0)].slice(0, len);
24
+ }
25
+
26
+ function toBytes(hex: `0x${string}`) {
27
+ return Array.from(hexToBytes(hex));
28
+ }
29
+
30
+ function bytesToU64s(bytes: number[]) {
31
+ const paddedBytes = padTo(bytes, 32);
32
+ return Array.from({ length: 4 }, (_, i) => {
33
+ let val = 0n;
34
+ for (let j = 0; j < 8; j++) {
35
+ val += BigInt(paddedBytes[i * 8 + j]) << BigInt(j * 8);
36
+ }
37
+ return val.toString();
38
+ });
39
+ }
40
+
41
+ function toBytesAndLen(val: bigint | number) {
42
+ if (val === 0n || val === 0) {
43
+ return { bytes: [0], length: 0 };
44
+ }
45
+ let hex = val.toString(16);
46
+ if (hex.length % 2) {
47
+ hex = '0' + hex;
48
+ }
49
+ const bytes = toBytes(`0x${hex}`);
50
+ return { bytes, length: bytes.length };
51
+ }
52
+
53
+ function parseNode(rlp: `0x${string}`) {
54
+ // Should be safe when working with branches and extensions without embedded children.
55
+ const decoded = fromRlp(rlp) as `0x${string}`[];
56
+ const node = {
57
+ rows: Array(16)
58
+ .fill(0)
59
+ .map(() => Array(32).fill(0)),
60
+ row_exist: Array(16).fill(false),
61
+ node_type: 0,
62
+ };
63
+
64
+ if (decoded.length === 17) {
65
+ for (let i = 0; i < 16; i++) {
66
+ if (decoded[i] !== '0x') {
67
+ node.row_exist[i] = true;
68
+ node.rows[i] = padTo(toBytes(decoded[i]), 32);
69
+ }
70
+ }
71
+ } else if (decoded.length === 2) {
72
+ const keyBytes = toBytes(decoded[0]);
73
+ const prefix = keyBytes[0];
74
+ if (prefix >> 4 >= 2) {
75
+ throw new Error('Unsupported: leaf node in proof path');
76
+ }
77
+ node.node_type = 1;
78
+ // Extension header format expected by the noir code: check out storage_proof types.nr.
79
+ node.rows[0][0] = prefix >> 4;
80
+ node.rows[0][8] = prefix & 0x0f;
81
+ node.rows[0][16] = keyBytes.length - 1;
82
+
83
+ for (let i = 1; i < keyBytes.length && i < 32; i++) {
84
+ node.rows[1][i - 1] = keyBytes[i];
85
+ }
86
+ node.rows[2] = padTo(toBytes(decoded[1]), 32);
87
+ node.row_exist[0] = node.row_exist[1] = node.row_exist[2] = true;
88
+ }
89
+ return node;
90
+ }
91
+
92
+ function parseProof(proof: `0x${string}`[], maxLen: number) {
93
+ const nodes = proof.slice(0, -1).slice(0, maxLen).map(parseNode);
94
+ while (nodes.length < maxLen) {
95
+ nodes.push({
96
+ rows: Array(16)
97
+ .fill(0)
98
+ .map(() => Array(32).fill(0)),
99
+ row_exist: Array(16).fill(false),
100
+ node_type: 0,
101
+ });
102
+ }
103
+ return nodes;
104
+ }
105
+
106
+ function nodeToLibFormat(node: { rows: number[][]; row_exist: boolean[]; node_type: number }) {
107
+ return {
108
+ rows: node.rows.map(bytesToU64s),
109
+ row_exist: node.row_exist,
110
+ node_type: String(node.node_type),
111
+ };
112
+ }
113
+
114
+ async function main() {
115
+ if (!RPC_URL) {
116
+ throw new Error('RPC_URL is not set');
117
+ }
118
+ const storageKey = keccak256(encodeAbiParameters([{ type: 'address' }, { type: 'uint256' }], [HOLDER, SLOT]));
119
+ console.log(`Fetching storage proof for ${ERC20_CONTRACT}, holder ${HOLDER}, slot ${SLOT}`);
120
+ console.log(`Storage key: ${storageKey}`);
121
+
122
+ const client = createPublicClient({
123
+ chain: mainnet,
124
+ transport: http(RPC_URL),
125
+ });
126
+
127
+ const [blockNumber, proof, block] = await Promise.all([
128
+ client.getBlockNumber(),
129
+ client.getProof({
130
+ address: ERC20_CONTRACT,
131
+ storageKeys: [storageKey],
132
+ blockNumber: BLOCK_TAG === 'latest' ? undefined : BLOCK_TAG,
133
+ }),
134
+ client.getBlock({
135
+ blockNumber: BLOCK_TAG === 'latest' ? undefined : BLOCK_TAG,
136
+ }),
137
+ ]);
138
+
139
+ const storageProof = proof.storageProof[0];
140
+ console.log(
141
+ `Block: ${blockNumber}, Account nodes: ${proof.accountProof.length}, Storage nodes: ${storageProof.proof.length}`,
142
+ );
143
+ console.log(`Value: ${storageProof.value}`);
144
+
145
+ // The -1 is because the last node in the proof is the leaf, which is excluded from path verification.
146
+ const accountPathLen = proof.accountProof.length - 1;
147
+ const storagePathLen = storageProof.proof.length - 1;
148
+ if (accountPathLen > MAX_ACCOUNT_PATH) {
149
+ throw new Error(
150
+ `Account proof path length ${accountPathLen} exceeds MAX_ACCOUNT_PATH ${MAX_ACCOUNT_PATH}. Increase the limit.`,
151
+ );
152
+ }
153
+ if (storagePathLen > MAX_STORAGE_PATH) {
154
+ throw new Error(
155
+ `Storage proof path length ${storagePathLen} exceeds MAX_STORAGE_PATH ${MAX_STORAGE_PATH}. Increase the limit.`,
156
+ );
157
+ }
158
+
159
+ const nonce = toBytesAndLen(proof.nonce);
160
+ const balance = toBytesAndLen(proof.balance);
161
+ const slotValue = toBytesAndLen(storageProof.value);
162
+
163
+ const data = {
164
+ account_nodes: parseProof(proof.accountProof, MAX_ACCOUNT_PATH).map(nodeToLibFormat),
165
+ account_node_length: String(accountPathLen),
166
+ storage_nodes: parseProof(storageProof.proof, MAX_STORAGE_PATH).map(nodeToLibFormat),
167
+ storage_node_length: String(storagePathLen),
168
+ account: {
169
+ nonce: padTo(nonce.bytes, 8).map(String),
170
+ nonce_length: String(nonce.length),
171
+ balance: padTo(balance.bytes, 32).map(String),
172
+ balance_length: String(balance.length),
173
+ address: toBytes(ERC20_CONTRACT).map(String),
174
+ storage_hash: bytesToU64s(toBytes(proof.storageHash)),
175
+ code_hash: bytesToU64s(toBytes(proof.codeHash)),
176
+ },
177
+ slot: {
178
+ value: padTo(slotValue.bytes, 32).map(String),
179
+ value_length: String(slotValue.length),
180
+ },
181
+ slot_key: toBytes(storageKey).map(String),
182
+ root: bytesToU64s(toBytes(block.stateRoot)),
183
+ block_number: String(blockNumber),
184
+ };
185
+
186
+ fs.writeFileSync(join(__dirname, 'storage_proof.json'), JSON.stringify(data, null, 2));
187
+ console.log('storage_proof.json generated');
188
+ }
189
+
190
+ main().catch(console.error);
@@ -0,0 +1,173 @@
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
3
+ import { Fr } from '@aztec/foundation/curves/bn254';
4
+ import { EthAddress } from '@aztec/foundation/eth-address';
5
+ import { Capsule } from '@aztec/stdlib/tx';
6
+
7
+ import { readFileSync } from 'fs';
8
+ import { dirname, join } from 'path';
9
+ import { fileURLToPath } from 'url';
10
+
11
+ const __dirname = dirname(fileURLToPath(import.meta.url));
12
+ const FIXTURE_PATH = join(__dirname, './storage_proof.json');
13
+
14
+ // Constants matching the Noir contract
15
+ const ACCOUNT_CAPSULE_KEY_SEPARATOR = 100;
16
+ const ACCOUNT_PROOF_CAPSULE_KEY_SEPARATOR = 101;
17
+ const STORAGE_PROOF_CAPSULE_KEY_SEPARATOR = 102;
18
+ const STORAGE_PROOF_NODE_CAPSULE_KEY_SEPARATOR = 103;
19
+ const MAX_ACCOUNT_PROOF_LENGTH = 15;
20
+ /** Node: rows [[u64;4];16] (64) + row_exist [bool;16] (16) + node_type u8 (1) = 81 fields */
21
+ const NODE_FIELD_COUNT = 81;
22
+
23
+ // --- JSON fixture types ---
24
+
25
+ type JsonNode = { rows: string[][]; row_exist: boolean[]; node_type: string };
26
+
27
+ type JsonAccount = {
28
+ nonce: string[];
29
+ balance: string[];
30
+ address: string[];
31
+ nonce_length: string;
32
+ balance_length: string;
33
+ storage_hash: string[];
34
+ code_hash: string[];
35
+ };
36
+
37
+ type StorageProofJSON = {
38
+ root: string[];
39
+ slot_key: string[];
40
+ account_node_length: string;
41
+ storage_node_length: string;
42
+ account_nodes: JsonNode[];
43
+ storage_nodes: JsonNode[];
44
+ account: JsonAccount;
45
+ slot: { value: string[]; value_length: string };
46
+ };
47
+
48
+ // --- Serialization helpers (Noir struct Serialize layout) ---
49
+
50
+ function serializeNode(node: JsonNode): Fr[] {
51
+ const fields: Fr[] = [];
52
+ for (const row of node.rows) {
53
+ for (const val of row) {
54
+ fields.push(new Fr(BigInt(val)));
55
+ }
56
+ }
57
+ for (const exists of node.row_exist) {
58
+ fields.push(new Fr(exists ? 1n : 0n));
59
+ }
60
+ fields.push(new Fr(BigInt(node.node_type)));
61
+ return fields;
62
+ }
63
+
64
+ /** Account: nonce [u8;8] + balance [u8;32] + address [u8;20] + nonce_length u8 + balance_length u8 + storage_hash [u64;4] + code_hash [u64;4] = 70 fields */
65
+ function serializeAccount(account: JsonAccount): Fr[] {
66
+ const fields: Fr[] = [];
67
+ for (const v of account.nonce) {
68
+ fields.push(new Fr(BigInt(v)));
69
+ }
70
+ for (const v of account.balance) {
71
+ fields.push(new Fr(BigInt(v)));
72
+ }
73
+ for (const v of account.address) {
74
+ fields.push(new Fr(BigInt(v)));
75
+ }
76
+ fields.push(new Fr(BigInt(account.nonce_length)));
77
+ fields.push(new Fr(BigInt(account.balance_length)));
78
+ for (const v of account.storage_hash) {
79
+ fields.push(new Fr(BigInt(v)));
80
+ }
81
+ for (const v of account.code_hash) {
82
+ fields.push(new Fr(BigInt(v)));
83
+ }
84
+ return fields;
85
+ }
86
+
87
+ function zeroNode(): Fr[] {
88
+ return Array(NODE_FIELD_COUNT).fill(Fr.ZERO);
89
+ }
90
+
91
+ // --- Public API ---
92
+
93
+ /** Parsed + typed fixture data ready for use as contract function arguments. */
94
+ export type StorageProofArgs = {
95
+ ethAddress: EthAddress;
96
+ slotKey: number[];
97
+ slotContents: { value: number[]; value_length: number };
98
+ root: bigint[];
99
+ };
100
+
101
+ /** Loads the storage proof fixture from disk and returns the contract args. */
102
+ export function loadStorageProofArgs(): StorageProofArgs {
103
+ const fixture: StorageProofJSON = JSON.parse(readFileSync(FIXTURE_PATH, 'utf8'));
104
+ const addressBytes = Buffer.from(fixture.account.address.map(v => Number(v)));
105
+ return {
106
+ ethAddress: EthAddress.fromString('0x' + addressBytes.toString('hex')),
107
+ slotKey: fixture.slot_key.map(v => Number(v)),
108
+ slotContents: {
109
+ value: fixture.slot.value.map(v => Number(v)),
110
+ // eslint-disable-next-line camelcase
111
+ value_length: Number(fixture.slot.value_length),
112
+ },
113
+ root: fixture.root.map(v => BigInt(v)),
114
+ };
115
+ }
116
+
117
+ /** Builds all the capsules the StorageProofTest contract expects during private execution. */
118
+ export async function buildStorageProofCapsules(contractAddress: AztecAddress): Promise<Capsule[]> {
119
+ const fixture: StorageProofJSON = JSON.parse(readFileSync(FIXTURE_PATH, 'utf8'));
120
+
121
+ const root = fixture.root.map(v => BigInt(v));
122
+ const slotKey = fixture.slot_key.map(v => Number(v));
123
+ const accountNodeLength = Number(fixture.account_node_length);
124
+ const storageNodeLength = Number(fixture.storage_node_length);
125
+ const ethAddress = EthAddress.fromBuffer(Buffer.from(fixture.account.address.map(v => Number(v))));
126
+
127
+ // Compute capsule keys (must match the Noir contract's poseidon2_hash computations)
128
+ const addressCapsuleKey = await poseidon2Hash([
129
+ new Fr(ACCOUNT_CAPSULE_KEY_SEPARATOR),
130
+ ...root.map(v => new Fr(v)),
131
+ ethAddress.toField(),
132
+ ]);
133
+
134
+ const accountProofCapsuleKey = await poseidon2Hash([new Fr(ACCOUNT_PROOF_CAPSULE_KEY_SEPARATOR), addressCapsuleKey]);
135
+
136
+ const storageProofCapsuleKey = await poseidon2Hash([
137
+ new Fr(STORAGE_PROOF_CAPSULE_KEY_SEPARATOR),
138
+ addressCapsuleKey,
139
+ ...slotKey.map(v => new Fr(v)),
140
+ ]);
141
+
142
+ // Build capsule data
143
+
144
+ // 1. Account data
145
+ const accountData = serializeAccount(fixture.account);
146
+
147
+ // 2. Account proof nodes padded to MAX_ACCOUNT_PROOF_LENGTH
148
+ const accountProofData: Fr[] = [new Fr(accountNodeLength)];
149
+ for (let i = 0; i < MAX_ACCOUNT_PROOF_LENGTH; i++) {
150
+ accountProofData.push(...(i < fixture.account_nodes.length ? serializeNode(fixture.account_nodes[i]) : zeroNode()));
151
+ }
152
+
153
+ // 3. Storage proof length (u32)
154
+ const storageProofLengthData = [new Fr(storageNodeLength)];
155
+
156
+ const capsules: Capsule[] = [
157
+ new Capsule(contractAddress, addressCapsuleKey, accountData),
158
+ new Capsule(contractAddress, accountProofCapsuleKey, accountProofData),
159
+ new Capsule(contractAddress, storageProofCapsuleKey, storageProofLengthData),
160
+ ];
161
+
162
+ // 4. Individual storage node capsules for private recursion.
163
+ for (let i = 0; i < storageNodeLength; i++) {
164
+ const nodeCapsuleKey = await poseidon2Hash([
165
+ new Fr(STORAGE_PROOF_NODE_CAPSULE_KEY_SEPARATOR),
166
+ storageProofCapsuleKey,
167
+ new Fr(i),
168
+ ]);
169
+ capsules.push(new Capsule(contractAddress, nodeCapsuleKey, serializeNode(fixture.storage_nodes[i])));
170
+ }
171
+
172
+ return capsules;
173
+ }
@@ -2,166 +2,168 @@ import { AztecAddress } from '@aztec/aztec.js/addresses';
2
2
  import { type Logger, createLogger } from '@aztec/aztec.js/log';
3
3
  import type { AztecNode } from '@aztec/aztec.js/node';
4
4
  import { TokenContract } from '@aztec/noir-contracts.js/Token';
5
+ import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
5
6
  import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
6
- import type { TestWallet } from '@aztec/test-wallet/server';
7
7
 
8
8
  import { jest } from '@jest/globals';
9
9
 
10
- import {
11
- type ISnapshotManager,
12
- type SubsystemsContext,
13
- createSnapshotManager,
14
- deployAccounts,
15
- publicDeployAccounts,
16
- } from '../fixtures/snapshot_manager.js';
10
+ import { type EndToEndContext, deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
17
11
  import { mintTokensToPrivate } from '../fixtures/token_utils.js';
18
12
  import { TokenSimulator } from '../simulators/token_simulator.js';
13
+ import type { TestWallet } from '../test-wallet/test_wallet.js';
19
14
 
20
- const { E2E_DATA_PATH: dataPath, METRICS_PORT: metricsPort } = process.env;
15
+ const { METRICS_PORT: metricsPort } = process.env;
21
16
 
22
17
  export class TokenContractTest {
23
18
  static TOKEN_NAME = 'USDC';
24
19
  static TOKEN_SYMBOL = 'USD';
25
20
  static TOKEN_DECIMALS = 18n;
26
- private snapshotManager: ISnapshotManager;
21
+ context!: EndToEndContext;
27
22
  logger: Logger;
23
+ metricsPort?: number;
28
24
  asset!: TokenContract;
29
25
  tokenSim!: TokenSimulator;
30
26
  node!: AztecNode;
31
27
 
32
28
  badAccount!: InvalidAccountContract;
29
+ authwitProxy!: GenericProxyContract;
33
30
  wallet!: TestWallet;
34
31
  adminAddress!: AztecAddress;
35
32
  account1Address!: AztecAddress;
36
33
  account2Address!: AztecAddress;
37
34
 
35
+ private shouldApplyBaseSetup = false;
36
+ private shouldApplyMint = false;
37
+
38
38
  constructor(testName: string) {
39
39
  this.logger = createLogger(`e2e:e2e_token_contract:${testName}`);
40
- this.snapshotManager = createSnapshotManager(`e2e_token_contract/${testName}`, dataPath, {
41
- metricsPort: metricsPort ? parseInt(metricsPort) : undefined,
42
- });
40
+ this.metricsPort = metricsPort ? parseInt(metricsPort) : undefined;
41
+ }
42
+
43
+ /**
44
+ * Registers that base setup should be applied during setup().
45
+ * Call this before setup() to deploy 3 accounts, publicly deploy accounts, token contract and a "bad account".
46
+ */
47
+ applyBaseSnapshots() {
48
+ this.shouldApplyBaseSetup = true;
43
49
  }
44
50
 
45
51
  /**
46
- * Adds two state shifts to snapshot manager.
47
- * 1. Add 3 accounts.
48
- * 2. Publicly deploy accounts, deploy token contract and a "bad account".
52
+ * Registers that mint should be applied during setup().
53
+ * Call this before setup() to mint tokens to the admin account.
49
54
  */
50
- async applyBaseSnapshots() {
55
+ applyMintSnapshot() {
56
+ this.shouldApplyMint = true;
57
+ }
58
+
59
+ /**
60
+ * Applies base setup: deploys 3 accounts, publicly deploys accounts, token contract and a "bad account".
61
+ */
62
+ private async applyBaseSetup() {
51
63
  // Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
52
64
  jest.setTimeout(120_000);
53
65
 
54
- await this.snapshotManager.snapshot(
55
- '3_accounts',
56
- deployAccounts(3, this.logger),
57
- ({ deployedAccounts }, { wallet, aztecNode }) => {
58
- this.node = aztecNode;
59
- this.wallet = wallet;
60
- [this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map(acc => acc.address);
61
- return Promise.resolve();
62
- },
63
- );
66
+ this.logger.info('Applying base setup - deploying 3 accounts');
67
+ const { deployedAccounts } = await deployAccounts(
68
+ 3,
69
+ this.logger,
70
+ )({
71
+ wallet: this.context.wallet,
72
+ initialFundedAccounts: this.context.initialFundedAccounts,
73
+ });
64
74
 
65
- await this.snapshotManager.snapshot(
66
- 'e2e_token_contract',
67
- async () => {
68
- // Create the token contract state.
69
- // Move this account thing to addAccounts above?
70
- this.logger.verbose(`Public deploy accounts...`);
71
- await publicDeployAccounts(this.wallet, [this.adminAddress, this.account1Address]);
72
-
73
- this.logger.verbose(`Deploying TokenContract...`);
74
- const asset = await TokenContract.deploy(
75
- this.wallet,
76
- this.adminAddress,
77
- TokenContractTest.TOKEN_NAME,
78
- TokenContractTest.TOKEN_SYMBOL,
79
- TokenContractTest.TOKEN_DECIMALS,
80
- )
81
- .send({ from: this.adminAddress })
82
- .deployed();
83
- this.logger.verbose(`Token deployed to ${asset.address}`);
84
-
85
- this.logger.verbose(`Deploying bad account...`);
86
- this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
87
- this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
88
-
89
- return { tokenContractAddress: asset.address, badAccountAddress: this.badAccount.address };
90
- },
91
- async ({ tokenContractAddress, badAccountAddress }) => {
92
- // Restore the token contract state.
93
- this.asset = TokenContract.at(tokenContractAddress, this.wallet);
94
- this.logger.verbose(`Token contract address: ${this.asset.address}`);
95
-
96
- this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
97
- this.adminAddress,
98
- this.account1Address,
99
- ]);
100
-
101
- this.badAccount = InvalidAccountContract.at(badAccountAddress, this.wallet);
102
- this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
103
-
104
- expect(await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).toBe(
105
- this.adminAddress.toBigInt(),
106
- );
107
- },
75
+ this.node = this.context.aztecNodeService;
76
+ this.wallet = this.context.wallet;
77
+ [this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map(acc => acc.address);
78
+
79
+ this.logger.info('Applying base setup - deploying token contract');
80
+ this.logger.verbose(`Public deploy accounts...`);
81
+ await publicDeployAccounts(this.wallet, [this.adminAddress, this.account1Address]);
82
+
83
+ this.logger.verbose(`Deploying TokenContract...`);
84
+ ({ contract: this.asset } = await TokenContract.deploy(
85
+ this.wallet,
86
+ this.adminAddress,
87
+ TokenContractTest.TOKEN_NAME,
88
+ TokenContractTest.TOKEN_SYMBOL,
89
+ TokenContractTest.TOKEN_DECIMALS,
90
+ ).send({ from: this.adminAddress }));
91
+ this.logger.verbose(`Token deployed to ${this.asset.address}`);
92
+
93
+ this.logger.verbose(`Deploying bad account...`);
94
+ ({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
95
+ from: this.adminAddress,
96
+ }));
97
+ this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
98
+
99
+ // Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
100
+ // (so their notes are in scope), but msg_sender in the target must differ from the note owner
101
+ // to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
102
+ this.logger.verbose(`Deploying generic proxy...`);
103
+ ({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
104
+ from: this.adminAddress,
105
+ }));
106
+ this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
107
+
108
+ this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
109
+ this.adminAddress,
110
+ this.account1Address,
111
+ ]);
112
+
113
+ expect((await this.asset.methods.get_admin().simulate({ from: this.adminAddress })).result).toBe(
114
+ this.adminAddress.toBigInt(),
108
115
  );
109
-
110
- // TokenContract.artifact.functions.forEach(fn => {
111
- // const sig = decodeFunctionSignature(fn.name, fn.parameters);
112
- // logger.verbose(`Function ${sig} and the selector: ${FunctionSelector.fromNameAndParameters(fn.name, fn.parameters)}`);
113
- // });
114
116
  }
115
117
 
116
118
  async setup() {
117
- await this.snapshotManager.setup();
118
- }
119
+ this.context = await setup(0, {
120
+ metricsPort: this.metricsPort,
121
+ fundSponsoredFPC: true,
122
+ skipAccountDeployment: true,
123
+ });
119
124
 
120
- snapshot = <T>(
121
- name: string,
122
- apply: (context: SubsystemsContext) => Promise<T>,
123
- restore: (snapshotData: T, context: SubsystemsContext) => Promise<void> = () => Promise.resolve(),
124
- ): Promise<void> => this.snapshotManager.snapshot(name, apply, restore);
125
+ if (this.shouldApplyBaseSetup) {
126
+ await this.applyBaseSetup();
127
+ }
128
+
129
+ if (this.shouldApplyMint) {
130
+ await this.applyMint();
131
+ }
132
+ }
125
133
 
126
134
  async teardown() {
127
- await this.snapshotManager.teardown();
135
+ await teardown(this.context);
128
136
  }
129
137
 
130
- async applyMintSnapshot() {
131
- await this.snapshotManager.snapshot(
132
- 'mint',
133
- async () => {
134
- const { asset, adminAddress } = this;
135
- const amount = 10000n;
136
-
137
- this.logger.verbose(`Minting ${amount} publicly...`);
138
- await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress }).wait();
139
-
140
- this.logger.verbose(`Minting ${amount} privately...`);
141
- await mintTokensToPrivate(asset, adminAddress, adminAddress, amount);
142
- this.logger.verbose(`Minting complete.`);
143
-
144
- return { amount };
145
- },
146
- async ({ amount }) => {
147
- const { asset, adminAddress, tokenSim } = this;
148
- tokenSim.mintPublic(adminAddress, amount);
149
-
150
- const publicBalance = await asset.methods.balance_of_public(adminAddress).simulate({ from: adminAddress });
151
- this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
152
- expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(adminAddress));
153
-
154
- tokenSim.mintPrivate(adminAddress, amount);
155
- const privateBalance = await asset.methods.balance_of_private(adminAddress).simulate({ from: adminAddress });
156
- this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
157
- expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(adminAddress));
158
-
159
- const totalSupply = await asset.methods.total_supply().simulate({ from: adminAddress });
160
- this.logger.verbose(`Total supply: ${totalSupply}`);
161
- expect(totalSupply).toEqual(tokenSim.totalSupply);
162
-
163
- return Promise.resolve();
164
- },
165
- );
138
+ private async applyMint() {
139
+ this.logger.info('Applying mint setup');
140
+ const { asset, adminAddress, tokenSim } = this;
141
+ const amount = 10000n;
142
+
143
+ this.logger.verbose(`Minting ${amount} publicly...`);
144
+ await asset.methods.mint_to_public(adminAddress, amount).send({ from: adminAddress });
145
+ tokenSim.mintPublic(adminAddress, amount);
146
+
147
+ const { result: publicBalance } = await asset.methods
148
+ .balance_of_public(adminAddress)
149
+ .simulate({ from: adminAddress });
150
+ this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
151
+ expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(adminAddress));
152
+
153
+ this.logger.verbose(`Minting ${amount} privately...`);
154
+ await mintTokensToPrivate(asset, adminAddress, adminAddress, amount);
155
+ tokenSim.mintPrivate(adminAddress, amount);
156
+
157
+ const { result: privateBalance } = await asset.methods
158
+ .balance_of_private(adminAddress)
159
+ .simulate({ from: adminAddress });
160
+ this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
161
+ expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(adminAddress));
162
+
163
+ const { result: totalSupply } = await asset.methods.total_supply().simulate({ from: adminAddress });
164
+ this.logger.verbose(`Total supply: ${totalSupply}`);
165
+ expect(totalSupply).toEqual(tokenSim.totalSupply);
166
+
167
+ this.logger.verbose(`Minting complete.`);
166
168
  }
167
169
  }