From d5101eb726e047bf7787562ae54ef882c428007a Mon Sep 17 00:00:00 2001 From: "Frank V. Castellucci" Date: Sat, 26 Aug 2023 15:20:04 -0400 Subject: [PATCH] Closes #158 --- CHANGELOG.md | 1 + pysui/sui/sui_txn/transaction.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34871e0..abc5bcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- [bug](https://github.com/FrankC01/pysui/issues/158) Failure evaluating Command in `verify_transaction(...)` - Fails gracefully if calling `get_gas_from_faucet` on SuiClient's with non-supported config. ### Changed diff --git a/pysui/sui/sui_txn/transaction.py b/pysui/sui/sui_txn/transaction.py index 175a94e..9a8c062 100644 --- a/pysui/sui/sui_txn/transaction.py +++ b/pysui/sui/sui_txn/transaction.py @@ -208,6 +208,9 @@ def build_for_inspection(self) -> str: @versionchanged( version="0.31.0", reason="Validating against all PTB constraints" ) + @versionchanged( + version="0.34.0", reason="Fixed Command argument evaluation" + ) def verify_transaction( self, ser_kind: Optional[bytes] = None ) -> tuple[TransactionConstraints, Union[dict, None]]: @@ -252,16 +255,14 @@ def verify_transaction( args_one = len(prog_txn.value.Arguments) type_args_one = len(prog_txn.value.Type_Arguments) case "TransferObjects": - args_one = len(prog_txn.value.Arguments) + args_one = len(prog_txn.value.Objects) case "MergeCoins": args_one = len(prog_txn.value.FromCoins) case "SplitCoin": args_one = len(prog_txn.value.Amount) case "MakeMoveVec": args_one = len(prog_txn.value.Vector) - case "Publish": - args_one = len(prog_txn.value.Modules) - case "Upgrade": + case "Publish" | "Upgrade": args_one = len(prog_txn.value.Modules) case _: pass