forked from Qortal/qortal
The /arbitrary/search API endpoint now uses a string instead of an int for the "service", and shows a dropdown of possible values in the API documentation page.
This commit is contained in:
parent
528a838643
commit
cbb2dbffb9
@ -89,7 +89,7 @@ public class ArbitraryResource {
|
|||||||
})
|
})
|
||||||
public List<TransactionData> searchTransactions(@QueryParam("startBlock") Integer startBlock, @QueryParam("blockLimit") Integer blockLimit,
|
public List<TransactionData> searchTransactions(@QueryParam("startBlock") Integer startBlock, @QueryParam("blockLimit") Integer blockLimit,
|
||||||
@QueryParam("txGroupId") Integer txGroupId,
|
@QueryParam("txGroupId") Integer txGroupId,
|
||||||
@QueryParam("service") Integer service,
|
@QueryParam("service") Service service,
|
||||||
@QueryParam("name") String name,
|
@QueryParam("name") String name,
|
||||||
@QueryParam("address") String address, @Parameter(
|
@QueryParam("address") String address, @Parameter(
|
||||||
description = "whether to include confirmed, unconfirmed or both",
|
description = "whether to include confirmed, unconfirmed or both",
|
||||||
@ -114,7 +114,7 @@ public class ArbitraryResource {
|
|||||||
|
|
||||||
try (final Repository repository = RepositoryManager.getRepository()) {
|
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||||
List<byte[]> signatures = repository.getTransactionRepository().getSignaturesMatchingCriteria(startBlock, blockLimit, txGroupId, txTypes,
|
List<byte[]> signatures = repository.getTransactionRepository().getSignaturesMatchingCriteria(startBlock, blockLimit, txGroupId, txTypes,
|
||||||
service, name, address, confirmationStatus, limit, offset, reverse);
|
service.value, name, address, confirmationStatus, limit, offset, reverse);
|
||||||
|
|
||||||
// Expand signatures to transactions
|
// Expand signatures to transactions
|
||||||
List<TransactionData> transactions = new ArrayList<TransactionData>(signatures.size());
|
List<TransactionData> transactions = new ArrayList<TransactionData>(signatures.size());
|
||||||
|
@ -6,6 +6,8 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.qortal.api.resource.ArbitraryResource;
|
import org.qortal.api.resource.ArbitraryResource;
|
||||||
import org.qortal.api.resource.TransactionsResource.ConfirmationStatus;
|
import org.qortal.api.resource.TransactionsResource.ConfirmationStatus;
|
||||||
|
import org.qortal.data.transaction.ArbitraryTransactionData;
|
||||||
|
import org.qortal.data.transaction.ArbitraryTransactionData.Service;
|
||||||
import org.qortal.test.common.ApiCommon;
|
import org.qortal.test.common.ApiCommon;
|
||||||
|
|
||||||
public class ArbitraryApiTests extends ApiCommon {
|
public class ArbitraryApiTests extends ApiCommon {
|
||||||
@ -22,7 +24,7 @@ public class ArbitraryApiTests extends ApiCommon {
|
|||||||
Integer[] startingBlocks = new Integer[] { null, 0, 1, 999999999 };
|
Integer[] startingBlocks = new Integer[] { null, 0, 1, 999999999 };
|
||||||
Integer[] blockLimits = new Integer[] { null, 0, 1, 999999999 };
|
Integer[] blockLimits = new Integer[] { null, 0, 1, 999999999 };
|
||||||
Integer[] txGroupIds = new Integer[] { null, 0, 1, 999999999 };
|
Integer[] txGroupIds = new Integer[] { null, 0, 1, 999999999 };
|
||||||
Integer[] services = new Integer[] { null, 0, 1, 999999999 };
|
ArbitraryTransactionData.Service[] services = new Service[] { Service.WEBSITE, Service.GIT_REPOSITORY, Service.BLOG_COMMENT };
|
||||||
String[] names = new String[] { null, "Test" };
|
String[] names = new String[] { null, "Test" };
|
||||||
String[] addresses = new String[] { null, this.aliceAddress };
|
String[] addresses = new String[] { null, this.aliceAddress };
|
||||||
ConfirmationStatus[] confirmationStatuses = new ConfirmationStatus[] { ConfirmationStatus.UNCONFIRMED, ConfirmationStatus.CONFIRMED, ConfirmationStatus.BOTH };
|
ConfirmationStatus[] confirmationStatuses = new ConfirmationStatus[] { ConfirmationStatus.UNCONFIRMED, ConfirmationStatus.CONFIRMED, ConfirmationStatus.BOTH };
|
||||||
@ -30,7 +32,7 @@ public class ArbitraryApiTests extends ApiCommon {
|
|||||||
for (Integer startBlock : startingBlocks)
|
for (Integer startBlock : startingBlocks)
|
||||||
for (Integer blockLimit : blockLimits)
|
for (Integer blockLimit : blockLimits)
|
||||||
for (Integer txGroupId : txGroupIds)
|
for (Integer txGroupId : txGroupIds)
|
||||||
for (Integer service : services)
|
for (Service service : services)
|
||||||
for (String name : names)
|
for (String name : names)
|
||||||
for (String address : addresses)
|
for (String address : addresses)
|
||||||
for (ConfirmationStatus confirmationStatus : confirmationStatuses) {
|
for (ConfirmationStatus confirmationStatus : confirmationStatuses) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user