MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / get_block_part

Method get_block_part

test/functional/interface_rest.py:466–472  ·  view source on GitHub ↗
(status: int = 200, **kwargs)

Source from the content-addressed store, hash-verified

464 block_bin = self.test_rest_request(f"/block/{blockhash}", req_type=ReqType.BIN, ret_type=RetType.BYTES)
465 for req_type in (ReqType.BIN, ReqType.HEX):
466 def get_block_part(status: int = 200, **kwargs):
467 resp = self.test_rest_request(f"/blockpart/{blockhash}", status=status,
468 req_type=req_type, ret_type=RetType.BYTES, **kwargs)
469 assert isinstance(resp, bytes)
470 if req_type is ReqType.HEX and status == 200:
471 resp = bytes.fromhex(resp.decode().strip())
472 return resp
473
474 assert_equal(block_bin, get_block_part(query_params={"offset": 0, "size": len(block_bin)}))
475

Callers

nothing calls this directly

Calls 2

test_rest_requestMethod · 0.95
decodeMethod · 0.45

Tested by

no test coverage detected