Commit 4f88680
committed
fix(token): deduplicate composite-owner inputs whose token IDs are filtered out
UniquePerInput deduplicates by (token ID, enrollment ID) and keeps every
input with a nil token ID. Metadata.filterTransfer strips TokenID from the
input metadata it clones, so consumers of eID-filtered metadata get nil
token IDs and composite-owner member rows are summed once per member again.
Give Input an Index, its position within the action, and fall back to
(action index, input index, enrollment ID) as the deduplication key when
the token ID is absent. Positions survive filtering because filterTransfer
emits one entry per input. Inputs carrying a token ID keep the previous
key, so existing callers are unaffected.
Index defaults to 0, so two literal-built inputs with no token ID would
silently collapse on a position nobody set. NewInput becomes the
canonical way to build an input and stamps an unexported position-known
marker; UniquePerInput collapses on position only for marked inputs,
while literal-built inputs keep the previous keep-all behavior, locked
by a regression test.
Signed-off-by: Evan <evanyan@sign.global>1 parent 5c8aafc commit 4f88680
4 files changed
Lines changed: 114 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
| 910 | + | |
| 911 | + | |
915 | 912 | | |
916 | 913 | | |
917 | 914 | | |
| |||
938 | 935 | | |
939 | 936 | | |
940 | 937 | | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
949 | 944 | | |
950 | 945 | | |
951 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
243 | 259 | | |
244 | 260 | | |
245 | 261 | | |
| |||
391 | 407 | | |
392 | 408 | | |
393 | 409 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
398 | 419 | | |
399 | | - | |
| 420 | + | |
400 | 421 | | |
401 | 422 | | |
402 | 423 | | |
403 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
404 | 431 | | |
405 | 432 | | |
406 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
407 | 440 | | |
408 | 441 | | |
409 | | - | |
410 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
411 | 447 | | |
412 | 448 | | |
413 | | - | |
| 449 | + | |
414 | 450 | | |
415 | 451 | | |
416 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
288 | 298 | | |
289 | | - | |
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
| |||
312 | 321 | | |
313 | 322 | | |
314 | 323 | | |
315 | | - | |
| 324 | + | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| |||
323 | 332 | | |
324 | 333 | | |
325 | 334 | | |
326 | | - | |
327 | | - | |
328 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
329 | 378 | | |
330 | 379 | | |
331 | 380 | | |
| |||
0 commit comments