Commit 9a29706
committed
fix(statics): skip ams tokens that duplicate an existing contract address
createTokenMapUsingConfigDetails merges dynamic AMS token configs into the statics
coin map. The presence guard (isCoinPresentInCoinMap) dedupes only by name, id, and
alias, but CoinMap.fromCoins also dedupes by contract address
(family:networkType:contractAddress) and throws DuplicateContractAddressDefinitionError
on a collision.
A dynamic AMS token that shares a contract address with a statics token under a
different name -- e.g. drift between the generated botTokens snapshot and live AMS
data (eth:at on hoodi testnet) -- slipped past the name guard and threw in
fromCoins, aborting the entire token-map build for every consumer
(bitgo-retail hydration, bitgo-admin, bitgo-microservices, etc.).
Track contract-address keys while merging and skip a duplicate with a warning,
mirroring the existing malformed-token handling, so one bad token can no longer
take down the whole map.1 parent edc3d2e commit 9a29706
2 files changed
Lines changed: 51 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
466 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
467 | 470 | | |
468 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
469 | 475 | | |
470 | 476 | | |
471 | 477 | | |
| |||
477 | 483 | | |
478 | 484 | | |
479 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
480 | 502 | | |
481 | 503 | | |
482 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1320 | 1320 | | |
1321 | 1321 | | |
1322 | 1322 | | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1323 | 1351 | | |
1324 | 1352 | | |
1325 | 1353 | | |
| |||
0 commit comments