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

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft

Kill Addrindexrs #2864

wants to merge 7 commits into from

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.
@@ -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.electr.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.
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
@@ -18,6 +18,7 @@
- Add a timeout to parse mempool transaction from ZMQ
- Add cache for unsupported transactions when parsing raw
- Refactor bootstrap: clean code, use `zstd` instead `gzip`, decompress and verify signature in parallel
- Remove Addrindexrs dependency: mock `get_oldest_tx()`, use Electr to get utxos and address history
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> "to get utxos and address history for tx composition"

@@ -618,6 +585,16 @@ def initialise_config(
config.GUNICORN_THREADS_PER_WORKER = gunicorn_threads_per_worker
config.GUNICORN_WORKERS = gunicorn_workers

if electr_url:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

electr -> electrs

) 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).
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