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

client.split_coin_txn not working #129

Closed
debjit-bw opened this issue Jul 3, 2023 · 0 comments · Fixed by #130
Closed

client.split_coin_txn not working #129

debjit-bw opened this issue Jul 3, 2023 · 0 comments · Fixed by #130
Labels
bug Something isn't working

Comments

@debjit-bw
Copy link
Contributor

debjit-bw commented Jul 3, 2023

spendable_sui = client.split_coin_txn(
    signer=cfg.active_address,
    coin_object_id=sui1,
    split_amounts=[amount],
    gas=sui2,
    gas_budget=2000000
)

this fails with

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[11], line 1
----> 1 spendable_sui = client.split_coin_txn(
      2     signer=cfg.active_address,
      3     coin_object_id="0x4f3f787e0a04e90dc19f47ac473e5f669fcfdce0c5b18661cd002a5ef0c1cd54",
      4     split_amounts=[configs["HIVEPROFILE_MINT_FEE"]],
      5     gas="0xd512a63d3df9a5a9be97ba26b2162338cbdf0f844a8711bf84dd9ae648eee77f",
      6     gas_budget=2000000
      7 )

File [~/Drawer/astrotechlabs/degenhive-plus/env/lib/python3.10/site-packages/pysui/sui/sui_clients/sync_client.py:651](https://file+.vscode-resource.vscode-cdn.net/Users/debjit/Drawer/astrotechlabs/degenhive-plus/hive-testing/~/Drawer/astrotechlabs/degenhive-plus/env/lib/python3.10/site-packages/pysui/sui/sui_clients/sync_client.py:651), in SuiClient.split_coin_txn(self, signer, coin_object_id, split_amounts, gas, gas_budget)
    649 inargs: dict = locals().copy()
    650 inargs.pop("self")
--> 651 return self.execute(SplitCoin(**inargs))

File [~/Drawer/astrotechlabs/degenhive-plus/env/lib/python3.10/site-packages/pysui/sui/sui_builders/base_builder.py:297](https://file+.vscode-resource.vscode-cdn.net/Users/debjit/Drawer/astrotechlabs/degenhive-plus/hive-testing/~/Drawer/astrotechlabs/degenhive-plus/env/lib/python3.10/site-packages/pysui/sui/sui_builders/base_builder.py:297), in sui_builder.._autoargs..wrapper(self, *args, **kwargs)
    295         if sieve(attr):
    296             __var_map[attr] = val
--> 297             __var_type_map[attr] = sui_true_type(spec.annotations[attr])
    298             # __var_type_map[attr] = spec.annotations[attr]
    299 
    300 # handle keywords with defaults:
    301 if spec.kwonlydefaults:

KeyError: 'gas'

if gas is removed, it says

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[12], line 1
----> 1 spendable_sui = client.split_coin_txn(
      2     signer=cfg.active_address,
      3     coin_object_id="0x4f3f787e0a04e90dc19f47ac473e5f669fcfdce0c5b18661cd002a5ef0c1cd54",
      4     split_amounts=[configs["HIVEPROFILE_MINT_FEE"]],
      5     # gas="0xd512a63d3df9a5a9be97ba26b2162338cbdf0f844a8711bf84dd9ae648eee77f",
      6     gas_budget=2000000
      7 )

TypeError: SuiClient.split_coin_txn() missing 1 required keyword-only argument: 'gas'

most probably an issue which checks kwargs to map them to defaults. i'm not sure. merge_coin_txn works fine though

debjit-bw added a commit to debjit-bw/pysui that referenced this issue Jul 3, 2023
@debjit-bw debjit-bw mentioned this issue Jul 3, 2023
FrankC01 added a commit that referenced this issue Jul 3, 2023
@FrankC01 FrankC01 added the bug Something isn't working label Jul 5, 2023
@FrankC01 FrankC01 added this to pysui Jul 5, 2023
@github-project-automation github-project-automation bot moved this to Backlog in pysui Jul 5, 2023
@FrankC01 FrankC01 moved this from Backlog to Done in pysui Jul 5, 2023
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

Successfully merging a pull request may close this issue.

2 participants