SolanaBlockChainImpl.getSPLTokenHoldings(...) returns a map keyed by mint address.
If multiple token accounts exist for the same mint, the current implementation silently overwrites the previous value. This may return an incorrect and unpredictable balance.
Implementation
Detect duplicate mint addresses while building the result map.
If more than one token account is found for the same owner and mint, throw an exception containing the owner and mint addresses instead of returning an ambiguous balance.
Support for combining or selecting between multiple token accounts is out of scope.
Acceptance criteria
A single token account per mint preserves the existing behavior.
Multiple token accounts for the same mint cause a clear exception.
No token balance is silently overwritten.
The project compiles successfully.
## Background
`SolanaBlockChainImpl.getSPLTokenHoldings(...)` returns a map keyed by mint address.
If multiple token accounts exist for the same mint, the current implementation silently overwrites the previous value. This may return an incorrect and unpredictable balance.
## Implementation
Detect duplicate mint addresses while building the result map.
If more than one token account is found for the same owner and mint, throw an exception containing the owner and mint addresses instead of returning an ambiguous balance.
Support for combining or selecting between multiple token accounts is out of scope.
## Acceptance criteria
* A single token account per mint preserves the existing behavior.
* Multiple token accounts for the same mint cause a clear exception.
* No token balance is silently overwritten.
* The project compiles successfully.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Background
SolanaBlockChainImpl.getSPLTokenHoldings(...)returns a map keyed by mint address.If multiple token accounts exist for the same mint, the current implementation silently overwrites the previous value. This may return an incorrect and unpredictable balance.
Implementation
Detect duplicate mint addresses while building the result map.
If more than one token account is found for the same owner and mint, throw an exception containing the owner and mint addresses instead of returning an ambiguous balance.
Support for combining or selecting between multiple token accounts is out of scope.
Acceptance criteria