Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • abw_rc_scale
  • abw_reuse_undo
  • bw_faketime_playground
  • km_REBASED_mt-wallet-api-some-fixes_ON_pbatko/snapshot-improvements
  • km_add_request_logging_policy
  • kmochocki/add-alternate-chain-specs
  • kmochocki/add_more_settings_to_interface
  • kmochocki/beekeepy-revert-config-changes
  • kmochocki/beekeepy-wip
  • kmochocki/custom_events
  • kmochocki/filter_ci_from_environ
  • kmochocki/fix-haf-tests
  • kmochocki/fix-hive-error-response
  • kmochocki/fix-plugin-not-loaded
  • kmochocki/fix-transaction-expiration
  • kmochocki/helpy-mr-27
  • kmochocki/logger
  • kmochocki/mt-remove-notifications
  • kmochocki/notifications
  • kmochocki/notifications_with_custom_events
  • kmochocki/rm-beekeepy
  • kmochocki/test-tools-update-key-pair
  • kmochocki/try-update-schemas
  • kmochocki/wip
  • kmp
  • kudmich/add-get-block-ids-method-to-block-log-class
  • kudmich/beekeeper_fix
  • kudmich/full_block_generator
  • kudmich/helpy-update
  • kudmich/helpy_update
  • kudmich/logger_fork_tests
  • kudmich/pass_offset_to_network_object
  • kudmich/repair_block_log_many_opens
  • kudmich/schemas-update
  • kudmich/support-multiple-serialization-standards-for-create-accounts-function
  • kudmich/tmp
  • kudmich/tmp_helpy_update
  • lswiszcz/dump-node-options
  • master
  • master-clive
  • mi_faketime_and_monotonic_clocks
  • mkrzeminski/keyauth_fix_5m_MR_add_key_in_config
  • mkudela/bump_helpy_40
  • mkudela/improve_wallet_create_account
  • mkudela/test_of_bumping_schemas
  • mkudela/update_wax
  • mkudela/witness_guard
  • ms_add_blocklog_for_faketime
  • ms_add_faketime
  • ms_add_logs_when_making_fork
  • ms_add_new_config_options
  • ms_add_sql_serializer_plugin
  • ms_add_truncate_block_log
  • ms_allow_fork_also_for_one_node_network
  • ms_commit_pregenerated_block_log
  • ms_config_options_for_sql_serializer
  • ms_debug_set_witness_schedule
  • ms_faketime_update_timestamp_file
  • ms_fix_error_message_in_WORLD
  • ms_fix_urllib_newer_version
  • ms_get_number_of_forks
  • ms_http_request_on_error
  • ms_move_pregenerated_block_log
  • ms_new_config_options
  • ms_notification_system_log_level
  • ms_printing_available_networks
  • ms_replay_from_block_log
  • ms_speedup
  • ms_stale_production_with_faketime
  • ms_start_node_with_faketime
  • ms_starting_with_notification_system
  • ms_switch_fork_notification
  • ms_temporary_branch
  • ms_temporary_branch2
  • ms_urllib3_new_version_parsing
  • ms_wait_for_fork
  • msobczyk/add_witness_api_to_witness_node
  • msobczyk/add_witness_api_to_witness_node_and_wait_for_fork_event
  • msobczyk/check_ci_on_master
  • msobczyk/dont_always_use_default_python_int_handler_on_keyboard_interrupt
  • msobczyk/update-wax
  • msobczyk/use_block_lgo_in_read_only_mode
  • msobczyk/wait_for_next_fork
  • mt-07-feb-more-logs
  • mt-17-mar-test-changes
  • mt-26-feb-longer-timeout
  • mt-dump-params
  • mt-issue-303
  • mt-issue-345
  • mt-keosd
  • mt-node-fix
  • mt-secure-wallet
  • mt-support-dump-option-flag
  • mt-update-config
  • mt-wallet-api-some-fixes
  • mzebrak/asset-handle
  • mzebrak/block-log-length
  • mzebrak/ci-logs
  • mzebrak/ci-test-run
  • mzebrak/dynaconf
  • in-use-by-hive-v1.25.0
101 results

Target

Select target project
  • hive/test-tools
1 result
Select Git revision
  • abw_rc_scale
  • abw_reuse_undo
  • bw_faketime_playground
  • km_REBASED_mt-wallet-api-some-fixes_ON_pbatko/snapshot-improvements
  • km_add_request_logging_policy
  • kmochocki/add-alternate-chain-specs
  • kmochocki/add_more_settings_to_interface
  • kmochocki/beekeepy-revert-config-changes
  • kmochocki/beekeepy-wip
  • kmochocki/custom_events
  • kmochocki/filter_ci_from_environ
  • kmochocki/fix-haf-tests
  • kmochocki/fix-hive-error-response
  • kmochocki/fix-plugin-not-loaded
  • kmochocki/fix-transaction-expiration
  • kmochocki/helpy-mr-27
  • kmochocki/logger
  • kmochocki/mt-remove-notifications
  • kmochocki/notifications
  • kmochocki/notifications_with_custom_events
  • kmochocki/rm-beekeepy
  • kmochocki/test-tools-update-key-pair
  • kmochocki/try-update-schemas
  • kmochocki/wip
  • kmp
  • kudmich/add-get-block-ids-method-to-block-log-class
  • kudmich/beekeeper_fix
  • kudmich/full_block_generator
  • kudmich/helpy-update
  • kudmich/helpy_update
  • kudmich/logger_fork_tests
  • kudmich/pass_offset_to_network_object
  • kudmich/repair_block_log_many_opens
  • kudmich/schemas-update
  • kudmich/support-multiple-serialization-standards-for-create-accounts-function
  • kudmich/tmp
  • kudmich/tmp_helpy_update
  • lswiszcz/dump-node-options
  • master
  • master-clive
  • mi_faketime_and_monotonic_clocks
  • mkrzeminski/keyauth_fix_5m_MR_add_key_in_config
  • mkudela/bump_helpy_40
  • mkudela/improve_wallet_create_account
  • mkudela/test_of_bumping_schemas
  • mkudela/update_wax
  • mkudela/witness_guard
  • ms_add_blocklog_for_faketime
  • ms_add_faketime
  • ms_add_logs_when_making_fork
  • ms_add_new_config_options
  • ms_add_sql_serializer_plugin
  • ms_add_truncate_block_log
  • ms_allow_fork_also_for_one_node_network
  • ms_commit_pregenerated_block_log
  • ms_config_options_for_sql_serializer
  • ms_debug_set_witness_schedule
  • ms_faketime_update_timestamp_file
  • ms_fix_error_message_in_WORLD
  • ms_fix_urllib_newer_version
  • ms_get_number_of_forks
  • ms_http_request_on_error
  • ms_move_pregenerated_block_log
  • ms_new_config_options
  • ms_notification_system_log_level
  • ms_printing_available_networks
  • ms_replay_from_block_log
  • ms_speedup
  • ms_stale_production_with_faketime
  • ms_start_node_with_faketime
  • ms_starting_with_notification_system
  • ms_switch_fork_notification
  • ms_temporary_branch
  • ms_temporary_branch2
  • ms_urllib3_new_version_parsing
  • ms_wait_for_fork
  • msobczyk/add_witness_api_to_witness_node
  • msobczyk/add_witness_api_to_witness_node_and_wait_for_fork_event
  • msobczyk/check_ci_on_master
  • msobczyk/dont_always_use_default_python_int_handler_on_keyboard_interrupt
  • msobczyk/update-wax
  • msobczyk/use_block_lgo_in_read_only_mode
  • msobczyk/wait_for_next_fork
  • mt-07-feb-more-logs
  • mt-17-mar-test-changes
  • mt-26-feb-longer-timeout
  • mt-dump-params
  • mt-issue-303
  • mt-issue-345
  • mt-keosd
  • mt-node-fix
  • mt-secure-wallet
  • mt-support-dump-option-flag
  • mt-update-config
  • mt-wallet-api-some-fixes
  • mzebrak/asset-handle
  • mzebrak/block-log-length
  • mzebrak/ci-logs
  • mzebrak/ci-test-run
  • mzebrak/dynaconf
  • in-use-by-hive-v1.25.0
101 results
Show changes
Commits on Source (4)
......@@ -5,7 +5,7 @@ import shutil
import subprocess
import typing
from pathlib import Path
from typing import Literal, overload
from typing import Final, Literal, overload
from helpy._interfaces.time import Time, TimeFormats
from schemas.apis.block_api.fundaments_of_responses import BlockLogUtilSignedBlock
......@@ -143,6 +143,24 @@ class BlockLog:
output = self.__run_and_get_output("--get-block", *block_log_arg, *block_number_arg).replace("'", '"')
return BlockLogUtilResult(**json.loads(output))
def get_block_ids(self, block_number: int) -> str:
"""
Returns a block_ID from block_log.
:param block_number: ID of block to return
Note: This method works correctly only for block logs with a length of at least 30 blocks.
"""
expected_str: Final[str] = "block_id: "
if not self.artifacts_path.exists():
self.generate_artifacts()
output = self.__run_and_get_output(
"--get-block-ids", "-n", f"{block_number}", "--block-log", str(self.path)
).replace("'", '"')
assert expected_str in output, f"Response malformed: `{output}`"
return output[len(expected_str) :]
@overload
def get_head_block_time(
self, serialize: Literal[True], serialize_format: TimeFormats | str = TimeFormats.DEFAULT_FORMAT
......
# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
[[package]]
name = "abstractcp"
......@@ -440,12 +440,12 @@ hyperframe = ">=6.0,<7"
[[package]]
name = "helpy"
version = "0.0.1.dev159+9bbf41d"
version = "0.0.1.dev162+b5dcc6c"
description = "Easily interact with the Hive blockchain using Python."
optional = false
python-versions = ">=3.10,<4.0"
files = [
{file = "helpy-0.0.1.dev159+9bbf41d-py3-none-any.whl", hash = "sha256:916502b3031372c77f9dff66a0b6d01bab8374a337e08dc814c3a37240712146"},
{file = "helpy-0.0.1.dev162+b5dcc6c-py3-none-any.whl", hash = "sha256:48a0740def8bfaa7da886b8fccde18bf6a4804da4da965b52789e9b4797ffe16"},
]
[package.dependencies]
......@@ -455,8 +455,8 @@ loguru = "0.7.2"
pytest-is-running = "1.5.0"
python-dateutil = "2.8.2"
requests = "2.27.1"
schemas = "0.0.1.dev290+6a01cb0"
wax = "0.0.3a2.dev39+44db07f"
schemas = "0.0.1.dev292+bcba095"
wax = "0.0.3a2.dev187+207f9b4"
[package.source]
type = "legacy"
......@@ -1118,12 +1118,12 @@ files = [
[[package]]
name = "schemas"
version = "0.0.1.dev290+6a01cb0"
version = "0.0.1.dev292+bcba095"
description = "Tools for checking if message fits expected format"
optional = false
python-versions = ">=3.10,<4.0"
files = [
{file = "schemas-0.0.1.dev290+6a01cb0-py3-none-any.whl", hash = "sha256:af2562ec720b6ebf7939fce7f5979a7f850aaf4d6a71afe3fc5fbb91a4397e8a"},
{file = "schemas-0.0.1.dev292+bcba095-py3-none-any.whl", hash = "sha256:b7a053f9bc227ee82a1cfbac5dcd76e57624bdc9f804c1aa2a7d3c144dc48488"},
]
[package.dependencies]
......@@ -1243,12 +1243,12 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess
[[package]]
name = "wax"
version = "0.0.3a2.dev39+44db07f"
version = "0.0.3a2.dev187+207f9b4"
description = ""
optional = false
python-versions = ">=3.10,<4.0"
files = [
{file = "wax-0.0.3a2.dev39+44db07f-cp310-cp310-manylinux_2_35_x86_64.whl", hash = "sha256:37fa7413cca20fd933e9a142bf3c13dcab05a1be3e42c784a8f61c40b17d53d5"},
{file = "wax-0.0.3a2.dev187+207f9b4-cp310-cp310-manylinux_2_35_x86_64.whl", hash = "sha256:e9ee806749736fd29d0c792763728f72daec8d66cae34b5bec5263cab6a36396"},
]
[package.dependencies]
......@@ -1363,4 +1363,4 @@ multidict = ">=4.0"
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "9c3f77861d54c67599887a5b477a80b1f32e86c34f52f4ceae84c7547f371736"
content-hash = "c29158a2b1ebbd06d91943a2cfbdc05975ac4b0936e86eb4748f4bb283904335"
......@@ -27,7 +27,7 @@ requests = "2.27.1"
python-dateutil = "2.8.2"
abstractcp = "0.9.9"
loguru = "0.7.2"
helpy = "0.0.1.dev159+9bbf41d"
helpy = "0.0.1.dev162+b5dcc6c"
[tool.poetry.group.dev.dependencies]
......
......@@ -81,3 +81,16 @@ def test_exception_handling(node: tt.InitNode) -> None:
assert "the argument ('incorrect_block_num') for option '--block-number' is invalid" in str(
error.value
), "Incorrect error message"
def test_get_block_ids(node: tt.InitNode) -> None:
block_log = node.block_log
block_id_from_node = node.api.block.get_block(block_num=10)
node.close()
block_id_from_block_log = block_log.get_block_ids(block_number=10)
assert isinstance(block_id_from_node, GetBlockBase)
assert (
block_id_from_node.block.block_id == block_id_from_block_log
), "The block_id in node differs from the block_id in block_log."