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 report: query_account not working #328

Open
4 tasks done
furester opened this issue Jan 18, 2023 · 0 comments
Open
4 tasks done

Bug report: query_account not working #328

furester opened this issue Jan 18, 2023 · 0 comments

Comments

@furester
Copy link

Prerequisites

Expected Behavior

I expect to receive an Account object filled with all information, in order to use it in Transaction.seal and Transaction.sign

Current Behavior

getting this error:

Traceback (most recent call last):
  File "/app/queryaccount_test.py", line 66, in <module>
    main()
  File "/app/queryaccount_test.py", line 62, in main
    account = ledger_client.query_account(wallet.address())
  File "/usr/local/lib/python3.10/site-packages/cosmpy/aerial/client/__init__.py", line 264, in query_account
    raise RuntimeError("Unexpected account type returned from query")
RuntimeError: Unexpected account type returned from query

To Reproduce

i'm using this code:

from bip_utils import Bip39SeedGenerator, Bip44, Bip44Coins

from cosmpy.aerial.client import LedgerClient, Validator
from cosmpy.aerial.config import NetworkConfig
from cosmpy.aerial.wallet import LocalWallet
from cosmpy.crypto.keypairs import PrivateKey

def main():
    """Run main."""
    
    mnemonic = "<SEED PHRASE>"

    cfg = NetworkConfig(
        chain_id="mantle-1",
        url="grpc+https://grpc.assetmantle.nodestake.top",
        fee_minimum_gas_price=0,
        fee_denomination="umntl",
        staking_denomination="umntl",
    )
    ledger_client = LedgerClient(cfg)

    #ledger_client.gas_strategy()

    seed_bytes = Bip39SeedGenerator(mnemonic).Generate()
    bip44_def_ctx = Bip44.FromSeed(seed_bytes, Bip44Coins.COSMOS).DeriveDefaultPath()

    wallet = LocalWallet(PrivateKey(bip44_def_ctx.PrivateKey().Raw().ToBytes()), prefix="mantle")
    account = ledger_client.query_account(wallet.address())


if __name__ == "__main__":
    main()

to reproduce you need to fill mnemonic with your seed phrase

Context

running in docker, python:3.10-slim as base image with python3-dev package added

Failure Logs

Traceback (most recent call last):
  File "/app/queryaccount_test.py", line 66, in <module>
    main()
  File "/app/queryaccount_test.py", line 62, in main
    account = ledger_client.query_account(wallet.address())
  File "/usr/local/lib/python3.10/site-packages/cosmpy/aerial/client/__init__.py", line 264, in query_account
    raise RuntimeError("Unexpected account type returned from query")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant