Skip to content

Commit

Permalink
refactor(core-api): remove the legacy API and support asset search (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian authored Jun 13, 2019
1 parent 5aad7f9 commit 0ff5241
Show file tree
Hide file tree
Showing 181 changed files with 3,208 additions and 7,682 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.5.0] - 2019-07-DD

### Added

- Allow retrieval of raw blocks and transactions via API ([#2616])
- Search transactions by asset via API ([#2618])
- Allow easy retrieval of first and last block ([#2641])

### Removed

- Removed the `ark-node` legacy API known as `v1` ([#2577])

## [2.4.1] - 2019-06-13

### Fixed
Expand Down Expand Up @@ -487,6 +499,7 @@ Closed security vulnerabilities:
- Initial Release

[unreleased]: https://github.com/ARKEcosystem/core/compare/master...develop
[2.5.0]: https://github.com/ARKEcosystem/core/compare/2.4.0...2.5.0
[2.4.0]: https://github.com/ARKEcosystem/core/compare/2.3.23...2.4.0
[2.3.23]: https://github.com/ARKEcosystem/core/compare/2.3.22...2.3.23
[2.3.22]: https://github.com/ARKEcosystem/core/compare/2.3.21...2.3.22
Expand Down Expand Up @@ -716,6 +729,7 @@ Closed security vulnerabilities:
[#2567]: https://github.com/ARKEcosystem/core/pull/2567
[#2571]: https://github.com/ARKEcosystem/core/pull/2571
[#2574]: https://github.com/ARKEcosystem/core/pull/2574
[#2577]: https://github.com/ARKEcosystem/core/pull/2577
[#2581]: https://github.com/ARKEcosystem/core/pull/2581
[#2582]: https://github.com/ARKEcosystem/core/pull/2582
[#2586]: https://github.com/ARKEcosystem/core/pull/2586
Expand All @@ -725,16 +739,18 @@ Closed security vulnerabilities:
[#2593]: https://github.com/ARKEcosystem/core/pull/2593
[#2597]: https://github.com/ARKEcosystem/core/pull/2597
[#2604]: https://github.com/ARKEcosystem/core/pull/2604
[#2604]: https://github.com/ARKEcosystem/core/pull/2604
[#2606]: https://github.com/ARKEcosystem/core/pull/2606
[#2611]: https://github.com/ARKEcosystem/core/pull/2611
[#2612]: https://github.com/ARKEcosystem/core/pull/2612
[#2615]: https://github.com/ARKEcosystem/core/pull/2615
[#2616]: https://github.com/ARKEcosystem/core/pull/2616
[#2618]: https://github.com/ARKEcosystem/core/pull/2618
[#2619]: https://github.com/ARKEcosystem/core/pull/2619
[#2622]: https://github.com/ARKEcosystem/core/pull/2622
[#2628]: https://github.com/ARKEcosystem/core/pull/2628
[#2634]: https://github.com/ARKEcosystem/core/pull/2634
[#2635]: https://github.com/ARKEcosystem/core/pull/2635
[#2641]: https://github.com/ARKEcosystem/core/pull/2641
[#2643]: https://github.com/ARKEcosystem/core/pull/2643
[#2645]: https://github.com/ARKEcosystem/core/pull/2645
[#2646]: https://github.com/ARKEcosystem/core/pull/2646
Expand Down
17 changes: 8 additions & 9 deletions __tests__/e2e/lib/utils/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ class Helpers {

let response;
try {
response = ["GET", "DELETE"].includes(method)
? await request(url, { params, headers })
: await request(url, params, { headers });
response = ["GET", "DELETE"].includes(method) ?
await request(url, {
params,
headers
}) :
await request(url, params, {
headers
});
} catch (e) {
console.log("[api] request failed");
if (method === "POST") {
Expand Down Expand Up @@ -60,11 +65,6 @@ class Helpers {
expect(response.status).toBe(code);
}

assertVersion(response, version) {
expect(response.headers).toBeObject();
expect(response.headers).toHaveProperty("api-version", version);
}

expectResource(response) {
expect(response.data.data).toBeObject();
}
Expand All @@ -88,7 +88,6 @@ class Helpers {
expectSuccessful(response, statusCode = 200) {
this.expectStatus(response, statusCode);
this.expectJson(response);
this.assertVersion(response, "2");
}

expectError(response, statusCode = 404) {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/helpers/rest-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { httpie, IHttpieResponse } from "@arkecosystem/core-utils";

export class RestClient {
public static async get<T = any>(path: string, opts?): Promise<IHttpieResponse<T>> {
return httpie.get(`http://localhost:4003/api/v2/${path}`, opts);
return httpie.get(`http://localhost:4003/api/${path}`, opts);
}

public static async post<T = any>(path: string, body): Promise<IHttpieResponse<T>> {
return httpie.post(`http://localhost:4003/api/v2/${path}`, { body });
return httpie.post(`http://localhost:4003/api/${path}`, { body });
}

public static async broadcast<T = any>(transactions): Promise<IHttpieResponse<T>> {
Expand Down
Loading

0 comments on commit 0ff5241

Please sign in to comment.