Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error gotten while trying to listen to events for Python. #2253

Open
1 task done
shahid1209 opened this issue Jun 11, 2024 · 1 comment
Open
1 task done

[Bug]: Error gotten while trying to listen to events for Python. #2253

shahid1209 opened this issue Jun 11, 2024 · 1 comment

Comments

@shahid1209
Copy link

Issue description

While trying to listen to events using the Python example: bindings/python/examples/exchange/4_listen_events.py , an error is thrown that account 'Alice' cannot be found whereas, it has been created from a previous example i.e bindings/python/examples/how_tos/accounts_and_addresses/create_account.py. The file create_account.py ran with success.

Furthermore, running python3 /home/shahid/iota-sdk-wsl/iota-sdk/bindings/python/examples/how_tos/accounts_and_addresses/list_accounts.py gives the output:

AccountMetadata(alias='Alice', coinType=4219, index=0).

Hence I find it surprising that trying to listen to events gives the error noted earlier.

Version

WSL: Ubuntu 22.04.3 LTS, iota-sdk-python-v2.0.0-beta.1

Expected behaviour

Listen to events with the output given below according to the link :

AccountIndex: 0 Event: { type: 2, output: { outputId: '0x581f43218322d742c0ba1f0d738d6afbc9beaaf4c47f439ab048766b25843f920100', metadata: { blockId: '0x7fdf4079802bd00d022cc382a422491724af6564d31522b7f34133d119b7979d', transactionId: '0x581f43218322d742c0ba1f0d738d6afbc9beaaf4c47f439ab048766b25843f92', outputIndex: 1, isSpent: false, milestoneIndexBooked: 6316391, milestoneTimestampBooked: 1690125643, ledgerIndex: 6450179 }, output: { type: 3, amount: '3043981300', nativeTokens: [Array], unlockConditions: [Array] }, isSpent: false, address: { type: 0, pubKeyHash: '0x194eb32b9b6c61207192c7073562a0b3adf50a7c1f268182b552ec8999380acb' }, networkId: '1856588631910923207', remainder: false, chain: { coinType: 4218, account: 0, change: 0, addressIndex: 0 } } }

Actual behaviour

python3 /home/shahid/iota-sdk-wsl/iota-sdk/bindings/python/examples/exchange/4_listen_events.py

Traceback (most recent call last):

File "/home/shahid/iota-sdk-wsl/iota-sdk/bindings/python/examples/exchange/4_listen_events.py", line 45, in <module> account = wallet.get_account('Alice')

File "/home/shahid/iota-sdk-wsl/pyiota/lib/python3.10/site-packages/iota_sdk/wallet/wallet.py", line 77, in get_account account_data = self._call_method(

File "/home/shahid/iota-sdk-wsl/pyiota/lib/python3.10/site-packages/iota_sdk/wallet/common.py", line 65, in wrapper raise WalletError(json_response['payload'])

iota_sdk.wallet.common.WalletError: {'type': 'wallet', 'error': 'account "Alice" not found'}

Can the issue reliably be reproduced?

Yes

Steps to reproduce the issue

python3 /home/shahid/iota-sdk-wsl/iota-sdk/bindings/python/examples/exchange/4_listen_events.py

Errors

/home/shahid/iota-sdk-wsl/pyiota/bin/python /home/shahid/iota-sdk-wsl/iota-sdk/bindings/python/examples/exchange/4_listen_events.py

Traceback (most recent call last):

File "/home/shahid/iota-sdk-wsl/iota-sdk/bindings/python/examples/exchange/4_listen_events.py", line 45, in <module> account = wallet.get_account('Alice')

File "/home/shahid/iota-sdk-wsl/pyiota/lib/python3.10/site-packages/iota_sdk/wallet/wallet.py", line 77, in get_account account_data = self._call_method(

File "/home/shahid/iota-sdk-wsl/pyiota/lib/python3.10/site-packages/iota_sdk/wallet/common.py", line 65, in wrapper raise WalletError(json_response['payload'])

iota_sdk.wallet.common.WalletError: {'type': 'wallet', 'error': 'account "Alice" not found'}

Duplicate declaration

  • I have searched the issues tracker this issue and there is none
@DaughterOfMars
Copy link

The examples are intended to be run in sequence. Did you run the previous examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Product Backlog
Development

No branches or pull requests

2 participants