Skip to content

Automatically add build_and_sign signers to required_signers #202

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

Merged
merged 1 commit into from
Apr 12, 2023
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
7 changes: 6 additions & 1 deletion pycardano/txbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,12 +1237,17 @@ def build_and_sign(
to the current slot number + the given offset (default 10_000).
A manually set ttl will always take precedence.
auto_required_signers (Optional[bool]): Automatically add all pubkeyhashes of transaction inputs
to required signatories (default only for Smart Contract transactions).
and the given signers to required signatories (default only for Smart Contract transactions).
Manually set required signers will always take precedence.

Returns:
Transaction: A signed transaction.
"""
# The given signers should be required signers if they weren't added yet
if auto_required_signers and self.scripts and not self.required_signers:
self.required_signers = [
s.to_verification_key().hash() for s in signing_keys
]

tx_body = self.build(
change_address=change_address,
Expand Down