-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kill Addrindexrs #2864
Kill Addrindexrs #2864
Conversation
ouziel-slama
commented
Dec 18, 2024
•
edited
Loading
edited
- Mock get_oldest_tx()
- use Electr to get utxos and address history
- Double-check the spelling and grammar of all strings, code comments, etc.
- Double-check that all code is deterministic that needs to be
- Add tests to cover any new or revised logic
- Ensure that the test suite passes
- Update the project release notes
- Update the project documentation, as appropriate, with a corresponding Pull Request in the Documentation repository
@@ -37,6 +37,17 @@ | |||
STATUS_CLOSED = 10 | |||
STATUS_CLOSING = 11 | |||
|
|||
CURR_DIR = os.path.dirname(os.path.realpath(__file__)) | |||
with open(os.path.join(CURR_DIR, "data", "get_oldest_tx.json")) as f: |
Check warning
Code scanning / pylint
Using open without explicitly specifying an encoding. Warning
) as e: | ||
import traceback |
Check warning
Code scanning / pylint
Import outside toplevel (traceback). Warning
return return_result(400, error=str(e), start_time=start_time, query_args=query_args) | ||
except Exception as e: | ||
capture_exception(e) | ||
logger.error("Error in API: %s", e) | ||
# import traceback | ||
# print(traceback.format_exc()) | ||
import traceback |
Check warning
Code scanning / pylint
Import outside toplevel (traceback). Warning
def pubkey_from_inputs_set(inputs_set, pubkeyhash): | ||
utxos = inputs_set.split(",") | ||
utxos = [utxo.split(":")[0] for utxo in utxos] | ||
for tx_hash in utxos: |
Check warning
Code scanning / pylint
Too many nested blocks (6/5). Warning
def pubkey_from_inputs_set(inputs_set, pubkeyhash): | ||
utxos = inputs_set.split(",") | ||
utxos = [utxo.split(":")[0] for utxo in utxos] | ||
for tx_hash in utxos: |
Check warning
Code scanning / pylint
Too many nested blocks (6/5). Warning
@@ -234,8 +234,9 @@ | |||
self.receive_message(topic, body, seq) | |||
except Exception as e: | |||
logger.error("Error processing message: %s", e) | |||
# import traceback | |||
# print(traceback.format_exc()) # for debugging | |||
import traceback |
Check warning
Code scanning / pylint
Import outside toplevel (traceback). Warning
@@ -925,17 +919,13 @@ | |||
|
|||
@dispatcher.add_method | |||
def search_raw_transactions(address, unconfirmed=True, only_tx_hashes=False): | |||
return backend.addrindexrs.search_raw_transactions( | |||
return backend.electrs.get_history( |
Check warning
Code scanning / pylint
Unexpected keyword argument 'only_tx_hashes' in function call. Warning
|
||
def electr_query(url): | ||
if config.ELECTRS_URL is None: | ||
raise exceptions.ElectrError("Electrs server not configured") |
Check warning
Code scanning / pylint
Module 'counterpartycore.lib.exceptions' has no 'ElectrError' member; maybe 'ElectrsError'?. Warning
try: | ||
return requests.get(f"{config.ELECTRS_URL}/{url}", timeout=10).json() | ||
except requests.exceptions.RequestException as e: | ||
raise exceptions.ElectrError(f"Electrs error: {e}") from e |
Check warning
Code scanning / pylint
Module 'counterpartycore.lib.exceptions' has no 'ElectrError' member; maybe 'ElectrsError'?. Warning