Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
edridudi committed Jan 22, 2023
2 parents a9466bb + a4976e3 commit aed55ce
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ ScriptService scriptService = backendService.getScriptService();
```

### Advanced Query Example (Preview)
#### Querying a Descending Order of All Address Transactions since Block No. #3168087 to Block No. #3168097 (inclusive), Limited to Maximum of 10 Results.
#### Querying a Descending Order of All Address Transactions since Block No. #42248 to Block No. #69447 (inclusive), Limited to Maximum of 10 Results.
```java
String address = "addr_test1qrvaadv0h7atv366u6966u4rft2svjlf5uajy8lkpsgdrc24rnskuetxz2u3m5ac22s3njvftxcl2fc8k8kjr088ge0qz98xmv";

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<slf4j-api.version>2.0.6</slf4j-api.version>
<slf4j-reload4j.version>2.0.6</slf4j-reload4j.version>
<commons-collections4.version>4.4</commons-collections4.version>
<swagger-annotations.version>2.2.7</swagger-annotations.version>
<swagger-annotations.version>2.2.8</swagger-annotations.version>
<lombok.version>1.18.24</lombok.version>
<bcprov-jdk15to18.version>1.72</bcprov-jdk15to18.version>
<bucket4j-core.version>7.6.0</bucket4j-core.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<junit-jupiter.version>5.9.2</junit-jupiter.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ public interface AssetService {
* <p><b>404</b> - The server does not recognise the combination of endpoint and parameters provided
*
* @param assetPolicy Asset Policy ID in hexadecimal format (hex) (required)
* @param options Filtering and Pagination options (optional)
* @return Result of Type List of {@link PolicyAsset}
* @throws ApiException if an error occurs while attempting to invoke the API
*/
Result<List<PolicyAsset>> getAssetPolicyInformation(String assetPolicy) throws ApiException;
Result<List<PolicyAsset>> getAssetPolicyInformation(String assetPolicy, Options options) throws ApiException;

/**
* Asset Information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface AssetApi {
Call<List<AssetHistory>> getAssetHistory(@Query("_asset_policy") String assetPolicy, @Query("_asset_name") String assetName, @QueryMap Map<String, String> paramsMap);

@GET("asset_policy_info")
Call<List<PolicyAsset>> getAssetPolicyInformation(@Query("_asset_policy") String assetPolicy);
Call<List<PolicyAsset>> getAssetPolicyInformation(@Query("_asset_policy") String assetPolicy, @QueryMap Map<String, String> paramsMap);

@GET("asset_summary")
Call<List<AssetSummary>> getAssetSummary(@Query("_asset_policy") String assetPolicy, @Query("_asset_name") String assetName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ public Result<List<AssetHistory>> getAssetHistory(String assetPolicy, String ass
}

@Override
public Result<List<PolicyAsset>> getAssetPolicyInformation(String assetPolicy) throws ApiException {
public Result<List<PolicyAsset>> getAssetPolicyInformation(String assetPolicy, Options options) throws ApiException {
validateHexFormat(assetPolicy);
Call<List<PolicyAsset>> call = assetApi.getAssetPolicyInformation(assetPolicy);
Call<List<PolicyAsset>> call = assetApi.getAssetPolicyInformation(assetPolicy, optionsToParamMap(options));
try {
Response<List<PolicyAsset>> response = (Response) execute(call);
return processResponse(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void getAssetHistoryBadRequestTest() {
@Test
void getAssetPolicyInformationTest() throws ApiException {
String assetPolicy = "14696a4676909f4e3cb1f2e60e2e08e5abed70caf5c02699be971139";
Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy);
Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy, Options.EMPTY);
Assertions.assertTrue(assetPolicyInfoResult.isSuccessful());
Assertions.assertNotNull(assetPolicyInfoResult.getValue());
log.info(assetPolicyInfoResult.getValue().toString());
Expand All @@ -116,7 +116,7 @@ void getAssetPolicyInformationTest() throws ApiException {
@Test
void getAssetPolicyInformationBadRequestTest() {
String assetPolicy = "test";
ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy));
ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy, Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void getAssetHistoryBadRequestTest() {
@Test
void getAssetPolicyInformationTest() throws ApiException {
String assetPolicy = "80de4ee0ffde8ba05726707f2adba0e65963eff5aaba164af358e71b";
Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy);
Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy, Options.EMPTY);
Assertions.assertTrue(assetPolicyInfoResult.isSuccessful());
Assertions.assertNotNull(assetPolicyInfoResult.getValue());
log.info(assetPolicyInfoResult.getValue().toString());
Expand All @@ -120,7 +120,7 @@ void getAssetPolicyInformationTest() throws ApiException {
@Test
void getAssetPolicyInformationBadRequestTest() {
String assetPolicy = "test";
ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy));
ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy, Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void getAssetHistoryBadRequestTest() {
@Test
void getAssetPolicyInformationTest() throws ApiException {
String assetPolicy = "9a50f458ebffb4c3f9d6f9f3d45426b2de6cf2512254f4bfa3d8f410";
Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy);
Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy, Options.EMPTY);
Assertions.assertTrue(assetPolicyInfoResult.isSuccessful());
Assertions.assertNotNull(assetPolicyInfoResult.getValue());
log.info(assetPolicyInfoResult.getValue().toString());
Expand All @@ -120,7 +120,7 @@ void getAssetPolicyInformationTest() throws ApiException {
@Test
void getAssetPolicyInformationBadRequestTest() {
String assetPolicy = "test";
ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy));
ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy, Options.EMPTY));
assertInstanceOf(ApiException.class, exception);
}

Expand Down

0 comments on commit aed55ce

Please sign in to comment.