Skip to content

Commit b3e9f1d

Browse files
authored
Merge branch 'main' into 1yam-download_ipfs-rebased
2 parents c3d18a6 + 70f28da commit b3e9f1d

File tree

14 files changed

+79
-26
lines changed

14 files changed

+79
-26
lines changed

docker/python-3.10.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN pip install --upgrade pip wheel twine
2020

2121
# Preinstall dependencies for faster steps
2222
RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
23-
RUN pip install --upgrade 'aleph-message~=0.3.1' eth_account pynacl base58
23+
RUN pip install --upgrade 'aleph-message~=0.4.0' eth_account pynacl base58
2424
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
2525

2626
WORKDIR /opt/aleph-sdk-python/

docker/python-3.11.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN pip install --upgrade pip wheel twine
2020

2121
# Preinstall dependencies for faster steps
2222
RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
23-
RUN pip install --upgrade 'aleph-message~=0.3.1' pynacl base58
23+
RUN pip install --upgrade 'aleph-message~=0.4.0' pynacl base58
2424
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
2525

2626
WORKDIR /opt/aleph-sdk-python/

docker/python-3.9.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN pip install --upgrade pip wheel twine
2020

2121
# Preinstall dependencies for faster steps
2222
RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
23-
RUN pip install --upgrade 'aleph-message~=0.3.1' eth_account pynacl base58
23+
RUN pip install --upgrade 'aleph-message~=0.4.0' eth_account pynacl base58
2424
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
2525

2626
WORKDIR /opt/aleph-sdk-python/

docker/ubuntu-20.04.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN pip install --upgrade pip wheel twine
2525

2626
# Preinstall dependencies for faster steps
2727
RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
28-
RUN pip install --upgrade 'aleph-message~=0.3.1' eth_account pynacl base58
28+
RUN pip install --upgrade 'aleph-message~=0.4.0' eth_account pynacl base58
2929
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
3030

3131
WORKDIR /opt/aleph-sdk-python/

docker/ubuntu-22.04.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN pip install --upgrade pip wheel twine
2525

2626
# Preinstall dependencies for faster steps
2727
RUN pip install --upgrade secp256k1 coincurve aiohttp eciespy python-magic typer
28-
RUN pip install --upgrade 'aleph-message~=0.3.1' eth_account pynacl base58
28+
RUN pip install --upgrade 'aleph-message~=0.4.0' eth_account pynacl base58
2929
RUN pip install --upgrade pytest pytest-cov pytest-asyncio mypy types-setuptools pytest-asyncio fastapi httpx requests
3030

3131
WORKDIR /opt/aleph-sdk-python/

scripts/build-and-shell.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ else
1010
DOCKER_COMMAND=docker
1111
fi
1212

13-
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
13+
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/python-3.9.dockerfile .
1414
$DOCKER_COMMAND run -ti --rm --entrypoint /bin/bash -v "$(pwd)":/opt/aleph-sdk-python aleph-sdk-python

scripts/build-and-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ else
1010
DOCKER_COMMAND=docker
1111
fi
1212

13-
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
13+
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/python-3.9.dockerfile .
1414
$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/pytest aleph-sdk-python /opt/aleph-sdk-python/ "$@"
1515
$DOCKER_COMMAND run -ti --rm --entrypoint /opt/venv/bin/mypy aleph-sdk-python /opt/aleph-sdk-python/src/ --ignore-missing-imports

scripts/build-to-publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fi
1313
mkdir -p ./dist
1414
chmod 0777 ./dist
1515

16-
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/Dockerfile .
16+
$DOCKER_COMMAND build -t aleph-sdk-python -f docker/python-3.9.dockerfile .
1717
$DOCKER_COMMAND run -ti --rm \
1818
-w /opt/aleph-sdk-python \
1919
-v "$(pwd)/dist":/opt/aleph-sdk-python/dist \

setup.cfg

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ install_requires =
3838
eciespy>=0.3.13; python_version>="3.11"
3939
typing_extensions
4040
typer
41-
aleph-message~=0.3.2
41+
aleph-message==0.4.0
4242
eth_account>=0.4.0
4343
# Required to fix a dependency issue with parsimonious and Python3.11
4444
eth_abi==4.0.0b2; python_version>="3.11"
@@ -59,7 +59,7 @@ exclude =
5959
# PDF = ReportLab; RXP
6060
# Add here test requirements (semicolon/line-separated)
6161
testing =
62-
aiomqtt
62+
aiomqtt<=0.1.3
6363
psutil
6464
pytest
6565
pytest-cov
@@ -80,12 +80,11 @@ testing =
8080
isort
8181
flake8
8282
mqtt =
83-
aiomqtt
83+
aiomqtt<=0.1.3
8484
certifi
8585
Click
8686
nuls2 =
87-
# use the branch with support for Python 3.11
88-
nuls2-python@git+https://github.com/odesenfans/nuls2-python.git@fda2ba4a5f9397f4f84cfee738942c4a15f88840
87+
aleph-nuls2
8988
ethereum =
9089
eth_account>=0.4.0
9190
# Required to fix a dependency issue with parsimonious and Python3.11

src/aleph/sdk/chains/common.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from abc import ABC, abstractmethod
23
from pathlib import Path
34
from typing import Dict, Optional
@@ -6,11 +7,11 @@
67
from ecies import decrypt, encrypt
78

89
from aleph.sdk.conf import settings
9-
10-
import logging
10+
from aleph.sdk.utils import enum_as_str
1111

1212
logger = logging.getLogger(__name__)
1313

14+
1415
def get_verification_buffer(message: Dict) -> bytes:
1516
"""
1617
Returns the verification buffer that Aleph nodes use to verify the signature of a message.
@@ -22,7 +23,16 @@ def get_verification_buffer(message: Dict) -> bytes:
2223
Returns:
2324
bytes: Verification buffer
2425
"""
25-
return "{chain}\n{sender}\n{type}\n{item_hash}".format(**message).encode("utf-8")
26+
27+
# Convert Enum values to strings
28+
return "\n".join(
29+
(
30+
enum_as_str(message["chain"]),
31+
message["sender"],
32+
enum_as_str(message["type"]),
33+
message["item_hash"],
34+
)
35+
).encode()
2636

2737

2838
def get_public_key(private_key):

0 commit comments

Comments
 (0)