Commit 172586c
committed
refactor(wallets): narrow stub-class cache to just the class id
Callers only ever consume the `id` field from `getContractClassFromArtifact`,
so cache `Map<AccountType, Promise<Fr>>` instead of the full
`ContractClassWithId & ContractClassIdPreimage`. Method renamed
`#getStubClass` → `#getStubClassId`, map renamed `#stubClasses` →
`#stubClassIds`, callers drop the destructure.
Drop the verbose Promise-as-value rationale comment — the idiom is
established in this codebase (see ContractSyncService) and the PXE
precedents document the cache contract briefly without explaining
the dedupe pattern.1 parent a498f65 commit 172586c
3 files changed
Lines changed: 32 additions & 52 deletions
File tree
- yarn-project
- cli-wallet/src/utils
- end-to-end/src/test-wallet
- wallets/src/embedded
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 33 | + | |
| 34 | + | |
41 | 35 | | |
42 | 36 | | |
43 | 37 | | |
| |||
208 | 202 | | |
209 | 203 | | |
210 | 204 | | |
211 | | - | |
| 205 | + | |
212 | 206 | | |
213 | 207 | | |
214 | 208 | | |
215 | 209 | | |
216 | 210 | | |
217 | | - | |
218 | | - | |
| 211 | + | |
| 212 | + | |
219 | 213 | | |
220 | | - | |
221 | | - | |
| 214 | + | |
| 215 | + | |
222 | 216 | | |
223 | 217 | | |
224 | 218 | | |
225 | | - | |
| 219 | + | |
226 | 220 | | |
227 | | - | |
| 221 | + | |
228 | 222 | | |
229 | | - | |
| 223 | + | |
230 | 224 | | |
231 | 225 | | |
232 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
33 | 29 | | |
34 | 30 | | |
35 | 31 | | |
| |||
116 | 112 | | |
117 | 113 | | |
118 | 114 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 115 | + | |
| 116 | + | |
124 | 117 | | |
125 | 118 | | |
126 | | - | |
127 | | - | |
| 119 | + | |
| 120 | + | |
128 | 121 | | |
129 | | - | |
130 | | - | |
| 122 | + | |
| 123 | + | |
131 | 124 | | |
132 | 125 | | |
133 | 126 | | |
134 | | - | |
| 127 | + | |
135 | 128 | | |
136 | | - | |
| 129 | + | |
137 | 130 | | |
138 | | - | |
| 131 | + | |
139 | 132 | | |
140 | 133 | | |
141 | 134 | | |
| |||
160 | 153 | | |
161 | 154 | | |
162 | 155 | | |
163 | | - | |
| 156 | + | |
164 | 157 | | |
165 | 158 | | |
166 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 14 | + | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
80 | 76 | | |
81 | 77 | | |
82 | 78 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 79 | + | |
| 80 | + | |
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
| |||
203 | 196 | | |
204 | 197 | | |
205 | 198 | | |
206 | | - | |
207 | | - | |
| 199 | + | |
| 200 | + | |
208 | 201 | | |
209 | | - | |
210 | | - | |
| 202 | + | |
| 203 | + | |
211 | 204 | | |
212 | 205 | | |
213 | 206 | | |
214 | | - | |
| 207 | + | |
215 | 208 | | |
216 | | - | |
| 209 | + | |
217 | 210 | | |
218 | | - | |
| 211 | + | |
219 | 212 | | |
220 | 213 | | |
221 | 214 | | |
| |||
233 | 226 | | |
234 | 227 | | |
235 | 228 | | |
236 | | - | |
| 229 | + | |
237 | 230 | | |
238 | 231 | | |
239 | 232 | | |
| |||
0 commit comments