commit f3a8be0295a0d054356b41f3a39abdc8bd89cb0c
parent c5f2890d7360eac98601b49652d317676b743f50
Author: parazyd <parazyd@dyne.org>
Date: Fri, 9 Apr 2021 09:05:58 +0200
Remove dependency on python-bitcoinlib.
Diffstat:
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/py.yaml b/.github/workflows/py.yaml
@@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install python-bitcoinlib pyzmq
+ pip install pyzmq
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests
run: |
diff --git a/electrumobelisk/protocol.py b/electrumobelisk/protocol.py
@@ -317,7 +317,7 @@ class ElectrumProtocol(asyncio.Protocol): # pylint: disable=R0904,R0902
_ec, data = await self.bx.fetch_balance(query["params"][0])
if _ec and _ec != 0:
- self.log.debug("Got erorr: %s", repr(_ec))
+ self.log.debug("Got error: %s", repr(_ec))
return {"error": "request corrupted"}
# TODO: confirmed/unconfirmed, see what's happening in libbitcoin
diff --git a/electrumobelisk/zeromq.py b/electrumobelisk/zeromq.py
@@ -23,7 +23,6 @@ from random import randint
import zmq
import zmq.asyncio
-from bitcoin.core import COutPoint
from electrumobelisk.libbitcoin_errors import make_error_code, ErrorCode
from electrumobelisk.util import bh2u
@@ -371,7 +370,7 @@ class Client:
kind, height, tx_hash, index, value = row
return (
kind,
- COutPoint(tx_hash, index),
+ {"hash": tx_hash, "index": index},
height,
value,
checksum(tx_hash[::-1].hex(), index),
@@ -439,9 +438,9 @@ class Client:
continue
spent = {
- "hash": point[1].hash,
+ "hash": point[1]["hash"],
"height": point[2],
- "index": point[1].n,
+ "index": point[1]["index"],
}
if point[3] not in checksum_to_index:
transfers.append({"spent": spent})
@@ -461,9 +460,9 @@ class Client:
transfers.append({
"received": {
- "hash": point[1].hash,
+ "hash": point[1]["hash"],
"height": point[2],
- "index": point[1].n,
+ "index": point[1]["index"],
},
"value": point[3],
})