From 62600b6e204f9c38f7232c3735a63428d3ed3a1a Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Mon, 16 Oct 2023 10:22:29 +0300 Subject: [PATCH 1/7] add .yml file --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2d1cda92 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,8 @@ +changelog: + exclude: + labels: + - ignore-for-release-notes + categories: + - title: What's Changed + labels: + - "*" From 99ed259acfd9bdd2a34124e34a8254c71ceaeb70 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 31 Oct 2023 10:49:11 +0200 Subject: [PATCH 2/7] fix py-wallet version --- pyproject.toml | 26 +++++++++++++------------- requirements.txt | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b4476a0e..dbf59f1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "multiversx-sdk-cli" -version = "8.1.2" +version = "8.1.3" authors = [ { name="MultiversX" }, ] @@ -18,18 +18,18 @@ classifiers = [ "Operating System :: OS Independent", "Intended Audience :: Developers" ] -dependencies = [ - "toml>=0.10.2", - "requests", - "prettytable", - "ledgercomm[hid]", - "semver", - "requests-cache", - "rich==13.3.4", - "multiversx-sdk-network-providers>=0.11.0", - "multiversx-sdk-wallet>=0.7.0", - "multiversx-sdk-core>=0.5.0" -] + +[dependencies] +toml = ">=0.10.2" +requests = "*" +prettytable = "*" +ledgercomm = { version = "*", extras = ["hid"] } +semver = "*" +requests-cache = "*" +rich = "13.3.4" +multiversx-sdk-network-providers = ">=0.11.0" +multiversx-sdk-wallet = ">=0.7.0, <0.8.0" +multiversx-sdk-core = ">=0.5.0" [tool.hatch.build] include = [ diff --git a/requirements.txt b/requirements.txt index d9574c6a..1038a8ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,4 @@ rich==13.3.4 multiversx-sdk-core==0.6.0 multiversx-sdk-network-providers>=0.11.0 -multiversx-sdk-wallet>=0.7.0 +multiversx-sdk-wallet>=0.7.0, < 0.8.0 From ce00d1ede5da796a63a62984c31fe270e5d92345 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 31 Oct 2023 11:16:56 +0200 Subject: [PATCH 3/7] fix pyproject.toml dependencies --- pyproject.toml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dbf59f1d..2ef3febd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,17 +19,18 @@ classifiers = [ "Intended Audience :: Developers" ] -[dependencies] -toml = ">=0.10.2" -requests = "*" -prettytable = "*" -ledgercomm = { version = "*", extras = ["hid"] } -semver = "*" -requests-cache = "*" -rich = "13.3.4" -multiversx-sdk-network-providers = ">=0.11.0" -multiversx-sdk-wallet = ">=0.7.0, <0.8.0" -multiversx-sdk-core = ">=0.5.0" +dependencies = [ + "toml>=0.10.2", + "requests", + "prettytable", + "ledgercomm[hid]", + "semver", + "requests-cache", + "rich==13.3.4", + "multiversx-sdk-network-providers>=0.11.0", + "multiversx-sdk-wallet>=0.7.0, <0.8.0", + "multiversx-sdk-core>=0.5.0" +] [tool.hatch.build] include = [ From fecb99de915a64352a5bd0599d9dfbe1f171fbc4 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 31 Oct 2023 16:04:11 +0200 Subject: [PATCH 4/7] use wallet v0.8.0 --- multiversx_sdk_cli/accounts.py | 4 ++-- multiversx_sdk_cli/delegation/staking_provider.py | 6 ++---- multiversx_sdk_cli/sign_verify.py | 2 +- multiversx_sdk_cli/validators/core.py | 6 ++---- pyproject.toml | 2 +- requirements.txt | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/multiversx_sdk_cli/accounts.py b/multiversx_sdk_cli/accounts.py index 26037d3c..ca53d2a8 100644 --- a/multiversx_sdk_cli/accounts.py +++ b/multiversx_sdk_cli/accounts.py @@ -69,12 +69,12 @@ def __init__(self, def sign_transaction(self, transaction: ITransaction) -> str: assert self.signer is not None - return self.signer.sign(transaction).hex() + return self.signer.sign(transaction.serialize_for_signing()).hex() def sign_message(self, data: bytes) -> str: assert self.signer is not None message = MessageV1(data) - signature = self.signer.sign(message) + signature = self.signer.sign(message.serialize_for_signing()) logger.debug(f"Account.sign_message(): raw_data_to_sign = {data.hex()}, message_data_to_sign = {message.serialize_for_signing().hex()}, signature = {signature.hex()}") return signature.hex() diff --git a/multiversx_sdk_cli/delegation/staking_provider.py b/multiversx_sdk_cli/delegation/staking_provider.py index 61d43d87..1bae35a1 100644 --- a/multiversx_sdk_cli/delegation/staking_provider.py +++ b/multiversx_sdk_cli/delegation/staking_provider.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Any -from multiversx_sdk_core import Address, ArbitraryMessage +from multiversx_sdk_core import Address from multiversx_sdk_wallet.validator_pem import ValidatorPEM from multiversx_sdk_wallet.validator_signer import ValidatorSigner @@ -52,9 +52,7 @@ def prepare_args_for_add_nodes(args: Any): pem_file = ValidatorPEM.from_file(validator_pem) validator_signer = ValidatorSigner(pem_file.secret_key) - message = ArbitraryMessage(bytes.fromhex(account.address.hex())) - - signed_message = validator_signer.sign(message).hex() + signed_message = validator_signer.sign(account.address.pubkey).hex() add_nodes_data += f"@{pem_file.secret_key.generate_public_key().hex()}@{signed_message}" diff --git a/multiversx_sdk_cli/sign_verify.py b/multiversx_sdk_cli/sign_verify.py index 6e893620..1e79eef2 100644 --- a/multiversx_sdk_cli/sign_verify.py +++ b/multiversx_sdk_cli/sign_verify.py @@ -23,7 +23,7 @@ def verify_signature(self) -> bool: verifier = UserVerifier.from_address(Address.from_bech32(self.address)) verifiable_message = MessageV1.from_string(self.message) verifiable_message.signature = bytes.fromhex(self.signature) - is_signed = verifier.verify(verifiable_message) + is_signed = verifier.verify(verifiable_message.serialize_for_signing(), verifiable_message.signature) return is_signed def to_dictionary(self) -> Dict[str, str]: diff --git a/multiversx_sdk_cli/validators/core.py b/multiversx_sdk_cli/validators/core.py index bc327ad6..e4c3b0b7 100644 --- a/multiversx_sdk_cli/validators/core.py +++ b/multiversx_sdk_cli/validators/core.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Any, List, Tuple, Union -from multiversx_sdk_core import Address, ArbitraryMessage +from multiversx_sdk_core import Address from multiversx_sdk_wallet.validator_pem import ValidatorPEM from multiversx_sdk_wallet.validator_signer import ValidatorSigner @@ -60,9 +60,7 @@ def prepare_transaction_data_for_stake(node_operator_address: Address, validator pem_file = ValidatorPEM.from_file(validator_pem) validator_signer = ValidatorSigner(pem_file.secret_key) - message = ArbitraryMessage(bytes.fromhex(node_operator_address.hex())) - - signed_message = validator_signer.sign(message).hex() + signed_message = validator_signer.sign(node_operator_address.pubkey).hex() call_arguments.append(f"0x{pem_file.secret_key.generate_public_key().hex()}") call_arguments.append(f"0x{signed_message}") diff --git a/pyproject.toml b/pyproject.toml index e24bb482..178bf3b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "requests-cache", "rich==13.3.4", "multiversx-sdk-network-providers>=0.11.0", - "multiversx-sdk-wallet>=0.7.0, <0.8.0", + "multiversx-sdk-wallet>=0.8.0", "multiversx-sdk-core>=0.5.0" ] diff --git a/requirements.txt b/requirements.txt index 1038a8ac..cb9ddb4a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,4 @@ rich==13.3.4 multiversx-sdk-core==0.6.0 multiversx-sdk-network-providers>=0.11.0 -multiversx-sdk-wallet>=0.7.0, < 0.8.0 +multiversx-sdk-wallet>=0.8.0 From 345229a247ee769c1df6340ef3dc5ffc66098210 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 31 Oct 2023 17:36:10 +0200 Subject: [PATCH 5/7] set upper bound for requirements --- pyproject.toml | 6 +++--- requirements.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 178bf3b2..63920162 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,9 +27,9 @@ dependencies = [ "semver", "requests-cache", "rich==13.3.4", - "multiversx-sdk-network-providers>=0.11.0", - "multiversx-sdk-wallet>=0.8.0", - "multiversx-sdk-core>=0.5.0" + "multiversx-sdk-network-providers>=0.11.0,<0.12.0", + "multiversx-sdk-wallet>=0.8.0",<0.9.0, + "multiversx-sdk-core>=0.6.0,<0.7.0" ] [tool.hatch.build] diff --git a/requirements.txt b/requirements.txt index cb9ddb4a..c6c65f71 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,6 @@ semver requests-cache rich==13.3.4 -multiversx-sdk-core==0.6.0 -multiversx-sdk-network-providers>=0.11.0 -multiversx-sdk-wallet>=0.8.0 +multiversx-sdk-core>=0.6.0,<0.7.0 +multiversx-sdk-network-providers>=0.11.0,<0.12.0 +multiversx-sdk-wallet>=0.8.0,<0.9.9 From 194216122f5aa4c9c1fea87fcacc115a9cc2f9c8 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 31 Oct 2023 17:39:18 +0200 Subject: [PATCH 6/7] fix --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 63920162..11ae69f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "requests-cache", "rich==13.3.4", "multiversx-sdk-network-providers>=0.11.0,<0.12.0", - "multiversx-sdk-wallet>=0.8.0",<0.9.0, + "multiversx-sdk-wallet>=0.8.0,<0.9.0", "multiversx-sdk-core>=0.6.0,<0.7.0" ] From 5fc04d74f6c37e622d8014d9e63d2140a3cad09c Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 31 Oct 2023 19:03:07 +0200 Subject: [PATCH 7/7] fix typo --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c6c65f71..9059d3d6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,4 @@ rich==13.3.4 multiversx-sdk-core>=0.6.0,<0.7.0 multiversx-sdk-network-providers>=0.11.0,<0.12.0 -multiversx-sdk-wallet>=0.8.0,<0.9.9 +multiversx-sdk-wallet>=0.8.0,<0.9.0