mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-19 19:01:22 +00:00
multiple registered names for single accounts API call now returns ordered by time of registration, earliest to latest
This commit is contained in:
parent
26a345a909
commit
88d009c979
@ -267,7 +267,7 @@ public class HSQLDBNameRepository implements NameRepository {
|
||||
StringBuilder sql = new StringBuilder(512);
|
||||
|
||||
sql.append("SELECT name, reduced_name, data, registered_when, updated_when, "
|
||||
+ "is_for_sale, sale_price, reference, creation_group_id FROM Names WHERE owner = ? ORDER BY name");
|
||||
+ "is_for_sale, sale_price, reference, creation_group_id FROM Names WHERE owner = ? ORDER BY registered_when");
|
||||
|
||||
if (reverse != null && reverse)
|
||||
sql.append(" DESC");
|
||||
|
@ -21,6 +21,7 @@ import org.qortal.transaction.RegisterNameTransaction;
|
||||
import org.qortal.transaction.Transaction;
|
||||
import org.qortal.utils.Amounts;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@ -123,7 +124,13 @@ public class BuySellTests extends Common {
|
||||
assertTrue(repository.getNameRepository().nameExists(name2));
|
||||
|
||||
// check that there are 2 names for one account
|
||||
assertEquals(2, repository.getNameRepository().getNamesByOwner(alice.getAddress(), 0, 0, false).size() );
|
||||
List<NameData> namesByOwner = repository.getNameRepository().getNamesByOwner(alice.getAddress(), 0, 0, false);
|
||||
|
||||
assertEquals(2, namesByOwner.size() );
|
||||
|
||||
// check that the order is correct
|
||||
assertEquals(name1, namesByOwner.get(0).getName());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user