Skip to content

Commit

Permalink
Merge pull request #134 from ElrondNetwork/fix-templates
Browse files Browse the repository at this point in the history
Do not copy wallets into the newly created contract (not necessary anymore)
  • Loading branch information
andreibancioiu authored Mar 24, 2022
2 parents 6eb4682 + 68e706c commit 9f88179
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 14 deletions.
3 changes: 3 additions & 0 deletions erdpy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion erdpy/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.1"
__version__ = "1.3.2"
2 changes: 1 addition & 1 deletion erdpy/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions erdpy/projects/templates.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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():
Expand Down
1 change: 1 addition & 0 deletions erdpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]

Expand Down
5 changes: 3 additions & 2 deletions examples/airdrop.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import logging
from argparse import ArgumentParser
from pathlib import Path
from typing import cast

from erdpy.accounts import Account, Address
Expand All @@ -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
"""
Expand All @@ -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()]
Expand Down
2 changes: 1 addition & 1 deletion examples/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/staking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9f88179

Please sign in to comment.