Iota Library for python. Recovery wallet, which has already created by phrase working incorrect.
Closed this issue · 3 comments
abcen7 commented
Bug description
import os
import shutil
import random
import iota_wallet
path = "static/user_wallets/test"
mnemonic = 'park target phrase cheese agent turn lunch wolf broccoli glance famous camp orient maid ribbon observe decrease cave subway possible hire puppy leader chronic'
def get(password):
account_manager = iota_wallet.AccountManager(path)
account_manager.set_stronghold_password(password)
wallet = account_manager.get_account('Wallet')
wallet.sync().execute()
print(wallet.latest_address()["address"]["inner"])
def creating(password):
if os.path.exists(path):
iota_wallet.AccountManager(path).stop_background_sync()
shutil.rmtree(path)
account_manager = iota_wallet.AccountManager(storage_path=path)
account_manager.set_stronghold_password(password)
account_manager.store_mnemonic("Stronghold", mnemonic)
client_options = {"nodes": [
{
"url": "https://api.lb-0.h.chrysalis-devnet.iota.cafe/",
"auth": None,
"disabled": False
}
], "local_pow": True}
account_initializer = account_manager.create_account(client_options)
account_initializer.alias('Wallet')
account: iota_wallet.AccountHandle = account_initializer.initialise()
account.sync().execute()
password = "1234"
for i in range(3):
password += random.choice("1234")
creating(password)
get(password)
print(f"Get {i}")
Rust version
No version, boys
- Rust version:
No version, boys
Which version of the library are you using?
- Version number, commit, or branch: macos-iota-wallet-py3.9-wheel
Hardware specification
What hardware are you using?
Macbook air M2
- Operating system:
- RAM: 8gb
- Cores: 8
- Device: Macbook air M2
Steps To reproduce the bug
Explain how the maintainer can reproduce the bug.
- Download the lib, install that on your computer
- Copy this code and paste to .py file
- Execute and get error
Expected behaviour
In the directory in which the wallet has already been created, delete the folder with files and create a new wallet by mnemonic
Actual behaviour
Drops the random error
Errors
Thoralf-M commented
Please try the python-destroy branch https://github.com/iotaledger/wallet.rs/tree/python-destroy
I added an example with which it works for me https://github.com/iotaledger/wallet.rs/blob/python-destroy/bindings/python/examples/destroy.py
thibault-martinez commented
@abcen7 Hi, please can you try the given branch to check if it's working for you? Thanks in advance.
abcen7 commented
@thibault-martinez Working, thx