MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / assert_is_hash_string

Function assert_is_hash_string

test/functional/test_framework/util.py:133–141  ·  view source on GitHub ↗
(string, length=64)

Source from the content-addressed store, hash-verified

131 "Couldn't interpret %r as hexadecimal; raised: %s" % (string, e))
132
133def assert_is_hash_string(string, length=64):
134 if not isinstance(string, str):
135 raise AssertionError("Expected a string, got type %r" % type(string))
136 elif length and len(string) != length:
137 raise AssertionError(
138 "String of length %d expected; got %d" % (length, len(string)))
139 elif not re.match('[abcdef0-9]+$', string):
140 raise AssertionError(
141 "String %r contains invalid characters for a hash." % string)
142
143def assert_array_result(object_array, to_match, expected, should_not_find=False):
144 """

Callers 1

_test_getblockheaderMethod · 0.90

Calls 1

typeClass · 0.85

Tested by

no test coverage detected