Skip to content

Commit

Permalink
feat: add stellar_sdk.call_builder.PaymentsCallBuilder.join (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat authored May 27, 2020
1 parent d900a31 commit cca5e48
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions stellar_sdk/call_builder/payments_call_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@ def include_failed(self, include_failed: bool) -> "PaymentsCallBuilder":
"""
self._add_query_param("include_failed", include_failed)
return self

def join(self, join: str) -> "PaymentsCallBuilder":
"""join represents `join` param in queries, currently only supports `transactions`
:param join: join represents `join` param in queries, currently only supports `transactions`
:return: current OperationsCallBuilder instance
"""
self._add_query_param("join", join)
return self
13 changes: 13 additions & 0 deletions tests/call_builder/test_payments_call_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,16 @@ def test_not_include_failed(self):
account_id=account_id
)
assert builder.params == {"include_failed": "false"}

def test_join(self):
account_id = "GATEMHCCKCY67ZUCKTROYN24ZYT5GK4EQZ65JJLDHKHRUZI3EUEKMTCH"
builder = (
PaymentsCallBuilder(horizon_url, client)
.for_account(account_id)
.include_failed(False)
.join("transactions")
)
assert builder.endpoint == "accounts/{account_id}/payments".format(
account_id=account_id
)
assert builder.params == {"include_failed": "false", "join": "transactions"}

0 comments on commit cca5e48

Please sign in to comment.