Prevent hardware wallets from being attached to accounts multiple times #678
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR fixes a bug where a hardware wallet could be attached to a single account multiple times. This would result in the user who own's the account seeing duplicate transactions for the hardware wallet.
Changes
Tests
I attached my hardware wallet twice on 2 test versions of the NNS Dapp, one with the fix, and one without.
On the one without the fix my transactions were duplicated, on the one with the fix they were not.
Use II anchor 27 to view the test account.
No fix - https://s24we-diaaa-aaaaa-aaaka-cai.nnsdapp.dfinity.network/#/wallet/bf7999cc05364166ec0bab77c69fa6842ec03160095ef404db71adfdd986f099
Fix - https://su63m-yyaaa-aaaaa-aaala-cai.nnsdapp.dfinity.network/#/wallet/bf7999cc05364166ec0bab77c69fa6842ec03160095ef404db71adfdd986f099