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

HTLC API Additions #1742

Merged
merged 5 commits into from
Apr 30, 2019
Merged

HTLC API Additions #1742

merged 5 commits into from
Apr 30, 2019

Conversation

jmjatlanta
Copy link
Contributor

@jmjatlanta jmjatlanta commented Apr 29, 2019

This includes the changes of PR #1729, along with fixes requested in that PR.

In short, this PR fixes #1713

  • get_htlc(id)
  • get_htlc_by_from(account, start, limit)
  • get_htlc_by_to(account, start, limit)
  • get_full_accounts includes htlc

@jmjatlanta jmjatlanta marked this pull request as ready for review April 29, 2019 18:37
@@ -340,6 +340,9 @@ void application_impl::set_api_limit() {
if(_options->count("api-limit-get-key-references")){
_app_options.api_limit_get_key_references = _options->at("api-limit-get-key-references").as<uint64_t>();
}
if(_options->count("api-limit-get-htlc-by")) {
_app_options.api_limit_get_htlc_by = _options->at("api-limit-get-htlc-by").as<uint64_t>();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have liked a more descriptive name for this, and have it cover both "to" and "from", but I could not think of one.

@jmjatlanta jmjatlanta added this to the 3.1.0 - Feature Release milestone Apr 29, 2019
@pmconrad pmconrad mentioned this pull request Apr 30, 2019
BOOST_CHECK_EQUAL( full[alice.name].htlcs.size(), 3 );

full = db_api.get_full_accounts({bob.name}, false);
BOOST_CHECK_EQUAL( full[alice.name].htlcs.size(), 0 );
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be bob.name, and the count shouldn't be 0.

// alice puts a htlc contract to bob
{
graphene::chain::htlc_create_operation create_operation;
BOOST_TEST_MESSAGE("Alice (who has 100 coins, is transferring 2 coins to Bob");
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually she's transferring 3 not 2 (same in the other cases)

@jmjatlanta jmjatlanta merged commit c737ea5 into develop Apr 30, 2019
@jmjatlanta jmjatlanta deleted the jmj_1713 branch April 30, 2019 13:15
@jmjatlanta jmjatlanta mentioned this pull request Apr 30, 2019
23 tasks
@oxarbitrage
Copy link
Member

nice work @jmjatlanta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants