Skip to content

Commit f2a079d

Browse files
committed
When returning Values, it it only has a coin, return it
1 parent 1963c93 commit f2a079d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pycardano/transaction.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ def __le__(self, other: Union[Value, int]):
246246
def __lt__(self, other: Union[Value, int]):
247247
return self <= other and self != other
248248

249+
def to_shallow_primitive(self):
250+
if self.multi_asset:
251+
return super().to_shallow_primitive()
252+
else:
253+
return self.coin
254+
249255

250256
@dataclass(repr=False)
251257
class TransactionOutput(ArrayCBORSerializable):

0 commit comments

Comments
 (0)