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 caught when passing str as argument in pgql SuiTransaction.move_call() #210

Closed
nekohakase opened this issue Jun 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nekohakase
Copy link

An error was found when calling a sui contract function which taking vector as an input:

When calling with, e.g.

txn.move_call(
        target=f"{contract_addr}::{module_name}::{mint_func}",
        arguments=[minter_cap, "foo_name","foo_description", "ipfs://foo_url", "ipfs://foo_url"]
    )

Got

/Users/jingan/Dev/sui_poc/pysui_poc_personal/poc_personal.py:174: DeprecationWarning: Call to deprecated class _SuiTransactionBase. (Transitioning to sui_pgql) -- Deprecated since version 0.54.0.
  txn = SuiTransaction(client=client, initial_sender=initial_sender)
Traceback (most recent call last):
  File "/Users/jingan/Dev/sui_poc/pysui_poc_personal/poc_personal.py", line 255, in <module>
    append_mint_and_transfer_move_calls(txn, CONTRACT_ADDRESS, MINTER_CAP, alice_addr)
  File "/Users/jingan/Dev/sui_poc/pysui_poc_personal/poc_personal.py", line 183, in append_mint_and_transfer_move_calls
    result = txn.move_call(
             ^^^^^^^^^^^^^^
  File "/Users/jingan/Dev/sui_poc/pysui_poc_personal/venv/lib/python3.11/site-packages/pysui/sui/sui_pgql/pgql_sync_txn.py", line 494, in move_call
    parms = ab.build_args(self.client, arguments, ars)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jingan/Dev/sui_poc/pysui_poc_personal/venv/lib/python3.11/site-packages/pysui/sui/sui_pgql/pgql_txn_argb.py", line 290, in build_args
    track.convert_args[aindex] = _argument_validate(
                                 ^^^^^^^^^^^^^^^^^^^
  File "/Users/jingan/Dev/sui_poc/pysui_poc_personal/venv/lib/python3.11/site-packages/pysui/sui/sui_pgql/pgql_txn_argb.py", line 225, in _argument_validate
    raise ValueError("Expected list type argument...")
ValueError: Expected list type argument...

Expected:
python string can be converted to vector when calling move_call()

@FrankC01 FrankC01 self-assigned this Jun 5, 2024
@FrankC01 FrankC01 added the bug Something isn't working label Jun 5, 2024
@FrankC01 FrankC01 added this to pysui Jun 5, 2024
@github-project-automation github-project-automation bot moved this to Backlog in pysui Jun 5, 2024
@FrankC01 FrankC01 moved this from Backlog to In Progress in pysui Jun 5, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in pysui Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants