Skip to content

KeyError: 'address' when submitting invalid mnemonic/address #2

@SecretShell

Description

@SecretShell
  • secret_sdk version: master
  • Python version: 3.10.1
  • Operating System: Arch Linux

Description

Tell us what happened:

I inputted a invalid mnemonic

What went wrong:

The SDK threw an error saying:
KeyError: 'address'

What you expected to happen:

To run a successful create_and_sign_tx function

What I Did

        mk = MnemonicKey(
            mnemonic="INVALID_WORD there flame scrub bulb utility inside jealous decide advice dance fitness shaft odor cloud release leg van away syrup romance february depend dance"
        )
        secret = AsyncLCDClient("http://localhost:1337/", "enigma-pub-testnet-3")
        wallet = secret.wallet(mk)
        send_msg = MsgSend(
            wallet.key.acc_address,
            wallet.key.acc_address,
            "1000000uscrt",  # send 1 scrt
        )
        tx = await wallet.create_and_sign_tx(
            msgs=[send_msg],
            memo="My first transaction!",
            fee=StdFee(200000, "120000uscrt"),
        )

This is the line that throws the error https://github.com/secretanalytics/secret-sdk-python/blob/294e0d6644623c6367ff27d3e6b5a9413910763e/secret_sdk/core/auth/data/account.py#L46
There's no properties in the "value" property when an invalid address is submitted to
https://github.com/secretanalytics/secret-sdk-python/blob/294e0d6644623c6367ff27d3e6b5a9413910763e/secret_sdk/client/lcd/api/auth.py#L19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions