Commit 7bd1f8c
authored
feat: update current account proto for asset-agnostic fields (#1205)
* feat: update current account proto for asset-agnostic fields
Replace currency-specific fields with instrument-agnostic equivalents:
- Replace base_currency (Currency enum) with instrument_code (string) in
CurrentAccountFacility and InitiateCurrentAccountRequest; supports any
instrument code (GBP, kWh, GPU_HOUR, etc.)
- Rename account_identification to external_identifier in both messages;
remove IBAN-only pattern validation and widen max_len from 34 to 255 to
support product-type-specific identifier formats
- Remove overdraft_limit field (field 9) from CurrentAccountFacility and
mark OverdraftConfiguration message as deprecated; overdraft configuration
moves to product type definitions
- Add dimension field (field 14) to CurrentAccountFacility for instrument
classification (CURRENCY, ENERGY, COMPUTE, CARBON, etc.)
- Fix all compile errors in gRPC service layer, test files, and
utilities caused by removed and renamed proto fields
* fix: update proto test file for renamed and removed fields
Update current_account_test.go to use the new asset-agnostic field names:
- Replace AccountIdentification with ExternalIdentifier
- Replace BaseCurrency with InstrumentCode
- Remove OverdraftLimit test (field removed from CurrentAccountFacility)
- Replace IBAN format validation test with ExternalIdentifier format test
reflecting the widened validation (format now validated by CEL rules)
- Add InstrumentCode test covering multi-asset instrument types
* fix: update stale base_currency reference in proto comment
Replace the comment referencing 'base_currency-derived defaults' in
InitiateCurrentAccountRequest.product_type_code with the current approach:
when product_type_code is empty, the service uses instrument_code and
dimension from the request directly.
* test: add ExternalIdentifier max-length boundary tests
Add boundary cases for exactly 255 (valid) and 256 (invalid) characters
to cover the widened max_len validation on external_identifier field.
* fix: update instrument_code comment example to use KWH (uppercase, matching pattern)
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 5220e71 commit 7bd1f8c
9 files changed
Lines changed: 228 additions & 417 deletions
File tree
- api/proto/meridian/current_account/v1
- services/current-account/service
- utilities/horizon-demo
Lines changed: 29 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | | - | |
123 | | - | |
| 122 | + | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
| |||
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
| |||
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
186 | | - | |
| 191 | + | |
| 192 | + | |
187 | 193 | | |
| 194 | + | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
| |||
333 | 340 | | |
334 | 341 | | |
335 | 342 | | |
336 | | - | |
337 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
338 | 346 | | |
339 | | - | |
340 | | - | |
| 347 | + | |
341 | 348 | | |
342 | 349 | | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
| |||
357 | 365 | | |
358 | 366 | | |
359 | 367 | | |
360 | | - | |
| 368 | + | |
361 | 369 | | |
362 | 370 | | |
363 | 371 | | |
| |||
0 commit comments