Skip to content
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

Merged
merged 13 commits into from
Dec 19, 2024
Merged

Kill Addrindexrs #2864

merged 13 commits into from
Dec 19, 2024

Conversation

ouziel-slama
Copy link
Contributor

@ouziel-slama ouziel-slama commented Dec 18, 2024

  • 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

@ouziel-slama ouziel-slama marked this pull request as draft December 18, 2024 12:13
@@ -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

Using open without explicitly specifying an encoding.
Base automatically changed from bootstrap to develop December 18, 2024 14:01
@ouziel-slama ouziel-slama mentioned this pull request Dec 18, 2024
8 tasks
) as e:
import traceback

Check warning

Code scanning / pylint

Import outside toplevel (traceback). Warning

Import outside toplevel (traceback).
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

Import outside toplevel (traceback).
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

Too many nested blocks (6/5).
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

Too many nested blocks (6/5).
@@ -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

Import outside toplevel (traceback).
@ouziel-slama ouziel-slama marked this pull request as ready for review December 19, 2024 14:17
@@ -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

Unexpected keyword argument 'only_tx_hashes' in function call.

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

Module 'counterpartycore.lib.exceptions' has no 'ElectrError' member; maybe 'ElectrsError'?.
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

Module 'counterpartycore.lib.exceptions' has no 'ElectrError' member; maybe 'ElectrsError'?.
@ouziel-slama ouziel-slama merged commit 9aa3c28 into develop Dec 19, 2024
19 checks passed
@ouziel-slama ouziel-slama deleted the killaddrindexrs2 branch December 19, 2024 14:38
@ouziel-slama ouziel-slama mentioned this pull request Dec 19, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants