Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add 2.6 endpoints #159

Merged
merged 16 commits into from
Oct 29, 2019
Merged

feat: add 2.6 endpoints #159

merged 16 commits into from
Oct 29, 2019

Conversation

dated
Copy link
Contributor

@dated dated commented Oct 28, 2019

Summary

Adds the following API endpoints

GET

  • bridgechains
  • bridgechains/{id}
  • businesses
  • businesses/{id}
  • businesses/{id}/bridgechains
  • wallets/{id}/locks
  • locks
  • locks/{id}

POST

  • businesses/search
  • bridgechains/search
  • locks/search
  • locks/unlocked

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@ghost ghost added Complexity: High More than 256 lines changed. Type: Feature The issue is a request for new functionality. Status: In Progress The issue or pull request is being worked on. labels Oct 28, 2019
@dated dated marked this pull request as ready for review October 28, 2019 20:29
@ghost ghost added Status: Needs Review The issue or pull request needs a review by a developer of the team. and removed Status: In Progress The issue or pull request is being worked on. labels Oct 28, 2019
dated and others added 4 commits October 28, 2019 21:32
* test: Fix EPS32 test builds

ESP32 test builds were not passing and the tests themselves were not
being compiled into the firmware binary.  Added missing ignore filters
to ignore desktop libraries for building PIO and desktop targets in the
same source tree.

* test: Fix ESP8266 tests

Split up and re-enabled ESP8266 tests.  API tests required further
splitting due to large amounts of strings.
Copy link
Contributor

@sleepdefic1t sleepdefic1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing declaration.

api/wallets/wallets.h ln#50

  std::string top(const char* const query) override;
  std::string locks(const char *const identifier, const char* const query) override; // <--
  std::string transactions(const char *const identifier, const char* const query) override;

Typo

test/api/paths.cpp ln# 301

  const auto locks = paths::Wallets::locks(
      testHost, "DNv1iScT2DJBWzpJd1AFYkTx1xkAZ9XVJk", "?limit=1&page=5");
  ASSERT_STREQ(
      "0.0.0.0:4003/api/wallets/DNv1iScT2DJBWzpJd1AFYkTx1xkAZ9XVJk/locks?limit=1&page=5",
      locks.c_str());  // <-- (transactions.c_str() →  locks.c_str())

There's more, but these ones popped up in the mean time.

@sleepdefic1t
Copy link
Contributor

@dated Looks like Paths::locks in paths.cpp is also missing its definitions.

@dated
Copy link
Contributor Author

dated commented Oct 28, 2019

Thanks! I'll have a proper look asap

@sleepdefic1t
Copy link
Contributor

@dated

Are those API POST bodys correct?

I was only able to use these with Postman.

search:
{"lockId":"1916b6da532193a1703e53783b146835a98127445941efadb2d973932e2b8d33"}

unlocked:
{ "ids":["1916b6da532193a1703e53783b146835a98127445941efadb2d973932e2b8d33"]}

@dated
Copy link
Contributor Author

dated commented Oct 28, 2019

I'll see what I can find in the core repository, there are docs available yet for the new endpoints 😕

@dated
Copy link
Contributor Author

dated commented Oct 28, 2019

@sleepdefic1t
Copy link
Contributor

sleepdefic1t commented Oct 29, 2019

@dated

nice! 😎

Just to do a sanity check on the businesses endpoints,
Is businessId also the correct syntax? My TS isn't the strongest.

The https://dexplorer.ark.io/api/v2/businesses endpoints only seems to load for me every few refreshes, and I'm not able to post anything at all to test against a live node.

@dated
Copy link
Contributor Author

dated commented Oct 29, 2019

I'll do some tests and get back to you!

@dated
Copy link
Contributor Author

dated commented Oct 29, 2019

> curl 'https://dexplorer.ark.io/api/v2/businesses/search' -H "Content-Type: application/json" -d '{ "businessId": "1" }'
{"meta":{"count":1,"pageCount":1,"totalCount":1,"next":null,"previous":null,"self":"/api/businesses/search?page=1&limit=100","first":"/api/businesses/search?page=1&limit=100","last":"/api/businesses/search?page=1&limit=100"},"data":[{"businessId":1,"name":"Devnet 0.42578625115310653","website":"dexplorer.ark.io"}]}

The schema validation will cast the given parameters to the types defined in the schema.

@ghost
Copy link

ghost commented Oct 29, 2019

A member has approved this PR. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait.

Thank you for your contribution!

@ghost ghost added the Status: Member Approved The pull request has been approved by a member. label Oct 29, 2019
@sleepdefic1t sleepdefic1t merged commit 6f7fd45 into ArkEcosystemArchive:develop Oct 29, 2019
@ghost
Copy link

ghost commented Oct 29, 2019

Your pull request has been merged but was not assigned a bounty tier. A maintainer will assign a bounty tier to this pull request in the next few days.

@ghost ghost removed the Status: Needs Review The issue or pull request needs a review by a developer of the team. label Oct 29, 2019
@dated dated deleted the feat/2.6-endpoints branch October 29, 2019 13:53
@faustbrian faustbrian added the Bounty: Tier 4 Awarded for small features, refactorings, improvements. This is valued at 20 USD. label Oct 31, 2019
@ghost
Copy link

ghost commented Oct 31, 2019

Your pull request has been merged and marked as tier 4. It will earn you $20 USD.

This was referenced Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bounty: Tier 4 Awarded for small features, refactorings, improvements. This is valued at 20 USD. Complexity: High More than 256 lines changed. Status: Member Approved The pull request has been approved by a member. Type: Feature The issue is a request for new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants