Skip to content

Commit d196ae4

Browse files
committed
Fix requesting negative amounts
1 parent aeddc1f commit d196ae4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pycardano/txbuilder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,11 @@ def build(
952952
requested_amount = Value()
953953
for o in self.outputs:
954954
requested_amount += o.amount
955+
956+
for pid, m in self.mint.items():
957+
for tkn, am in m.items():
958+
if am < 0:
959+
requested_amount += Value(multi_asset=MultiAsset({pid: Asset({tkn: -am})}))
955960

956961
# Include min fees associated as part of requested amount
957962
requested_amount += self._estimate_fee()

0 commit comments

Comments
 (0)