43 |
(module level)
|
NumberReplacer
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1023 # 10 MB
|
|
43 |
(module level)
|
NumberReplacer
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 9 * 1024 * 1024 # 10 MB
|
|
43 |
(module level)
|
NumberReplacer
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 * 1023 * 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_Add
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 + 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_Add
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 + 1024 * 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_BitOr
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 | 1024 * 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_BitOr
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 | 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_BitXor
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 ^ 1024 * 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_BitXor
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 ^ 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_Mod
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 % 1024 * 1024 # 10 MB
|
|
43 |
(module level)
|
ReplaceBinaryOperator_Mul_Sub
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 * 1024 # 10 MB
|
_MAX_RESPONSE_BYTES: int = 10 * 1024 - 1024 # 10 MB
|
|
52 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
56 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
60 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
64 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
68 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
69 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 7) -> RawTx:
|
|
69 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 5) -> RawTx:
|
|
72 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
76 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
83 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
87 |
BtcDataSource
|
RemoveDecorator
|
`` |
`` |
|
128 |
_assert_tx_identity
|
NumberReplacer
|
f"tx response does not identify the requested transaction {str(txid)[:16]}… "
|
f"tx response does not identify the requested transaction {str(txid)[: 17]}… "
|
|
128 |
_assert_tx_identity
|
NumberReplacer
|
f"tx response does not identify the requested transaction {str(txid)[:16]}… "
|
f"tx response does not identify the requested transaction {str(txid)[: 15]}… "
|
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_Add
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int + None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_BitAnd
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int & None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_BitXor
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int ^ None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_Div
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int / None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int // None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_LShift
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int << None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_Mod
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int % None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_Mul
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int * None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_Pow
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int ** None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_RShift
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int >> None:
|
annot
|
146 |
_esplora_status_height
|
ReplaceBinaryOperator_BitOr_Sub
|
def _esplora_status_height(status: Any) -> int | None:
|
def _esplora_status_height(status: Any) -> int - None:
|
annot
|
187 |
_check_response_size
|
ReplaceComparisonOperator_Gt_GtE
|
if len(body) > _MAX_RESPONSE_BYTES:
|
if len(body) >= _MAX_RESPONSE_BYTES:
|
|
195 |
_get_json
|
ReplaceFalseWithTrue
|
async with session.get(url, allow_redirects=False) as resp:
|
async with session.get(url, allow_redirects=True) as resp:
|
|
197 |
_get_json
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_Add
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int + None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_BitAnd
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int & None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_BitXor
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int ^ None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_Div
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int / None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int // None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_LShift
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int << None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_Mod
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int % None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_Mul
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int * None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_Pow
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int ** None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_RShift
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int >> None = None) -> bytes:
|
annot
|
210 |
_get_hex_bytes
|
ReplaceBinaryOperator_BitOr_Sub
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int | None = None) -> bytes:
|
async def _get_hex_bytes(session: aiohttp.ClientSession, url: str, expected_len: int - None = None) -> bytes:
|
annot
|
213 |
_get_hex_bytes
|
ReplaceFalseWithTrue
|
async with session.get(url, allow_redirects=False) as resp:
|
async with session.get(url, allow_redirects=True) as resp:
|
|
215 |
_get_hex_bytes
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
221 |
_get_hex_bytes
|
ReplaceComparisonOperator_NotEq_IsNot
|
if expected_len is not None and len(result) != expected_len:
|
if expected_len is not None and len(result) is not expected_len:
|
|
221 |
_get_hex_bytes
|
ReplaceComparisonOperator_NotEq_Lt
|
if expected_len is not None and len(result) != expected_len:
|
if expected_len is not None and len(result) < expected_len:
|
|
245 |
_get_session
|
ReplaceOrWithAnd
|
if self._session is None or self._session.closed:
|
if self._session is None and self._session.closed:
|
|
258 |
_url
|
ZeroIterationForLoop
|
for part in parts:
|
for part in []:
|
|
266 |
get_tip_height
|
ReplaceFalseWithTrue
|
async with session.get(url, allow_redirects=False) as resp:
|
async with session.get(url, allow_redirects=True) as resp:
|
|
268 |
get_tip_height
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
268 |
get_tip_height
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
278 |
get_block_hash
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
278 |
get_block_hash
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
283 |
get_block_hash
|
ReplaceFalseWithTrue
|
async with session.get(url, allow_redirects=False) as resp:
|
async with session.get(url, allow_redirects=True) as resp:
|
|
285 |
get_block_hash
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
285 |
get_block_hash
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
296 |
get_block_header_hex
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
296 |
get_block_header_hex
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
305 |
get_header_chain
|
AddNot
|
if not isinstance(start_height, BlockHeight):
|
if not not isinstance(start_height, BlockHeight):
|
|
305 |
get_header_chain
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(start_height, BlockHeight):
|
if isinstance(start_height, BlockHeight):
|
|
307 |
get_header_chain
|
ReplaceComparisonOperator_LtE_Eq
|
if count <= 0:
|
if count == 0:
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitAnd
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) & i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitOr
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) | i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitXor
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) ^ i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_LShift
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) << i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_Mul
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) * i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_Pow
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) ** i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_RShift
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) >> i)) for i in range(count)]
|
|
311 |
get_header_chain
|
ReplaceBinaryOperator_Add_Sub
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) - i)) for i in range(count)]
|
|
319 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 5) -> RawTx:
|
|
319 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 7) -> RawTx:
|
|
320 |
get_raw_tx
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
320 |
get_raw_tx
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
331 |
get_raw_tx
|
ReplaceComparisonOperator_Gt_NotEq
|
if min_confirmations > 0:
|
if min_confirmations != 0:
|
|
338 |
get_raw_tx
|
NumberReplacer
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 2 or block_height > int(tip):
|
|
338 |
get_raw_tx
|
ReplaceComparisonOperator_Gt_GtE
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 1 or block_height >= int(tip):
|
|
338 |
get_raw_tx
|
ReplaceComparisonOperator_Lt_LtE
|
if block_height < 1 or block_height > int(tip):
|
if block_height <= 1 or block_height > int(tip):
|
|
343 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_Mod
|
confs = int(tip) - block_height + 1
|
confs = int(tip) % block_height + 1
|
|
350 |
get_raw_tx
|
ReplaceFalseWithTrue
|
async with session.get(hex_url, allow_redirects=False) as resp:
|
async with session.get(hex_url, allow_redirects=True) as resp:
|
|
352 |
get_raw_tx
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
352 |
get_raw_tx
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
364 |
get_tx_block_height
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
364 |
get_tx_block_height
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
371 |
get_tx_block_height
|
NumberReplacer
|
raise NetworkError(f"tx {str(txid)[:16]}… is unconfirmed")
|
raise NetworkError(f"tx {str(txid)[: 15]}… is unconfirmed")
|
|
371 |
get_tx_block_height
|
NumberReplacer
|
raise NetworkError(f"tx {str(txid)[:16]}… is unconfirmed")
|
raise NetworkError(f"tx {str(txid)[: 17]}… is unconfirmed")
|
|
378 |
get_tx_output_script_type
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
378 |
get_tx_output_script_type
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
405 |
get_merkle_proof
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
405 |
get_merkle_proof
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
407 |
get_merkle_proof
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
407 |
get_merkle_proof
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
426 |
_get_session
|
ReplaceOrWithAnd
|
if self._session is None or self._session.closed:
|
if self._session is None and self._session.closed:
|
|
437 |
_url
|
ZeroIterationForLoop
|
for part in parts:
|
for part in []:
|
|
445 |
get_tip_height
|
ReplaceFalseWithTrue
|
async with session.get(url, allow_redirects=False) as resp:
|
async with session.get(url, allow_redirects=True) as resp:
|
|
447 |
get_tip_height
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
447 |
get_tip_height
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
457 |
get_block_hash
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
457 |
get_block_hash
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
462 |
get_block_hash
|
ReplaceFalseWithTrue
|
async with session.get(url, allow_redirects=False) as resp:
|
async with session.get(url, allow_redirects=True) as resp:
|
|
464 |
get_block_hash
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
464 |
get_block_hash
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
475 |
get_block_header_hex
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
475 |
get_block_header_hex
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
483 |
get_header_chain
|
AddNot
|
if not isinstance(start_height, BlockHeight):
|
if not not isinstance(start_height, BlockHeight):
|
|
483 |
get_header_chain
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(start_height, BlockHeight):
|
if isinstance(start_height, BlockHeight):
|
|
485 |
get_header_chain
|
ReplaceComparisonOperator_LtE_Eq
|
if count <= 0:
|
if count == 0:
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitAnd
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) & i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitOr
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) | i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitXor
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) ^ i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_LShift
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) << i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_Mul
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) * i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_Pow
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) ** i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_RShift
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) >> i)) for i in range(count)]
|
|
487 |
get_header_chain
|
ReplaceBinaryOperator_Add_Sub
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) - i)) for i in range(count)]
|
|
488 |
get_header_chain
|
ReplaceTrueWithFalse
|
results = await asyncio.gather(*tasks, return_exceptions=True)
|
results = await asyncio.gather(*tasks, return_exceptions=False)
|
|
496 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 7) -> RawTx:
|
|
496 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 5) -> RawTx:
|
|
497 |
get_raw_tx
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
497 |
get_raw_tx
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
505 |
get_raw_tx
|
NumberReplacer
|
raise InsufficientConfirmationsError(have=0, required=min_confirmations)
|
raise InsufficientConfirmationsError(have= -1, required=min_confirmations)
|
|
505 |
get_raw_tx
|
NumberReplacer
|
raise InsufficientConfirmationsError(have=0, required=min_confirmations)
|
raise InsufficientConfirmationsError(have= 1, required=min_confirmations)
|
|
507 |
get_raw_tx
|
ReplaceComparisonOperator_Gt_NotEq
|
if min_confirmations > 0:
|
if min_confirmations != 0:
|
|
510 |
get_raw_tx
|
NumberReplacer
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 2 or block_height > int(tip):
|
|
510 |
get_raw_tx
|
ReplaceComparisonOperator_Gt_Eq
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 1 or block_height == int(tip):
|
|
510 |
get_raw_tx
|
ReplaceComparisonOperator_Gt_GtE
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 1 or block_height >= int(tip):
|
|
510 |
get_raw_tx
|
ReplaceComparisonOperator_Gt_Is
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 1 or block_height is int(tip):
|
|
510 |
get_raw_tx
|
ReplaceComparisonOperator_Lt_LtE
|
if block_height < 1 or block_height > int(tip):
|
if block_height <= 1 or block_height > int(tip):
|
|
515 |
get_raw_tx
|
NumberReplacer
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height + 0
|
|
515 |
get_raw_tx
|
NumberReplacer
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height + 2
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_BitOr
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height | 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_BitXor
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height ^ 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_Div
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height / 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_FloorDiv
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height // 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_LShift
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height << 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_Mod
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height % 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_Mul
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height * 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_Pow
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height ** 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_RShift
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height >> 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Add_Sub
|
confs = int(tip) - block_height + 1
|
confs = int(tip) - block_height - 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_Add
|
confs = int(tip) - block_height + 1
|
confs = int(tip) + block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_BitAnd
|
confs = int(tip) - block_height + 1
|
confs = int(tip) & block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_BitOr
|
confs = int(tip) - block_height + 1
|
confs = int(tip) | block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_BitXor
|
confs = int(tip) - block_height + 1
|
confs = int(tip) ^ block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_Div
|
confs = int(tip) - block_height + 1
|
confs = int(tip) / block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_FloorDiv
|
confs = int(tip) - block_height + 1
|
confs = int(tip) // block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_LShift
|
confs = int(tip) - block_height + 1
|
confs = int(tip) << block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_Mod
|
confs = int(tip) - block_height + 1
|
confs = int(tip) % block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_Mul
|
confs = int(tip) - block_height + 1
|
confs = int(tip) * block_height + 1
|
|
515 |
get_raw_tx
|
ReplaceBinaryOperator_Sub_Pow
|
confs = int(tip) - block_height + 1
|
confs = int(tip) ** block_height + 1
|
|
516 |
get_raw_tx
|
ReplaceComparisonOperator_Lt_Eq
|
if confs < min_confirmations:
|
if confs == min_confirmations:
|
|
516 |
get_raw_tx
|
ReplaceComparisonOperator_Lt_Is
|
if confs < min_confirmations:
|
if confs is min_confirmations:
|
|
516 |
get_raw_tx
|
ReplaceComparisonOperator_Lt_LtE
|
if confs < min_confirmations:
|
if confs <= min_confirmations:
|
|
521 |
get_raw_tx
|
ReplaceFalseWithTrue
|
async with session.get(hex_url, allow_redirects=False) as resp:
|
async with session.get(hex_url, allow_redirects=True) as resp:
|
|
523 |
get_raw_tx
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
523 |
get_raw_tx
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
527 |
get_raw_tx
|
ExceptionReplacer
|
except (ValueError, UnicodeDecodeError):
|
except (CosmicRayTestingException, UnicodeDecodeError):
|
|
527 |
get_raw_tx
|
ExceptionReplacer
|
except (ValueError, UnicodeDecodeError):
|
except (ValueError, CosmicRayTestingException):
|
|
531 |
get_raw_tx
|
ExceptionReplacer
|
except aiohttp.ClientError as exc:
|
except aiohttpCosmicRayTestingExceptionClientError as exc:
|
|
535 |
get_tx_block_height
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
535 |
get_tx_block_height
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
542 |
get_tx_block_height
|
NumberReplacer
|
raise NetworkError(f"tx {str(txid)[:16]}… is unconfirmed")
|
raise NetworkError(f"tx {str(txid)[: 17]}… is unconfirmed")
|
|
542 |
get_tx_block_height
|
NumberReplacer
|
raise NetworkError(f"tx {str(txid)[:16]}… is unconfirmed")
|
raise NetworkError(f"tx {str(txid)[: 15]}… is unconfirmed")
|
|
549 |
get_tx_output_script_type
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
549 |
get_tx_output_script_type
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
571 |
get_tx_output_script_type
|
ExceptionReplacer
|
except (KeyError, IndexError, TypeError):
|
except (KeyError, CosmicRayTestingException, TypeError):
|
|
571 |
get_tx_output_script_type
|
ExceptionReplacer
|
except (KeyError, IndexError, TypeError):
|
except (CosmicRayTestingException, IndexError, TypeError):
|
|
571 |
get_tx_output_script_type
|
ExceptionReplacer
|
except (KeyError, IndexError, TypeError):
|
except (KeyError, IndexError, CosmicRayTestingException):
|
|
575 |
get_merkle_proof
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
575 |
get_merkle_proof
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
577 |
get_merkle_proof
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
577 |
get_merkle_proof
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
609 |
__init__
|
NumberReplacer
|
self._id_counter = 0
|
self._id_counter = -1
|
|
609 |
__init__
|
NumberReplacer
|
self._id_counter = 0
|
self._id_counter = 1
|
|
612 |
_get_session
|
AddNot
|
if self._session is None or self._session.closed:
|
if not self._session is None or self._session.closed:
|
|
612 |
_get_session
|
ReplaceComparisonOperator_Is_IsNot
|
if self._session is None or self._session.closed:
|
if self._session is not None or self._session.closed:
|
|
612 |
_get_session
|
ReplaceOrWithAnd
|
if self._session is None or self._session.closed:
|
if self._session is None and self._session.closed:
|
|
628 |
_rpc
|
NumberReplacer
|
self._id_counter += 1
|
self._id_counter += 2
|
|
628 |
_rpc
|
NumberReplacer
|
self._id_counter += 1
|
self._id_counter += 0
|
|
636 |
_rpc
|
ReplaceFalseWithTrue
|
async with session.post(self._url, json=payload, allow_redirects=False) as resp:
|
async with session.post(self._url, json=payload, allow_redirects=True) as resp:
|
|
665 |
get_block_hash
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
665 |
get_block_hash
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
676 |
get_block_header_hex
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
676 |
get_block_header_hex
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
680 |
get_block_header_hex
|
ReplaceFalseWithTrue
|
result = await self._rpc("getblockheader", [block_hash.hex(), False])
|
result = await self._rpc("getblockheader", [block_hash.hex(), True])
|
|
687 |
get_block_header_hex
|
ReplaceComparisonOperator_NotEq_Lt
|
if len(header) != 80:
|
if len(header) < 80:
|
|
692 |
get_header_chain
|
AddNot
|
if not isinstance(start_height, BlockHeight):
|
if not not isinstance(start_height, BlockHeight):
|
|
692 |
get_header_chain
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(start_height, BlockHeight):
|
if isinstance(start_height, BlockHeight):
|
|
694 |
get_header_chain
|
ReplaceComparisonOperator_LtE_Eq
|
if count <= 0:
|
if count == 0:
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitAnd
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) & i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitOr
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) | i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_BitXor
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) ^ i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_LShift
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) << i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_Mul
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) * i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_Pow
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) ** i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_RShift
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) >> i)) for i in range(count)]
|
|
696 |
get_header_chain
|
ReplaceBinaryOperator_Add_Sub
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) + i)) for i in range(count)]
|
tasks = [self.get_block_header_hex(BlockHeight(int(start_height) - i)) for i in range(count)]
|
|
697 |
get_header_chain
|
ReplaceTrueWithFalse
|
results = await asyncio.gather(*tasks, return_exceptions=True)
|
results = await asyncio.gather(*tasks, return_exceptions=False)
|
|
705 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 5) -> RawTx:
|
|
705 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 7) -> RawTx:
|
|
706 |
get_raw_tx
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
706 |
get_raw_tx
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
709 |
get_raw_tx
|
ReplaceTrueWithFalse
|
data = await self._rpc("getrawtransaction", [str(txid), True])
|
data = await self._rpc("getrawtransaction", [str(txid), False])
|
|
718 |
get_raw_tx
|
NumberReplacer
|
confs = nonneg_int(data.get("confirmations", 0))
|
confs = nonneg_int(data.get("confirmations", -1))
|
|
718 |
get_raw_tx
|
NumberReplacer
|
confs = nonneg_int(data.get("confirmations", 0))
|
confs = nonneg_int(data.get("confirmations", 1))
|
|
721 |
get_raw_tx
|
ReplaceComparisonOperator_Lt_LtE
|
if confs < min_confirmations:
|
if confs <= min_confirmations:
|
|
734 |
get_tx_block_height
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
734 |
get_tx_block_height
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
736 |
get_tx_block_height
|
ReplaceTrueWithFalse
|
data = await self._rpc("getrawtransaction", [str(txid), True])
|
data = await self._rpc("getrawtransaction", [str(txid), False])
|
|
741 |
get_tx_block_height
|
NumberReplacer
|
raise NetworkError(f"tx {str(txid)[:16]}… is unconfirmed or blockheight missing")
|
raise NetworkError(f"tx {str(txid)[: 17]}… is unconfirmed or blockheight missing")
|
|
741 |
get_tx_block_height
|
NumberReplacer
|
raise NetworkError(f"tx {str(txid)[:16]}… is unconfirmed or blockheight missing")
|
raise NetworkError(f"tx {str(txid)[: 15]}… is unconfirmed or blockheight missing")
|
|
744 |
get_tx_block_height
|
ExceptionReplacer
|
except (ValueError, ValidationError):
|
except (ValueError, CosmicRayTestingException):
|
|
744 |
get_tx_block_height
|
ExceptionReplacer
|
except (ValueError, ValidationError):
|
except (CosmicRayTestingException, ValidationError):
|
|
748 |
get_tx_output_script_type
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
748 |
get_tx_output_script_type
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
750 |
get_tx_output_script_type
|
ReplaceTrueWithFalse
|
data = await self._rpc("getrawtransaction", [str(txid), True])
|
data = await self._rpc("getrawtransaction", [str(txid), False])
|
|
795 |
_verify_raw_matches_txid
|
ExceptionReplacer
|
except Exception as exc:
|
except CosmicRayTestingException as exc:
|
|
797 |
_verify_raw_matches_txid
|
ReplaceComparisonOperator_NotEq_Gt
|
if derived.lower() != str(txid).lower():
|
if derived.lower() > str(txid).lower():
|
|
797 |
_verify_raw_matches_txid
|
ReplaceComparisonOperator_NotEq_Is
|
if derived.lower() != str(txid).lower():
|
if derived.lower() is str(txid).lower():
|
|
797 |
_verify_raw_matches_txid
|
ReplaceComparisonOperator_NotEq_Lt
|
if derived.lower() != str(txid).lower():
|
if derived.lower() < str(txid).lower():
|
|
798 |
_verify_raw_matches_txid
|
NumberReplacer
|
raise NetworkError(f"returned tx bytes do not match the requested txid {str(txid)[:16]}…; fail-closed")
|
raise NetworkError(f"returned tx bytes do not match the requested txid {str(txid)[: 17]}…; fail-closed")
|
|
798 |
_verify_raw_matches_txid
|
NumberReplacer
|
raise NetworkError(f"returned tx bytes do not match the requested txid {str(txid)[:16]}…; fail-closed")
|
raise NetworkError(f"returned tx bytes do not match the requested txid {str(txid)[: 15]}…; fail-closed")
|
|
816 |
__init__
|
NumberReplacer
|
def __init__(self, sources: list[BtcDataSource], quorum: int = 2) -> None:
|
def __init__(self, sources: list[BtcDataSource], quorum: int = 1) -> None:
|
|
816 |
__init__
|
NumberReplacer
|
def __init__(self, sources: list[BtcDataSource], quorum: int = 2) -> None:
|
def __init__(self, sources: list[BtcDataSource], quorum: int = 3) -> None:
|
|
824 |
close
|
ZeroIterationForLoop
|
for source in self._sources:
|
for source in []:
|
|
842 |
_require_quorum
|
ReplaceContinueWithBreak
|
continue
|
break
|
|
847 |
_require_quorum
|
ReplaceComparisonOperator_GtE_Eq
|
if len(group) >= self._quorum:
|
if len(group) == self._quorum:
|
|
847 |
_require_quorum
|
ReplaceComparisonOperator_GtE_Is
|
if len(group) >= self._quorum:
|
if len(group) is self._quorum:
|
|
848 |
_require_quorum
|
NumberReplacer
|
return group[0]
|
return group[ -1]
|
|
850 |
_require_quorum
|
NumberReplacer
|
successful = sum(1 for r in results if not isinstance(r, Exception))
|
successful = sum( 0 for r in results if not isinstance(r, Exception))
|
|
850 |
_require_quorum
|
NumberReplacer
|
successful = sum(1 for r in results if not isinstance(r, Exception))
|
successful = sum( 2 for r in results if not isinstance(r, Exception))
|
|
850 |
_require_quorum
|
ReplaceUnaryOperator_Delete_Not
|
successful = sum(1 for r in results if not isinstance(r, Exception))
|
successful = sum(1 for r in results if isinstance(r, Exception))
|
|
861 |
get_block_hash
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
861 |
get_block_hash
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
868 |
get_block_header_hex
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
868 |
get_block_header_hex
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
875 |
get_header_chain
|
AddNot
|
if not isinstance(start_height, BlockHeight):
|
if not not isinstance(start_height, BlockHeight):
|
|
875 |
get_header_chain
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(start_height, BlockHeight):
|
if isinstance(start_height, BlockHeight):
|
|
886 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 7) -> RawTx:
|
|
886 |
get_raw_tx
|
NumberReplacer
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 6) -> RawTx:
|
async def get_raw_tx(self, txid: Txid, min_confirmations: int = 5) -> RawTx:
|
|
887 |
get_raw_tx
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
887 |
get_raw_tx
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
898 |
get_tx_block_height
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
898 |
get_tx_block_height
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
905 |
get_tx_output_script_type
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
905 |
get_tx_output_script_type
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
912 |
get_merkle_proof
|
AddNot
|
if not isinstance(txid, Txid):
|
if not not isinstance(txid, Txid):
|
|
912 |
get_merkle_proof
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(txid, Txid):
|
if isinstance(txid, Txid):
|
|
914 |
get_merkle_proof
|
AddNot
|
if not isinstance(height, BlockHeight):
|
if not not isinstance(height, BlockHeight):
|
|
914 |
get_merkle_proof
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(height, BlockHeight):
|
if isinstance(height, BlockHeight):
|
|
951 |
_MempoolHttpClient
|
NumberReplacer
|
DEFAULT_TIMEOUT_S: float = 30.0
|
DEFAULT_TIMEOUT_S: float = 31.0
|
|
951 |
_MempoolHttpClient
|
NumberReplacer
|
DEFAULT_TIMEOUT_S: float = 30.0
|
DEFAULT_TIMEOUT_S: float = 29.0
|
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_Add
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float + None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_BitAnd
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float & None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_BitXor
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float ^ None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_Div
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float / None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float // None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_LShift
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float << None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_Mod
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float % None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_Mul
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float * None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_Pow
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float ** None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_RShift
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float >> None = None) -> None:
|
annot
|
953 |
__init__
|
ReplaceBinaryOperator_BitOr_Sub
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float | None = None) -> None:
|
def __init__(self, base_url: str = "https://mempool.space/api", *, timeout_s: float - None = None) -> None:
|
annot
|
964 |
close
|
ReplaceUnaryOperator_Delete_Not
|
if self._session and not self._session.closed:
|
if self._session and self._session.closed:
|
|
977 |
tip_height
|
ReplaceFalseWithTrue
|
async with s.get(self.url("blocks/tip/height"), allow_redirects=False) as resp:
|
async with s.get(self.url("blocks/tip/height"), allow_redirects=True) as resp:
|
|
979 |
tip_height
|
ReplaceComparisonOperator_NotEq_Gt
|
if resp.status != 200:
|
if resp.status > 200:
|
|
979 |
tip_height
|
ReplaceComparisonOperator_NotEq_Lt
|
if resp.status != 200:
|
if resp.status < 200:
|
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_Add
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient + None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_BitAnd
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient & None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_BitXor
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient ^ None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_Div
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient / None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient // None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_LShift
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient << None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_Mod
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient % None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_Mul
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient * None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_Pow
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient ** None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_RShift
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient >> None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_BitOr_Sub
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient - None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1025 |
__init__
|
ReplaceBinaryOperator_Mul_Div
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient | None = None, /, base_url: str = "https://mempool.space/api"
|
|
1032 |
broadcast
|
ReplaceComparisonOperator_Eq_LtE
|
if not isinstance(raw_tx, (bytes, bytearray)) or len(raw_tx) == 0:
|
if not isinstance(raw_tx, (bytes, bytearray)) or len(raw_tx) <= 0:
|
|
1037 |
broadcast
|
ReplaceFalseWithTrue
|
async with s.post(self._http.url("tx"), data=raw.hex(), allow_redirects=False) as resp:
|
async with s.post(self._http.url("tx"), data=raw.hex(), allow_redirects=True) as resp:
|
|
1039 |
broadcast
|
ReplaceComparisonOperator_Eq_LtE
|
if resp.status == 200:
|
if resp.status <= 200:
|
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_Add
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient + None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_BitAnd
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient & None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_BitXor
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient ^ None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_Div
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient / None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient // None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_LShift
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient << None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_Mod
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient % None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_Mul
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient * None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_Pow
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient ** None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_RShift
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient >> None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_BitOr_Sub
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient - None = None, *, base_url: str = "https://mempool.space/api"
|
annot
|
1079 |
__init__
|
ReplaceBinaryOperator_Mul_Div
|
self, client: _MempoolHttpClient | None = None, *, base_url: str = "https://mempool.space/api"
|
self, client: _MempoolHttpClient | None = None, /, base_url: str = "https://mempool.space/api"
|
|
1084 |
confirmations
|
AddNot
|
tx = txid if isinstance(txid, Txid) else Txid(txid)
|
tx = txid if not isinstance(txid, Txid) else Txid(txid)
|
|
1100 |
confirmations
|
NumberReplacer
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 2 or block_height > int(tip):
|
|
1100 |
confirmations
|
ReplaceComparisonOperator_Gt_GtE
|
if block_height < 1 or block_height > int(tip):
|
if block_height < 1 or block_height >= int(tip):
|
|
1100 |
confirmations
|
ReplaceComparisonOperator_Lt_LtE
|
if block_height < 1 or block_height > int(tip):
|
if block_height <= 1 or block_height > int(tip):
|
|
1102 |
confirmations
|
NumberReplacer
|
f"inconsistent confirmation data for {str(tx)[:16]}…: block_height={block_height}, tip={int(tip)}; "
|
f"inconsistent confirmation data for {str(tx)[: 17]}…: block_height={block_height}, tip={int(tip)}; "
|
|
1102 |
confirmations
|
NumberReplacer
|
f"inconsistent confirmation data for {str(tx)[:16]}…: block_height={block_height}, tip={int(tip)}; "
|
f"inconsistent confirmation data for {str(tx)[: 15]}…: block_height={block_height}, tip={int(tip)}; "
|
|
1105 |
confirmations
|
ReplaceBinaryOperator_Sub_Mod
|
confs = int(tip) - block_height + 1
|
confs = int(tip) % block_height + 1
|
|
1106 |
confirmations
|
NumberReplacer
|
return confs if confs > 0 else 0
|
return confs if confs > 0 else -1
|
|
1106 |
confirmations
|
NumberReplacer
|
return confs if confs > 0 else 0
|
return confs if confs > -1 else 0
|
|
1106 |
confirmations
|
NumberReplacer
|
return confs if confs > 0 else 0
|
return confs if confs > 0 else 1
|
|
1106 |
confirmations
|
NumberReplacer
|
return confs if confs > 0 else 0
|
return confs if confs > 1 else 0
|
|
1106 |
confirmations
|
ReplaceComparisonOperator_Gt_GtE
|
return confs if confs > 0 else 0
|
return confs if confs >= 0 else 0
|
|
1106 |
confirmations
|
ReplaceComparisonOperator_Gt_NotEq
|
return confs if confs > 0 else 0
|
return confs if confs != 0 else 0
|
|
1108 |
read_output_amount_sats
|
ReplaceBinaryOperator_Mul_Div
|
async def read_output_amount_sats(self, txid: str, vout: int, *, min_confirmations: int) -> int:
|
async def read_output_amount_sats(self, txid: str, vout: int, /, min_confirmations: int) -> int:
|
|
1109 |
read_output_amount_sats
|
AddNot
|
tx = txid if isinstance(txid, Txid) else Txid(txid)
|
tx = txid if not isinstance(txid, Txid) else Txid(txid)
|
|
1111 |
read_output_amount_sats
|
ReplaceComparisonOperator_Lt_LtE
|
if confs < min_confirmations:
|
if confs <= min_confirmations:
|
|
1118 |
read_output_amount_sats
|
NumberReplacer
|
raise NetworkError(f"could not read output value for {str(tx)[:16]}…:{vout}") from exc
|
raise NetworkError(f"could not read output value for {str(tx)[: 17]}…:{vout}") from exc
|
|
1118 |
read_output_amount_sats
|
NumberReplacer
|
raise NetworkError(f"could not read output value for {str(tx)[:16]}…:{vout}") from exc
|
raise NetworkError(f"could not read output value for {str(tx)[: 15]}…:{vout}") from exc
|
|
1131 |
read_confirmed_unspent_output
|
AddNot
|
tx = txid if isinstance(txid, Txid) else Txid(txid)
|
tx = txid if not isinstance(txid, Txid) else Txid(txid)
|
|
1135 |
read_confirmed_unspent_output
|
NumberReplacer
|
if await self.confirmations(tx) < 1:
|
if await self.confirmations(tx) < 2:
|
|
1135 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Lt_LtE
|
if await self.confirmations(tx) < 1:
|
if await self.confirmations(tx) <= 1:
|
|
1136 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"output {str(tx)[:16]}…:{index} is unconfirmed or unknown; fail-closed")
|
raise NetworkError(f"output {str(tx)[: 15]}…:{index} is unconfirmed or unknown; fail-closed")
|
|
1136 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"output {str(tx)[:16]}…:{index} is unconfirmed or unknown; fail-closed")
|
raise NetworkError(f"output {str(tx)[: 17]}…:{index} is unconfirmed or unknown; fail-closed")
|
|
1144 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"could not read output {str(tx)[:16]}…:{index}; fail-closed") from exc
|
raise NetworkError(f"could not read output {str(tx)[: 15]}…:{index}; fail-closed") from exc
|
|
1144 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"could not read output {str(tx)[:16]}…:{index}; fail-closed") from exc
|
raise NetworkError(f"could not read output {str(tx)[: 17]}…:{index}; fail-closed") from exc
|
|
1145 |
read_confirmed_unspent_output
|
NumberReplacer
|
if not spk or value < 0:
|
if not spk or value < 1:
|
|
1145 |
read_confirmed_unspent_output
|
NumberReplacer
|
if not spk or value < 0:
|
if not spk or value < -1:
|
|
1145 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Lt_Eq
|
if not spk or value < 0:
|
if not spk or value == 0:
|
|
1145 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Lt_LtE
|
if not spk or value < 0:
|
if not spk or value <= 0:
|
|
1145 |
read_confirmed_unspent_output
|
ReplaceOrWithAnd
|
if not spk or value < 0:
|
if not spk and value < 0:
|
|
1146 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"output {str(tx)[:16]}…:{index} has an empty scriptPubKey or negative value")
|
raise NetworkError(f"output {str(tx)[: 17]}…:{index} has an empty scriptPubKey or negative value")
|
|
1146 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"output {str(tx)[:16]}…:{index} has an empty scriptPubKey or negative value")
|
raise NetworkError(f"output {str(tx)[: 15]}…:{index} has an empty scriptPubKey or negative value")
|
|
1155 |
read_confirmed_unspent_output
|
AddNot
|
if not isinstance(spent_flag, bool):
|
if not not isinstance(spent_flag, bool):
|
|
1155 |
read_confirmed_unspent_output
|
ReplaceUnaryOperator_Delete_Not
|
if not isinstance(spent_flag, bool):
|
if isinstance(spent_flag, bool):
|
|
1157 |
read_confirmed_unspent_output
|
NumberReplacer
|
f"output {str(tx)[:16]}…:{index} has an uninterpretable 'spent' field "
|
f"output {str(tx)[: 15]}…:{index} has an uninterpretable 'spent' field "
|
|
1157 |
read_confirmed_unspent_output
|
NumberReplacer
|
f"output {str(tx)[:16]}…:{index} has an uninterpretable 'spent' field "
|
f"output {str(tx)[: 17]}…:{index} has an uninterpretable 'spent' field "
|
|
1160 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"output {str(tx)[:16]}…:{index} is already SPENT; fail-closed")
|
raise NetworkError(f"output {str(tx)[: 15]}…:{index} is already SPENT; fail-closed")
|
|
1160 |
read_confirmed_unspent_output
|
NumberReplacer
|
raise NetworkError(f"output {str(tx)[:16]}…:{index} is already SPENT; fail-closed")
|
raise NetworkError(f"output {str(tx)[: 17]}…:{index} is already SPENT; fail-closed")
|
|
1193 |
list_address_utxos
|
ReplaceFalseWithTrue
|
"confirmed": require_bool(st.get("confirmed", False)),
|
"confirmed": require_bool(st.get("confirmed", True)),
|
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_Add
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str + None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_BitAnd
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str & None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_BitXor
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str ^ None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_Div
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str / None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str // None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_LShift
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str << None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_Mod
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str % None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_Mul
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str * None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_Pow
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str ** None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_RShift
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str >> None:
|
annot
|
1205 |
endpoint_host
|
ReplaceBinaryOperator_BitOr_Sub
|
def endpoint_host(url: str) -> str | None:
|
def endpoint_host(url: str) -> str - None:
|
annot
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_BitAnd
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" & url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_BitOr
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" | url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_BitXor
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" ^ url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_Div
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" / url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_FloorDiv
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" // url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_LShift
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" << url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_Mod
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" % url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_Mul
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" * url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_Pow
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" ** url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_RShift
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" >> url.strip())
|
|
1210 |
endpoint_host
|
ReplaceBinaryOperator_Add_Sub
|
parsed = urlparse(url if "://" in url else "//" + url.strip())
|
parsed = urlparse(url if "://" in url else "//" - url.strip())
|
|
1227 |
count_distinct_hosts
|
ReplaceBinaryOperator_Add_BitOr
|
return len(hosts) + opaque
|
return len(hosts) | opaque
|
|
1227 |
count_distinct_hosts
|
ReplaceBinaryOperator_Add_BitXor
|
return len(hosts) + opaque
|
return len(hosts) ^ opaque
|
|
1250 |
_verbose_tx
|
AddNot
|
tx = str(txid if isinstance(txid, Txid) else Txid(txid))
|
tx = str(txid if not isinstance(txid, Txid) else Txid(txid))
|
|
1251 |
_verbose_tx
|
ReplaceTrueWithFalse
|
data = await self._rpc("getrawtransaction", [tx, True])
|
data = await self._rpc("getrawtransaction", [tx, False])
|
|
1271 |
confirmations
|
NumberReplacer
|
return confs if confs > 0 else 0
|
return confs if confs > -1 else 0
|
|
1271 |
confirmations
|
NumberReplacer
|
return confs if confs > 0 else 0
|
return confs if confs > 1 else 0
|
|
1271 |
confirmations
|
ReplaceComparisonOperator_Gt_GtE
|
return confs if confs > 0 else 0
|
return confs if confs >= 0 else 0
|
|
1288 |
_btc_to_sats
|
NumberReplacer
|
if sats < 0:
|
if sats < -1:
|
|
1288 |
_btc_to_sats
|
NumberReplacer
|
if sats < 0:
|
if sats < 1:
|
|
1288 |
_btc_to_sats
|
ReplaceComparisonOperator_Lt_LtE
|
if sats < 0:
|
if sats <= 0:
|
|
1292 |
read_output_amount_sats
|
ReplaceBinaryOperator_Mul_Div
|
async def read_output_amount_sats(self, txid: str, vout: int, *, min_confirmations: int) -> int:
|
async def read_output_amount_sats(self, txid: str, vout: int, /, min_confirmations: int) -> int:
|
|
1294 |
read_output_amount_sats
|
ReplaceComparisonOperator_Lt_LtE
|
if confs < min_confirmations:
|
if confs <= min_confirmations:
|
|
1300 |
read_output_amount_sats
|
NumberReplacer
|
raise NetworkError(f"could not read output value for {str(txid)[:16]}…:{vout}") from exc
|
raise NetworkError(f"could not read output value for {str(txid)[: 17]}…:{vout}") from exc
|
|
1300 |
read_output_amount_sats
|
NumberReplacer
|
raise NetworkError(f"could not read output value for {str(txid)[:16]}…:{vout}") from exc
|
raise NetworkError(f"could not read output value for {str(txid)[: 15]}…:{vout}") from exc
|
|
1312 |
read_confirmed_unspent_output
|
AddNot
|
tx = str(txid if isinstance(txid, Txid) else Txid(txid))
|
tx = str(txid if not isinstance(txid, Txid) else Txid(txid))
|
|
1316 |
read_confirmed_unspent_output
|
NumberReplacer
|
f"gettxout for {tx[:16]}…:{vout} returned null — the output is spent, unconfirmed, or "
|
f"gettxout for {tx[: 17]}…:{vout} returned null — the output is spent, unconfirmed, or "
|
|
1316 |
read_confirmed_unspent_output
|
NumberReplacer
|
f"gettxout for {tx[:16]}…:{vout} returned null — the output is spent, unconfirmed, or "
|
f"gettxout for {tx[: 15]}…:{vout} returned null — the output is spent, unconfirmed, or "
|
|
1320 |
read_confirmed_unspent_output
|
ReplaceOrWithAnd
|
if not isinstance(spk_hex, str) or not spk_hex:
|
if not isinstance(spk_hex, str) and not spk_hex:
|
|
1324 |
read_confirmed_unspent_output
|
ExceptionReplacer
|
except ValueError as exc:
|
except CosmicRayTestingException as exc:
|
|
1368 |
__init__
|
NumberReplacer
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 10_000) -> None:
|
def __init__(self, readers: list, *, quorum: int = 1, dust_cap_sats: int = 10_000) -> None:
|
|
1368 |
__init__
|
NumberReplacer
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 10_000) -> None:
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 9999) -> None:
|
|
1368 |
__init__
|
NumberReplacer
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 10_000) -> None:
|
def __init__(self, readers: list, *, quorum: int = 3, dust_cap_sats: int = 10_000) -> None:
|
|
1368 |
__init__
|
NumberReplacer
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 10_000) -> None:
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 10001) -> None:
|
|
1368 |
__init__
|
ReplaceBinaryOperator_Mul_Div
|
def __init__(self, readers: list, *, quorum: int = 2, dust_cap_sats: int = 10_000) -> None:
|
def __init__(self, readers: list, /, quorum: int = 2, dust_cap_sats: int = 10_000) -> None:
|
|
1370 |
__init__
|
NumberReplacer
|
if quorum < 1:
|
if quorum < 0:
|
|
1374 |
__init__
|
NumberReplacer
|
if dust_cap_sats < 0:
|
if dust_cap_sats < -1:
|
|
1374 |
__init__
|
NumberReplacer
|
if dust_cap_sats < 0:
|
if dust_cap_sats < 1:
|
|
1374 |
__init__
|
ReplaceComparisonOperator_Lt_Eq
|
if dust_cap_sats < 0:
|
if dust_cap_sats == 0:
|
|
1374 |
__init__
|
ReplaceComparisonOperator_Lt_LtE
|
if dust_cap_sats < 0:
|
if dust_cap_sats <= 0:
|
|
1384 |
from_endpoints
|
ReplaceBinaryOperator_Mul_Div
|
*,
|
/,
|
|
1385 |
from_endpoints
|
NumberReplacer
|
quorum: int = 2,
|
quorum: int = 1,
|
|
1385 |
from_endpoints
|
NumberReplacer
|
quorum: int = 2,
|
quorum: int = 3,
|
|
1386 |
from_endpoints
|
NumberReplacer
|
dust_cap_sats: int = 10_000,
|
dust_cap_sats: int = 10001,
|
|
1386 |
from_endpoints
|
NumberReplacer
|
dust_cap_sats: int = 10_000,
|
dust_cap_sats: int = 9999,
|
|
1419 |
from_endpoints
|
NumberReplacer
|
max(1, distinct),
|
max( 2, distinct),
|
|
1419 |
from_endpoints
|
NumberReplacer
|
max(1, distinct),
|
max( 0, distinct),
|
|
1423 |
from_endpoints
|
NumberReplacer
|
effective = max(1, min(quorum, distinct))
|
effective = max( 0, min(quorum, distinct))
|
|
1428 |
default_mainnet
|
ReplaceBinaryOperator_Mul_Div
|
def default_mainnet(cls, *, quorum: int = 2, dust_cap_sats: int = 10_000) -> MultiSourceBtcFundingReader:
|
def default_mainnet(cls, /, quorum: int = 2, dust_cap_sats: int = 10_000) -> MultiSourceBtcFundingReader:
|
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_Add
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int + None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_BitAnd
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int & None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_BitXor
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int ^ None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_Div
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int / None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_FloorDiv
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int // None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_LShift
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int << None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_Mod
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int % None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_Mul
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int * None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_Pow
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int ** None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_RShift
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int >> None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_BitOr_Sub
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, *, value_sats: int - None = None) -> int:
|
annot
|
1438 |
confirmations
|
ReplaceBinaryOperator_Mul_Div
|
async def confirmations(self, txid: str, *, value_sats: int | None = None) -> int:
|
async def confirmations(self, txid: str, /, value_sats: int | None = None) -> int:
|
|
1446 |
confirmations
|
ReplaceComparisonOperator_Gt_Eq
|
require_quorum = value_sats is None or int(value_sats) > self._dust_cap_sats
|
require_quorum = value_sats is None or int(value_sats) == self._dust_cap_sats
|
|
1446 |
confirmations
|
ReplaceComparisonOperator_Gt_GtE
|
require_quorum = value_sats is None or int(value_sats) > self._dust_cap_sats
|
require_quorum = value_sats is None or int(value_sats) >= self._dust_cap_sats
|
|
1446 |
confirmations
|
ReplaceComparisonOperator_Gt_Is
|
require_quorum = value_sats is None or int(value_sats) > self._dust_cap_sats
|
require_quorum = value_sats is None or int(value_sats) is self._dust_cap_sats
|
|
1447 |
confirmations
|
ReplaceComparisonOperator_Lt_LtE
|
if require_quorum and len(oks) < self._quorum:
|
if require_quorum and len(oks) <= self._quorum:
|
|
1453 |
confirmations
|
NumberReplacer
|
return 0 # below-dust, no source responded -> 0 (the gate's >= N check fails closed)
|
return 1 # below-dust, no source responded -> 0 (the gate's >= N check fails closed)
|
|
1453 |
confirmations
|
NumberReplacer
|
return 0 # below-dust, no source responded -> 0 (the gate's >= N check fails closed)
|
return -1 # below-dust, no source responded -> 0 (the gate's >= N check fails closed)
|
|
1456 |
read_output_amount_sats
|
ReplaceBinaryOperator_Mul_Div
|
async def read_output_amount_sats(self, txid: str, vout: int, *, min_confirmations: int) -> int:
|
async def read_output_amount_sats(self, txid: str, vout: int, /, min_confirmations: int) -> int:
|
|
1462 |
read_output_amount_sats
|
NumberReplacer
|
int(a) for a in await self._gather(lambda r: r.read_output_amount_sats(txid, vout, min_confirmations=0))
|
int(a) for a in await self._gather(lambda r: r.read_output_amount_sats(txid, vout, min_confirmations= -1))
|
|
1462 |
read_output_amount_sats
|
NumberReplacer
|
int(a) for a in await self._gather(lambda r: r.read_output_amount_sats(txid, vout, min_confirmations=0))
|
int(a) for a in await self._gather(lambda r: r.read_output_amount_sats(txid, vout, min_confirmations= 1))
|
|
1466 |
read_output_amount_sats
|
NumberReplacer
|
agreed, count = Counter(amounts).most_common(1)[0]
|
agreed, count = Counter(amounts).most_common( 2)[0]
|
|
1466 |
read_output_amount_sats
|
NumberReplacer
|
agreed, count = Counter(amounts).most_common(1)[0]
|
agreed, count = Counter(amounts).most_common(1)[ -1]
|
|
1467 |
read_output_amount_sats
|
ReplaceComparisonOperator_Gt_GtE
|
if agreed > self._dust_cap_sats and count < self._quorum:
|
if agreed >= self._dust_cap_sats and count < self._quorum:
|
|
1467 |
read_output_amount_sats
|
ReplaceComparisonOperator_Gt_IsNot
|
if agreed > self._dust_cap_sats and count < self._quorum:
|
if agreed is not self._dust_cap_sats and count < self._quorum:
|
|
1467 |
read_output_amount_sats
|
ReplaceComparisonOperator_Gt_NotEq
|
if agreed > self._dust_cap_sats and count < self._quorum:
|
if agreed != self._dust_cap_sats and count < self._quorum:
|
|
1467 |
read_output_amount_sats
|
ReplaceComparisonOperator_Lt_LtE
|
if agreed > self._dust_cap_sats and count < self._quorum:
|
if agreed > self._dust_cap_sats and count <= self._quorum:
|
|
1473 |
read_output_amount_sats
|
ReplaceComparisonOperator_Lt_IsNot
|
if confs < min_confirmations:
|
if confs is not min_confirmations:
|
|
1473 |
read_output_amount_sats
|
ReplaceComparisonOperator_Lt_NotEq
|
if confs < min_confirmations:
|
if confs != min_confirmations:
|
|
1490 |
read_confirmed_unspent_output
|
NumberReplacer
|
(agreed_spk, agreed_value), count = Counter(normalized).most_common(1)[0]
|
(agreed_spk, agreed_value), count = Counter(normalized).most_common(1)[ -1]
|
|
1490 |
read_confirmed_unspent_output
|
NumberReplacer
|
(agreed_spk, agreed_value), count = Counter(normalized).most_common(1)[0]
|
(agreed_spk, agreed_value), count = Counter(normalized).most_common( 2)[0]
|
|
1491 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Gt_GtE
|
if agreed_value > self._dust_cap_sats and count < self._quorum:
|
if agreed_value >= self._dust_cap_sats and count < self._quorum:
|
|
1491 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Gt_IsNot
|
if agreed_value > self._dust_cap_sats and count < self._quorum:
|
if agreed_value is not self._dust_cap_sats and count < self._quorum:
|
|
1491 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Gt_NotEq
|
if agreed_value > self._dust_cap_sats and count < self._quorum:
|
if agreed_value != self._dust_cap_sats and count < self._quorum:
|
|
1491 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Lt_IsNot
|
if agreed_value > self._dust_cap_sats and count < self._quorum:
|
if agreed_value > self._dust_cap_sats and count is not self._quorum:
|
|
1491 |
read_confirmed_unspent_output
|
ReplaceComparisonOperator_Lt_NotEq
|
if agreed_value > self._dust_cap_sats and count < self._quorum:
|
if agreed_value > self._dust_cap_sats and count != self._quorum:
|
|
1505 |
list_address_utxos
|
ZeroIterationForLoop
|
for r in self._readers:
|
for r in []:
|
|
1508 |
list_address_utxos
|
ExceptionReplacer
|
except NetworkError:
|
except CosmicRayTestingException:
|
|
1509 |
list_address_utxos
|
ReplaceContinueWithBreak
|
continue
|
break
|
|
1513 |
close
|
ReplaceTrueWithFalse
|
await asyncio.gather(*(r.close() for r in self._readers if hasattr(r, "close")), return_exceptions=True)
|
await asyncio.gather(*(r.close() for r in self._readers if hasattr(r, "close")), return_exceptions=False)
|
|
1516 |
choose_funding_reader
|
NumberReplacer
|
def choose_funding_reader(value_sats: int, *, single, multi, dust_cap_sats: int = 10_000):
|
def choose_funding_reader(value_sats: int, *, single, multi, dust_cap_sats: int = 9999):
|
|
1516 |
choose_funding_reader
|
NumberReplacer
|
def choose_funding_reader(value_sats: int, *, single, multi, dust_cap_sats: int = 10_000):
|
def choose_funding_reader(value_sats: int, *, single, multi, dust_cap_sats: int = 10001):
|
|
1516 |
choose_funding_reader
|
ReplaceBinaryOperator_Mul_Div
|
def choose_funding_reader(value_sats: int, *, single, multi, dust_cap_sats: int = 10_000):
|
def choose_funding_reader(value_sats: int, /, single, multi, dust_cap_sats: int = 10_000):
|
|
1533 |
choose_funding_reader
|
NumberReplacer
|
if int(value_sats) < 0:
|
if int(value_sats) < 1:
|
|
1533 |
choose_funding_reader
|
ReplaceComparisonOperator_Lt_LtE
|
if int(value_sats) < 0:
|
if int(value_sats) <= 0:
|
|
1535 |
choose_funding_reader
|
NumberReplacer
|
if int(dust_cap_sats) < 0:
|
if int(dust_cap_sats) < -1:
|
|
1535 |
choose_funding_reader
|
NumberReplacer
|
if int(dust_cap_sats) < 0:
|
if int(dust_cap_sats) < 1:
|
|
1535 |
choose_funding_reader
|
ReplaceComparisonOperator_Lt_Eq
|
if int(dust_cap_sats) < 0:
|
if int(dust_cap_sats) == 0:
|
|
1535 |
choose_funding_reader
|
ReplaceComparisonOperator_Lt_LtE
|
if int(dust_cap_sats) < 0:
|
if int(dust_cap_sats) <= 0:
|
|