From 852f37e56636a0330d698b9c646731bab765ac3e Mon Sep 17 00:00:00 2001 From: Andrei Bancioiu Date: Thu, 24 Mar 2022 10:31:18 +0200 Subject: [PATCH 1/2] Bufix: do not copy wallets into the newly create template anymore (not necessary anymore). --- erdpy/accounts.py | 2 +- erdpy/projects/templates.py | 6 ------ erdpy/utils.py | 1 + examples/airdrop.py | 5 +++-- examples/contracts.py | 2 +- examples/staking.py | 4 ++-- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/erdpy/accounts.py b/erdpy/accounts.py index 05a7b9ea..78e04603 100644 --- a/erdpy/accounts.py +++ b/erdpy/accounts.py @@ -87,7 +87,7 @@ class Address(IAddress): BECH32_LENGTH = 62 _value_hex: str - def __init__(self, value): + def __init__(self, value: Any): self._value_hex = '' if not value: diff --git a/erdpy/projects/templates.py b/erdpy/projects/templates.py index 69ff17c1..dcc4d708 100644 --- a/erdpy/projects/templates.py +++ b/erdpy/projects/templates.py @@ -1,7 +1,6 @@ import json import logging import os -from os import path from pathlib import Path import shutil from typing import Any, List, Tuple @@ -11,7 +10,6 @@ from erdpy.projects.project_rust import CargoFile from erdpy.projects.templates_config import get_templates_repositories from erdpy.projects.templates_repository import TemplatesRepository -from erdpy.testnet import wallets logger = logging.getLogger("projects.templates") ERDJS_SNIPPETS_FOLDER_NAME = "erdjs-snippets" @@ -61,10 +59,6 @@ def create_from_template(project_name: str, template_name: str, directory: Path) logger.info("Project created, template applied.") - wallets.copy_all_to(path.join(project_directory, "wallets")) - - logger.info("Test wallets have been copied into the project.") - def _download_templates_repositories(): for repo in get_templates_repositories(): diff --git a/erdpy/utils.py b/erdpy/utils.py index 8ef0641a..90318fdc 100644 --- a/erdpy/utils.py +++ b/erdpy/utils.py @@ -183,6 +183,7 @@ def find_in_dictionary(dictionary, compound_path): def list_files(folder: Path, suffix: Optional[str] = None) -> List[Path]: + folder = folder.expanduser() files: List[Path] = [folder / file for file in os.listdir(folder)] files = [file for file in files if file.is_file()] diff --git a/examples/airdrop.py b/examples/airdrop.py index 366c70ce..bf9107cc 100644 --- a/examples/airdrop.py +++ b/examples/airdrop.py @@ -1,6 +1,7 @@ import logging from argparse import ArgumentParser +from pathlib import Path from typing import cast from erdpy.accounts import Account, Address @@ -16,7 +17,7 @@ def main(): export PYTHONPATH=. python3 ./examples/airdrop.py \ --proxy=https://testnet-gateway.elrond.com \ - --accounts=./erdpy/testnet/wallets/users \ + --accounts=~/elrondsdk/testwallets/latest/users \ --sender=erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th\ --value=1000000000000000000 """ @@ -32,7 +33,7 @@ def main(): proxy = ElrondProxy(args.proxy) network = proxy.get_network_config() - accounts = AccountsRepository.create_from_folder(args.accounts) + accounts = AccountsRepository.create_from_folder(Path(args.accounts)) sender = cast(Account, accounts.get_account(Address(args.sender))) sender.sync_nonce(proxy) receivers = [account for account in accounts.get_all() if account.address.bech32() != sender.address.bech32()] diff --git a/examples/contracts.py b/examples/contracts.py index c8037136..dd22ad44 100644 --- a/examples/contracts.py +++ b/examples/contracts.py @@ -16,7 +16,7 @@ export PYTHONPATH=. python3 ./examples/contracts.py \ --proxy=https://testnet-gateway.elrond.com \ - --pem=./erdpy/testnet/wallets/users/alice.pem + --pem=~/elrondsdk/testwallets/latest/users/alice.pem Sample contracts to be used (at deploy & upgrade): ./examples/bytecode/counter.wasm (functions: increment, decrement, get) diff --git a/examples/staking.py b/examples/staking.py index 5272e4ab..9966d242 100644 --- a/examples/staking.py +++ b/examples/staking.py @@ -17,8 +17,8 @@ def main(): export PYTHONPATH=. python3 ./examples/staking.py \ --proxy=https://testnet-gateway.elrond.com \ - --keyfile=./erdpy/testnet/wallets/users/alice.json \ - --passfile=./erdpy/testnet/wallets/users/password.txt \ + --keyfile=~/elrondsdk/testwallets/latest/users/alice.json \ + --passfile=~/elrondsdk/testwallets/latest/users/password.txt \ --reward-address="erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th" \ --validators-file=./erdpy/tests/testdata/validators.json \ --value=2500000000000000000000 From 68e706c1b79cef4b4556d477a8cd91c9c653d2b4 Mon Sep 17 00:00:00 2001 From: Andrei Bancioiu Date: Thu, 24 Mar 2022 10:43:03 +0200 Subject: [PATCH 2/2] Bump version: 1.3.2. --- erdpy/CHANGELOG.md | 3 +++ erdpy/_version.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/erdpy/CHANGELOG.md b/erdpy/CHANGELOG.md index 71a799da..cb34fb80 100644 --- a/erdpy/CHANGELOG.md +++ b/erdpy/CHANGELOG.md @@ -7,6 +7,9 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [Unreleased] - TBD +## [1.3.2] + - [Do not copy test wallets into the newly created contract (not necessary anymore)](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/134) + ## [1.3.1] - [Re-add the pattern erdpy/wallet/*.txt in MANIFEST.in. Was removed by mistake in a previous release.](https://github.com/ElrondNetwork/elrond-sdk-erdpy/pull/133) diff --git a/erdpy/_version.py b/erdpy/_version.py index 9c73af26..f708a9b2 100644 --- a/erdpy/_version.py +++ b/erdpy/_version.py @@ -1 +1 @@ -__version__ = "1.3.1" +__version__ = "1.3.2" diff --git a/setup.py b/setup.py index a9c2fb07..c7b05a33 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ with open("README.md", "r") as fh: long_description = "https://github.com/ElrondNetwork/elrond-sdk-erdpy" -VERSION = "1.3.1" +VERSION = "1.3.2" try: with open('./erdpy/_version.py', 'wt') as versionfile: