When a user has generated 10 or more addresses, ListKeys returns them in the wrong order. This is because the code sorts the keys as text (like words in a dictionary) rather than as numbers. In text sorting, "10" comes before "2"... the same way "cat" comes before "dog" because it only looks at the first character.
|
sort.SliceStable(keys, func(i, j int) bool { |
|
return keys[i].Id < keys[j].Id |
|
}) |
This doesn't affect users with fewer than 10 addresses because single digit numbers sort the same way whether you treat them as text or numbers.
When a user has generated 10 or more addresses, ListKeys returns them in the wrong order. This is because the code sorts the keys as text (like words in a dictionary) rather than as numbers. In text sorting, "10" comes before "2"... the same way "cat" comes before "dog" because it only looks at the first character.
go-sdk/wallet/hdwallet/wallet.go
Lines 304 to 306 in 6ce96d1
This doesn't affect users with fewer than 10 addresses because single digit numbers sort the same way whether you treat them as text or numbers.