Skip to content

Commit

Permalink
api: Sync client object. (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
winder authored Sep 20, 2023
1 parent 99129d1 commit 229a8d5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions algosdk/v2client/algod.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,22 @@ def get_ledger_state_delta_for_transaction_group(
"GET", req, params=query, response_format=response_format, **kwargs
)

def get_block_txids(
self, round_num: int, **kwargs: Any
) -> AlgodResponseType:
"""
Get the top level transaction IDs for the block
on the given round.
Args:
round_num (int): The round in which the transaction appears.
Returns:
Dict[str, Any]: Response from algod
"""
req = "/blocks/{}/txids".format(round_num)
return self.algod_request("GET", req, **kwargs)


def _specify_round_string(
block: Union[int, None], round_num: Union[int, None]
Expand Down
5 changes: 5 additions & 0 deletions tests/steps/other_v2_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1693,3 +1693,8 @@ def get_ledger_state_delta_for_transaction_group(context, id):
id, response_format="msgpack"
)
)


@when("we make a GetBlockTxids call against block number {round}")
def get_block_txids_call(context, round):
context.response = context.acl.get_block_txids(round)
2 changes: 2 additions & 0 deletions tests/unit.tags
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@unit.atc_method_args
@unit.atomic_transaction_composer
@unit.blocksummary
@unit.blocktxids
@unit.dryrun
@unit.dryrun.trace.application
@unit.feetest
Expand All @@ -23,6 +24,7 @@
@unit.responses.participationupdates
@unit.responses.sync
@unit.responses.timestamp
@unit.responses.txid.json
@unit.responses.unlimited_assets
@unit.sourcemap
@unit.statedelta
Expand Down

0 comments on commit 229a8d5

Please sign in to comment.