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

Fix crucial references to withdrawal #316

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions pycardano/txbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ def add_withdrawal_script(
TransactionBuilder: Current transaction builder.
"""
if redeemer:
if redeemer.tag is not None and redeemer.tag != RedeemerTag.REWARD:
if redeemer.tag is not None and redeemer.tag != RedeemerTag.WITHDRAWAL:
raise InvalidArgumentException(
f"Expect the redeemer tag's type to be {RedeemerTag.REWARD}, "
f"Expect the redeemer tag's type to be {RedeemerTag.WITHDRAWAL}, "
f"but got {redeemer.tag} instead."
)
redeemer.tag = RedeemerTag.REWARD
redeemer.tag = RedeemerTag.WITHDRAWAL
self._consolidate_redeemer(redeemer)

if isinstance(script, UTxO):
Expand Down Expand Up @@ -1259,9 +1259,7 @@ def _update_execution_units(
assert (
r.tag is not None
), "Expected tag of redeemer to be set, but found None"
tagname = (
r.tag.name.lower() if r.tag != RedeemerTag.REWARD else "withdrawal"
)
tagname = r.tag.name.lower()
key = f"{tagname}:{r.index}"
if (
key not in estimated_execution_units
Expand Down
Loading